[PIPE2D-1322] Inability to fit aperture corrections can lead to reduceExposure.py failing Created: 26/Oct/23  Updated: 27/Oct/23  Resolved: 27/Oct/23

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

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

Issue Links:
Relates
relates to PIPE2D-1119 No good points in aperture correction Open

 Description   

When running reduceExposure.py with doMeasureLines=True, an apparent failure to measure aperture corrections leads to the processing failing. In many cases I don't care about the photometry (e.g. if I'm looking at focal plane distortions). For now setting the appCorr to NaN and proceeding might be acceptable. Setting the aperture correction to 1.0 would require that we signal this failure to the user in some other way.

E.g. the command

reduceExposure.py /work/drp --calib /work/drp/CALIB --rerun rhl/calibrations-2023-07-v6 -c isr.doFlat=False isr.doFlatNir=True isr.doDark=False useCalexp=True doAdjustDetectorMap=False doMeasureLines=True --id visit=96958 arm=r spectrograph=1

fails with:

reduceExposure FATAL: Failed on dataId={'visit': 96958, 'arm': 'r', 'spectrograph': 1, 'dateObs': '2023-07-20', 'site': 'S', 'category': 'A', 'field': 'GE_EN1_P1_PA_90', 'ccd': 1, 'filter': 'r', 'expTime': 60.0, 'dataType': 'COMPARISON', 'taiObs': '2023-07-20T09:52:52.553', 'pfsDesignId': 1562097688427952981, 'slitOffset': 0.0}: RuntimeError: No good points
Traceback (most recent call last):
  File "/work/stack_INFRA-312/stack/miniconda3-py38_4.9.2-3.0.0/Linux64/pipe_base/g590c34a36e+5da9528084/python/lsst/pipe/base/cmdLineTask.py", line 436, in __call__
    result = self.runTask(task, dataRef, kwargs)
  File "/work/stack_INFRA-312/stack/miniconda3-py38_4.9.2-3.0.0/Linux64/pipe_base/g590c34a36e+5da9528084/python/lsst/pipe/base/cmdLineTask.py", line 504, in runTask
    return task.runDataRef(dataRef, **kwargs)
  File "/home/rhl/PFS/drp/stella/python/pfs/drp/stella/reduceExposure.py", line 277, in runDataRef
    calibs = self.getSpectralCalibs(sensorRef, exposure, pfsConfig, boxcarWidth)
  File "/home/rhl/PFS/drp/stella/python/pfs/drp/stella/reduceExposure.py", line 599, in getSpectralCalibs
    phot = self.photometerLines.run(exposure, lines[notTrace], detectorMap, pfsConfig, fiberTraces)
  File "/home/rhl/PFS/drp/stella/python/pfs/drp/stella/photometerLines.py", line 99, in run
    phot = self.photometerLines(exposure, referenceLines, detectorMap, pfsConfig, fiberTraces)
  File "/home/rhl/PFS/drp/stella/python/pfs/drp/stella/photometerLines.py", line 177, in photometerLines
    apCorr = self.apertureCorrection.run(exposure, pfsConfig, detectorMap, lines)
  File "/home/rhl/PFS/drp/stella/python/pfs/drp/stella/apertureCorrections.py", line 125, in run
    apCorr = self.fit.run(corrections, pfsConfig, minWavelength=minWavelength,
  File "/home/rhl/PFS/drp/stella/python/pfs/drp/stella/fitFocalPlane.py", line 109, in run
    raise RuntimeError("No good points")
RuntimeError: No good points


 Comments   
Comment by rhl [ 26/Oct/23 ]

https://github.com/Subaru-PFS/drp_stella/pull/338

Comment by Kiyoto Yabe [ 26/Oct/23 ]

What is the relation to PIPE2D-1119?

Comment by rhl [ 26/Oct/23 ]

Good question! The answer is that I'd forgotten that that ticket existed as it hadn't been fixed.

One of these needs to be closed. I can push the fix to this one, and note that a better solution is still expected to come from PIPE2D-1119. But we need a fix; I did it today to support the calibration QA work that Wilfred is doing.

Comment by rhl [ 27/Oct/23 ]

Merged to master

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