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

Fix bug in emicorr logic for finding matching ref file info #8375

Merged
merged 2 commits into from
Mar 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,8 @@ emicorr
allow the user to run the step for given frequencies with an on-the-fly
generated reference file. [#8270]

- Fixed bug for finding correction data for subarray FULL. [#8375]

exp_to_source
-------------

Expand Down
11 changes: 6 additions & 5 deletions jwst/emicorr/emicorr.py
Original file line number Diff line number Diff line change
Expand Up @@ -585,13 +585,14 @@
mdl_dict = subarray_cases.to_flat_dict()
for subname in subarray_cases.subarray_cases:
subname = subname.split(sep='.')[0]
if subarray not in subname:
dataconfig = subarray
if 'FULL' in dataconfig:
dataconfig = subarray + '_' + readpatt.replace('R1', '')

Check warning on line 590 in jwst/emicorr/emicorr.py

View check run for this annotation

Codecov / codecov/patch

jwst/emicorr/emicorr.py#L590

Added line #L590 was not covered by tests
if dataconfig != subname:
continue
log.debug('Found subarray case {}!'.format(subname))
for item, val in mdl_dict.items():
if subname in item:
if 'FULL' in item and readpatt not in item:
continue
if "rowclocks" in item:
rowclocks = val
elif "frameclocks" in item:
Expand All @@ -601,8 +602,8 @@
frequencies.append(val)
elif "FAST" in readpatt and "FAST" in item:
frequencies.append(val)
if subname is not None and rowclocks is not None and frameclocks is not None and frequencies is not None:
break
if subname is not None and rowclocks is not None and frameclocks is not None and frequencies is not None:
break
return subname, rowclocks, frameclocks, frequencies


Expand Down