[PIPE2D-936] SplinedDetectorMap::findFiberId is broken Created: 09/Nov/21  Updated: 11/Nov/21  Resolved: 11/Nov/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

Sprint: 2DDRP-2021 A11
Reviewers: hassan

 Description   

With the bootstrapped PFI detectorMap from PIPE2D-933, rhl reports that findFiberId produces obviously-wrong results:

y = 2945
for x in [97, 692, 711, 2602]:
    print(f"({x},{y}) {detMap.findFiberId(geom.PointD(x, y))}")

produces:

(97, 2945) 315
(692, 2945) 315
(711, 2945) 315
(2602, 2945) 231


 Comments   
Comment by price [ 11/Nov/21 ]

Note that this only occurs with the SplinedDetectorMap that we use for the simulator-derived and bootstrapped detectorMaps. Other subclasses of DetectorMap (in particular the DoubleDetectorMap we generally use, derived from fitting arc lines and sky lines) use a different implementation of findFiberId. So this bug should not be seen in the wild if we're using the right detectorMaps.

Comment by price [ 11/Nov/21 ]

Dumped the SplinedDetectorMap::findFiberId implementation, and moved the ModelBasedDetectorMap::findFiberId into the base class for all to use.

pfs@52d67892cb5d:~/pfs/drp_stella (tickets/PIPE2D-936=) $ python -c 'from pfs.drp.stella import DetectorMap; from lsst.geom import Point2D; detMap = DetectorMap.readFits("pfsDetectorMap-068100-r1.fits"); print(detMap.findFiberId(Point2D(97, 2945)), detMap.findFiberId(Point2D(711, 2945)), detMap.getXCenter(647, 2945), detMap.getXCenter(548, 2945))'
647 548 97.01797764634567 711.3482153210797
Comment by price [ 11/Nov/21 ]

Merged.

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