[PIPE2D-769] Same detectorMap, different results Created: 10/Mar/21  Updated: 11/Mar/21  Resolved: 11/Mar/21

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

Reviewers: hassan

 Description   

ncaplar reports that a detectorMap from a NevenPsf stored in an Exposure produces different results than the original detectorMap.

>>> from lsst.daf.persistence import Butler
>>> butler = Butler("/projects/HSC/PFS/Subaru/rerun/ncaplar/PIPE2D-753_Mar08_2021")
>>> exposure = butler.get("calexp", visit=34444, arm="r")
>>> detMap = butler.get("detectorMap", visit=34444, arm="r")
>>> type(exposure.getPsf().detectorMap)
<class 'pfs.drp.stella.DifferentialDetectorMap.DifferentialDetectorMap'>
>>> type(detMap)
<class 'pfs.drp.stella.DifferentialDetectorMap.DifferentialDetectorMap'>
>>> detMap.getModel()
GlobalDetectorModel(fiberPitch=6.02277, dispersion=0.0857817, wavelengthCenter=803.584, xDistortion=[0.0197347, -0.15232, -0.302261, -0.192858, 0.00101599, -0.171317, 0.0181012, 0.030957, 0.214334, -0.0492333, 0.110177, -0.182638, 0.0686335, 0.127963, -0.00705449], yDistortion=[0.134633, 0.0586965, -2.0191, 0.071586, -0.205868, -0.0258182, -0.0801921, -0.262664, -0.0703506, -0.338104, -0.0921519, 0.0679767, -0.0628442, 0.00877666, 0.048743], highCcd=[0.000104501, 1.33972e-05, 0.000503429, 1.91947e-05, -0.270192, -0.0491371], spatialOffsets=[       0, 0, 0, 0, 0, 0, 0, 0, 0, 0], spectralOffsets=[       0, 0, 0, 0, 0, 0, 0, 0, 0, 0])
>>> exposure.getPsf().detectorMap.getModel()
GlobalDetectorModel(fiberPitch=6.02277, dispersion=0.0857817, wavelengthCenter=803.584, xDistortion=[0.0197347, -0.15232, -0.302261, -0.192858, 0.00101599, -0.171317, 0.0181012, 0.030957, 0.214334, -0.0492333, 0.110177, -0.182638, 0.0686335, 0.127963, -0.00705449], yDistortion=[0.134633, 0.0586965, -2.0191, 0.071586, -0.205868, -0.0258182, -0.0801921, -0.262664, -0.0703506, -0.338104, -0.0921519, 0.0679767, -0.0628442, 0.00877666, 0.048743], highCcd=[0.000104501, 1.33972e-05, 0.000503429, 1.91947e-05, -0.270192, -0.0491371], spatialOffsets=[       0, 0, 0, 0, 0, 0, 0, 0, 0, 0], spectralOffsets=[       0, 0, 0, 0, 0, 0, 0, 0, 0, 0])
>>> detMap.getSpatialOffsets()
array([-4.65994211, -4.61147483, -4.31057693, -4.28007593, -4.09437721,
       -4.04091348, -3.88834297, -3.8409035 , -3.7044756 , -3.54896128])
>>> exposure.getPsf().detectorMap.getSpatialOffsets()
array([-4.65994211, -4.61147483, -4.31057693, -4.28007593, -4.09437721,
       -4.04091348, -3.88834297, -3.8409035 , -3.7044756 , -3.54896128])
>>> detMap.getWavelength(339)
array([623.16398681, 623.25170331, 623.3394206 , ..., 982.1046201 ,
       982.18674955, 982.26887537])
>>> exposure.getPsf().detectorMap.getWavelength(339)
array([623.35505992, 623.44265463, 623.53025018, ..., 981.9270798 ,
       982.00911812, 982.0911528 ])
>>> exposure.getPsf().detectorMap.getXCenter(339)
array([1998.33609206, 1998.33657061, 1998.33704998, ..., 1998.20844818,
       1998.20782554, 1998.20720018])
>>> detMap.getXCenter(339)
array([1997.33893983, 1997.33989275, 1997.34084659, ..., 1998.6570738 ,
       1998.65658071, 1998.65608469])


 Comments   
Comment by price [ 10/Mar/21 ]

This was a stupid copy/paste error in persistence code that wasn’t being tested. Expanded the tests to catch this, and discovered a lack of precision in the FITS I/O as well.

Comment by price [ 11/Mar/21 ]

Merged to master.

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