Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NRC_WFSS background subtraction error: index -1 is out of bounds for axis 0 with size 0 #8061

Closed
stscijgbot-jp opened this issue Nov 8, 2023 · 10 comments · Fixed by #8916
Closed

Comments

@stscijgbot-jp
Copy link
Collaborator

Issue JP-3426 was created on JIRA by John Scott:

Using build 9.3.1, we saw some reprocessing level 2b errors for NRC_WFSS processing in the background subtraction step for 

jw01187-o013_20230917t104234_spec2_00013

 

and

 

jw01187-o024_20230917t104234_spec2_00013

 

 
Traceback (most recent call last):
File "/dms/local/jwst/pipeline/pkgs/miniconda3/envs/jwstdp-1.11.4.20230814-py3.9/lib/python3.9/site-packages/jwst/pipeline/calwebb_spec2.py", line 122, in process
result = self.process_exposure_product(
File "/dms/local/jwst/pipeline/pkgs/miniconda3/envs/jwstdp-1.11.4.20230814-py3.9/lib/python3.9/site-packages/jwst/pipeline/calwebb_spec2.py", line 257, in process_exposure_product
calibrated = self.bkg_subtract(calibrated, members_by_type['background'])
File "/dms/local/jwst/pipeline/pkgs/miniconda3/envs/jwstdp-1.11.4.20230814-py3.9/lib/python3.9/site-packages/stpipe/step.py", line 478, in run
step_result = self.process(*args)
File "/dms/local/jwst/pipeline/pkgs/miniconda3/envs/jwstdp-1.11.4.20230814-py3.9/lib/python3.9/site-packages/jwst/background/background_step.py", line 63, in process
result = background_sub.subtract_wfss_bkg(
File "/dms/local/jwst/pipeline/pkgs/miniconda3/envs/jwstdp-1.11.4.20230814-py3.9/lib/python3.9/site-packages/jwst/background/background_sub.py", line 192, in subtract_wfss_bkg
sci_mean = robust_mean(input_model.data[bkg_mask],
File "/dms/local/jwst/pipeline/pkgs/miniconda3/envs/jwstdp-1.11.4.20230814-py3.9/lib/python3.9/site-packages/jwst/background/background_sub.py", line 312, in robust_mean
limits = np.percentile(cleaned_x, (lowlim, highlim))
File "/dms/local/jwst/pipeline/pkgs/miniconda3/envs/jwstdp-1.11.4.20230814-py3.9/lib/python3.9/site-packages/numpy/lib/function_base.py", line 4283, in percentile
return _quantile_unchecked(
File "/dms/local/jwst/pipeline/pkgs/miniconda3/envs/jwstdp-1.11.4.20230814-py3.9/lib/python3.9/site-packages/numpy/lib/function_base.py", line 4555, in _quantile_unchecked
return _ureduce(a,
File "/dms/local/jwst/pipeline/pkgs/miniconda3/envs/jwstdp-1.11.4.20230814-py3.9/lib/python3.9/site-packages/numpy/lib/function_base.py", line 3823, in _ureduce
r = func(a, **kwargs)
File "/dms/local/jwst/pipeline/pkgs/miniconda3/envs/jwstdp-1.11.4.20230814-py3.9/lib/python3.9/site-packages/numpy/lib/function_base.py", line 4721, in _quantile_ureduce_func
result = _quantile(arr,
File "/dms/local/jwst/pipeline/pkgs/miniconda3/envs/jwstdp-1.11.4.20230814-py3.9/lib/python3.9/site-packages/numpy/lib/function_base.py", line 4830, in _quantile
slices_having_nans = np.isnan(arr[-1, ...])
IndexError: index -1 is out of bounds for axis 0 with size 0
reprocessing in the past has been successful.

@stscijgbot-jp
Copy link
Collaborator Author

Comment by Howard Bushouse on JIRA:

Tyler Pauly Do we know if this might've been fixed by any WFSS updates that were included in B10.0.x?

@stscijgbot-jp
Copy link
Collaborator Author

Comment by Tyler Pauly on JIRA:

It looks related to JP-3234 but that should be present for this run. I can take a look.

@stscijgbot-jp
Copy link
Collaborator Author

stscijgbot-jp commented Nov 9, 2023

Comment by Tyler Pauly on JIRA:

Disregard previous comment, I can reproduce the error.

@stscijgbot-jp
Copy link
Collaborator Author

Comment by Tyler Pauly on JIRA:

Issue caused by complete coverage of frame with source bounding boxes, leaving no pixels from which to define a background region. This should be skipped, but the background subtraction code sees the reference pixel border as valid pixels, only causing an error once the mask is applied to the data array, where the reference pixels have NaN values. Will have a PR in with a fix shortly.

@stscijgbot-jp
Copy link
Collaborator Author

Comment by Howard Bushouse on JIRA:

Fixed by #8070

@stscijgbot-jp
Copy link
Collaborator Author

Comment by Hien Tran on JIRA:

will check when program 01187 is reproed with b10.1 in ops. 

@stscijgbot-jp
Copy link
Collaborator Author

Comment by Hien Tran on JIRA:

all l2b asns for 1187 have been dropped per DMSOPS-1045, so we can't test the fix for the datasets in this ticket, but repro of program 1076 with  b11.0.2 showed this same error in ops, so it appears this may still be an issue? see jw01076-o124_20241013t063610_spec2_00001; Directory Path: /ifs/archive/ops/jwst/info/owl/logs/owlmgr_jw01076-o124_20241013t063610_spec2_00001_1728831053.822951.

the alog.out is attached.

@stscijgbot-jp stscijgbot-jp reopened this Oct 23, 2024
@stscijgbot-jp
Copy link
Collaborator Author

Comment by Tyler Pauly on JIRA:

Prior fix needs an edit - oops!

@stscijgbot-jp
Copy link
Collaborator Author

Comment by Tyler Pauly on JIRA:

Second fix implemented in #8916

@stscijgbot-jp
Copy link
Collaborator Author

Comment by Hien Tran on JIRA:

also affected jw05398-c1048_20241211t150815_spec2_00008 

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant