[PIPE2D-611] reduceArc should also fix the x-direction of the DetectorMap Created: 23/Jun/20  Updated: 05/Jan/21  Resolved: 29/Jun/20

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

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

Attachments: PNG File after.png     PNG File before.png     File pipe2d-611.yaml    
Issue Links:
Blocks
blocks PIPE2D-490 Evaluate the quality of the PSF fitti... Won't Fix
Sprint: 2DDRP-2021 A
Reviewers: hassan

 Description   

As discussed on telecons June 19 and June 22, `reduceArc` function that modifies DetectorMap at the moment only `fixes` the DetectorMap in the wavelength direction (y-direction), but it does not modify the DetectorMap in the x-direction (perpendicular to the wavelength direction). This causes 2D PSF subtractions to be very poor and it is not possible to analyze the quality of the subtraction. 

(I have left story points empty as I have no good idea of the scope of this work)



 Comments   
Comment by price [ 25/Jun/20 ]

reduceArc.py already has a doUpdateCenters config parameter, but it uses the fiberTrace! I'll add something to tweak it using the arc lines also.

Choosing which feature to use should be left to the user, as the software can't know whether the user will prefer the centers from the arc or the quartz.

Comment by price [ 27/Jun/20 ]
(lsst-scipipe) pprice@tiger2-sumire:/tigress/pprice/pipe2d-611 $ generateCommands.py /projects/HSC/PFS/LAM/ --calib /projects/HSC/PFS/LAM/CALIB-price --rerun price/pipe2d-611 --blocks=pipe2d_611 -j 10 pipe2d-611.yaml calibs.sh --devel --force

(lsst-scipipe) pprice@tiger2-sumire:/tigress/pprice/pipe2d-611 $ detrend.py /projects/HSC/PFS/LAM --calib /projects/HSC/PFS/LAM/CALIB-price --rerun price/pipe2d-611 --id visit=21515 arm=r --no-versions

(lsst-scipipe) pprice@tiger2-sumire:/tigress/pprice/pipe2d-611 $ bootstrapDetectorMap.py /projects/HSC/PFS/LAM --calib /projects/HSC/PFS/LAM/CALIB-price --rerun price/pipe2d-611 --flatId visit=21122 arm=r --arcId visit=21515 arm=r

bootstrap INFO: Matched 370 lines
bootstrap INFO: Median difference from detectorMap: -9.974619,-5.693824 pixels
bootstrap INFO: Fit 193/228 points, rms: x=0.043026 y=0.119466 total=0.088148 pixels
bootstrap INFO: Updating detectorMap...
bootstrap INFO: Median difference from detectorMap: -10.189670,-5.453311 pixels
bootstrap INFO: Fit 120/142 points, rms: x=0.101351 y=0.097857 total=0.085120 pixels
bootstrap INFO: Updating detectorMap...

(lsst-scipipe) pprice@tiger2-sumire:/tigress/pprice/pipe2d-611 $ cp /projects/HSC/PFS/LAM/rerun/price/pipe2d-611/DETECTORMAP/pfsDetectorMap-021515-r1.fits /projects/HSC/PFS/LAM/CALIB-price/DETECTORMAP/pfsDetectorMap-000000-r1.fits

Looks pretty good! We're going to have to introduce an artificial shift, to demonstrate we can undo it...

>>> import astropy.io.fits
>>> ff = astropy.io.fits.open("/projects/HSC/PFS/LAM/CALIB-price/DETECTORMAP/pfsDetectorMap-000000-r1.fits")
>>> ff[3].header["EXTNAME"]
'CENTER'
>>> ff[3].data.value += 1.0
>>> ff.writeto("/projects/HSC/PFS/LAM/CALIB-price/DETECTORMAP/pfsDetectorMap-000000-r1.fits", clobber=True)

(lsst-scipipe) pprice@tiger2-sumire:/tigress/pprice/pipe2d-611 $ displayDetectorMap.py /projects/HSC/PFS/LAM --calib /projects/HSC/PFS/LAM/CALIB-price --rerun price/pipe2d-611 --id visit=21515 arm=r --no-versions

(lsst-scipipe) pprice@tiger2-sumire:/tigress/pprice/pipe2d-611 $ reduceArc.py /projects/HSC/PFS/LAM --calib /projects/HSC/PFS/LAM/CALIB-price --rerun price/pipe2d-611 --id visit=21515 arm=r --no-versions

reduceArc INFO: Tweaking fiber 650 xCenter by -1.232491 (+/- 0.049559)
reduceArc INFO: Tweaking fiber 587 xCenter by -1.166069 (+/- 0.029186)
reduceArc INFO: Tweaking fiber 525 xCenter by -1.219642 (+/- 0.038179)
reduceArc INFO: Tweaking fiber 464 xCenter by -1.191371 (+/- 0.045484)
reduceArc INFO: Tweaking fiber 401 xCenter by -1.206986 (+/- 0.057679)
reduceArc INFO: Tweaking fiber 339 xCenter by -1.186496 (+/- 0.110483)
reduceArc INFO: Tweaking fiber 255 xCenter by -1.190592 (+/- 0.118263)
reduceArc INFO: Tweaking fiber 192 xCenter by -1.098192 (+/- 0.114480)
reduceArc INFO: Tweaking fiber 63 xCenter by -1.195772 (+/- 0.094612)
reduceArc INFO: Tweaking fiber 2 xCenter by -1.110896 (+/- 0.140032)

(lsst-scipipe) pprice@tiger2-sumire:/tigress/pprice/pipe2d-611 $ displayDetectorMap.py /projects/HSC/PFS/LAM --calib /projects/HSC/PFS/LAM/CALIB-price --rerun price/pipe2d-611 --id visit=21515 arm=r --no-versions -c frame=2
Comment by ncaplar [ 27/Jun/20 ]

Looks good!

Comment by price [ 27/Jun/20 ]

The arc-based tweak works, as demonstrated in the attached figures.

Before tweak (with an artificial 1 pixel offset):

After tweak:

Comment by price [ 27/Jun/20 ]

ncaplar: note the addition of a new script, displayDetectorMap.py, which I hope will make it easier to see the quality of the detectorMaps relative to the arcs. See the above log for details on how to use it.

Comment by ncaplar [ 27/Jun/20 ]

Ok. Looking forward to it. This is tested on simulation and not on the real data, right?

 

Comment by price [ 27/Jun/20 ]

The above is LAM data.

Comment by price [ 29/Jun/20 ]

Merged to master yesterday, while Jira was down.

Generated at Sat Feb 10 15:55:23 JST 2024 using Jira 8.3.4#803005-sha1:1f96e09b3c60279a408a2ae47be3c745f571388b.