You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
While experimenting with setting polynomial background regions in extract_1d for BOTS data, I came across a crash when background upper and lower limits are both out of range for some part of the array. This happens when setting a region above and below the curved spectral trace in a narrow subarray: there is data within the background limits for part of the array, but not the full array. In this case, the limits are checked and both upper and lower limits are set to the edge of the array (0 at the bottom, ns at the top).
The crash comes from line 702 in jwst/extract_1d/extract1d.py:
IndexError: index 6 is out of bounds for axis 0 with size 6
I think the problem is that when counting intervals (npts, line 680), intervals with equal upper and lower limits are not counted, but when computing background levels, the value at that point is added to the val array (line 702). I think the fix should be to skip intervals for which upper and lower limits are equal – it is not likely that that point contains a valid background level anyway.
The text was updated successfully, but these errors were encountered:
A more complex one might be needed if we want to preserve the case where a single region is specified with the same upper and lower limits, and the intent is to extract one pixel.
Issue JP-3601 was created on JIRA by Melanie Clarke:
While experimenting with setting polynomial background regions in extract_1d for BOTS data, I came across a crash when background upper and lower limits are both out of range for some part of the array. This happens when setting a region above and below the curved spectral trace in a narrow subarray: there is data within the background limits for part of the array, but not the full array. In this case, the limits are checked and both upper and lower limits are set to the edge of the array (0 at the bottom, ns at the top).
The crash comes from line 702 in jwst/extract_1d/extract1d.py:
IndexError: index 6 is out of bounds for axis 0 with size 6
I think the problem is that when counting intervals (npts, line 680), intervals with equal upper and lower limits are not counted, but when computing background levels, the value at that point is added to the val array (line 702). I think the fix should be to skip intervals for which upper and lower limits are equal – it is not likely that that point contains a valid background level anyway.
The text was updated successfully, but these errors were encountered: