[PIPE2D-1063] Tune CR parameters for simulator data Created: 22/Jul/22  Updated: 14/Oct/22  Resolved: 12/Oct/22

Status: Done
Project: DRP 2-D Pipeline
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Story Priority: Normal
Reporter: price Assignee: price
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Attachments: JPEG File pipe2d-1063.jpg    
Issue Links:
Relates
relates to PIPE2D-188 constructFiberFlat.py uses pipe_drive... Open
relates to PIPE1D-63 Bad redshift measurements again? Done
Story Points: 2
Sprint: 2DDRP-2022 F
Reviewers: hassan

 Description   

The simulator produces sharper features than the actual instrument does, so fiber traces often get mis-identified as CRs. This is especially bad in the NIR, where there are lots of bright sky lines, and when working with bright targets.

Tune the CR parameters for the integration test and the weekly+science to minimise CR false positives.



 Comments   
Comment by rhl [ 22/Jul/22 ]

Wouldn't it be easier and more realistic to degrade the spots a little?

Comment by price [ 01/Sep/22 ]

Discovered that the simulator and Subaru PSFs aren't extremely different (x and y sigma for 2D Gaussian fit to arc lines was about 1.3 for both), and that we're having the same problems with CR finding on the Subaru quartz observations as we're having with the simulator. Tried tuning CR parameters but wasn't able to reliably find CRs while avoiding false positives from the traces. Decided to try subtracting a vertical median filter to remove the traces before CR finding, and this works very nicely, finding CRs that I had trouble identifying visually on the original. It does find a sprinkling of false-positives, but they are not systematically distributed along the traces as they were before. Perhaps we might benefit from careful parameter tuning, but this change already results in a dramatic improvement in CR finding quality.

Comment by rhl [ 02/Sep/22 ]

Can you attach some images?  This sounds like a good and simple approach, but something more sophisticated (extraction; median filter; project back onto traces; subtract) might work better.

Comment by price [ 02/Sep/22 ]

The below image shows the calexp image, the trace-subtracted image, and the calexp mask.

I tried the more sophisticated approach, but currently extraction and image generation from fiber traces introduces step functions into the data that makes CR finding much worse; I'm hoping PIPE2D-907 (and odd-even quartz observations) will fix this.

Comment by price [ 20/Sep/22 ]

Kiyoto Yabe ran the weekly with this change and found poor redshift performance, but it was not clear that CR masking was to blame.

Comment by price [ 01/Oct/22 ]

Note: I need to convert the Gen3 pipeline to also implement the trace subtraction before searching for CRs. This will involve moving things around some, as I want to do it after adjusting the detectorMap (so we have an opportunity to mask sky lines).

Comment by price [ 04/Oct/22 ]

Kiyoto Yabe writes:

The 1D redshift determination is much improved with the new one (although there are some mis-identification but only a few). The CRs (and other features) are masked properly in this version as far as I checked.

Comment by price [ 08/Oct/22 ]

rhl requests checking visit=80748 arm=r, where sky lines are being masked as CRs.

Comment by hassan [ 08/Oct/22 ]

Code changes provided in pull requests look fine to me. Minor comments in PR for drp_stella: https://github.com/Subaru-PFS/drp_stella/pull/284

Comment by price [ 12/Oct/22 ]

Ran visit=80748 arm=r with the ticket branch. CRs are getting masked just fine, and sky lines are not causing false positives.

Comment by price [ 12/Oct/22 ]

Merged.

Comment by vlebrun [ 13/Oct/22 ]

I confirm that things are going back to normal, 93% success rate in  the redshift measurement in the latest weekly run 

Comment by price [ 13/Oct/22 ]

But this merged after the most recent weekly...?

Comment by vlebrun [ 13/Oct/22 ]

ah... the improvements come from other modification then? but the fact is that the bad pixels I used to see in the September weekly runs are not present in the October 10 one...

Comment by price [ 13/Oct/22 ]

Maybe the data you received were processed with this branch, but it could not have been part of the Proper weekly.

Comment by Ali Allaoui [ 14/Oct/22 ]

According to header, drp_stella version is w.2022.40a-12-g033bd60+1

Comment by price [ 14/Oct/22 ]

OK, so that's this branch on top of the last weekly.

Comment by Kiyoto Yabe [ 14/Oct/22 ]

Yes, I forgot to switch back to the normal mode after I checked the new fix, so yes, the results are from that branch. Sorry.

Comment by vlebrun [ 14/Oct/22 ]

well, don't be sorry, now we know that the fix worked fine

Generated at Sat Feb 10 16:02:16 JST 2024 using Jira 8.3.4#803005-sha1:1f96e09b3c60279a408a2ae47be3c745f571388b.