[PIPE2D-786] DifferentialDetectorMap produces OutOfRangeError instead of NaN Created: 17/Mar/21  Updated: 18/Mar/21  Resolved: 18/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

Sprint: 2DDRP-2021 A3
Reviewers: hassan

 Description   

rhl reports:

detMap = DetectorMap.readFits("/projects/HSC/PFS/Subaru/CALIB-SuNSS/DETECTORMAP/pfsDetectorMap-046270-b1.fits")
detMap.findPoint(3, 683.138)

raises:

OutOfRangeError: 
  File "src/GlobalDetectorModel.cc", line 209, in lsst::geom::Point2D pfs::drp::stella::GlobalDetectorModel::operator()(const Point2D&, std::size_t, bool) const
    xi,eta=(17.983522,2414.269953) fiberId,wavelength=((3, 683.138)) is out of range of Box2D(Point2D(11.3896, -2192.4), Extent2D(4079.86, 4384.8)) {0}
lsst::pex::exceptions::OutOfRangeError: 'xi,eta=(17.983522,2414.269953) fiberId,wavelength=((3, 683.138)) is out of range of Box2D(Point2D(11.3896, -2192.4), Extent2D(4079.86, 4384.8))'

The expected result is (NaN, NaN).



 Comments   
Comment by price [ 18/Mar/21 ]

After the fix:

>>> from pfs.drp.stella import DetectorMap
>>> detMap = DetectorMap.readFits("/projects/HSC/PFS/Subaru/CALIB-SuNSS/DETECTORMAP/pfsDetectorMap-046270-b1.fits")
>>> detMap.findPoint(3, 683.138)
Point2D(nan, nan)
Comment by hassan [ 18/Mar/21 ]

Changes look fine. Exceptions should be logged however. Please see pull request comments for details.

Comment by price [ 18/Mar/21 ]

Added a way to allow exceptions to propagate, but that is off by default.

Merged to master.

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