Skip to content

Commit

Permalink
JP-3248 MIRI Subarrays 390 Hz EMI bug fix 3 (#8151)
Browse files Browse the repository at this point in the history
  • Loading branch information
penaguerrero committed Dec 20, 2023
1 parent 7d33c0b commit c357f75
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 7 deletions.
5 changes: 4 additions & 1 deletion CHANGES.rst
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
1.13.2 (unreleased)
===================

-
emicorr
-------

- Fix another bug with subarray=Full. [#8151]

1.13.1 (2023-12-19)
===================
Expand Down
16 changes: 10 additions & 6 deletions jwst/emicorr/emicorr.py
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,11 @@ def apply_emicorr(input_model, emicorr_model, save_onthefly_reffile,

# Initialize the output model as a copy of the input
output_model = input_model.copy()
nints, ngroups, ny, nx = np.shape(output_model.data)
if nints_to_phase is None:
nints_to_phase = nints
elif nints_to_phase > nints:
nints_to_phase = nints

# create the dictionary to store the frequencies and corresponding phase amplitudes
if save_intermediate_results and save_onthefly_reffile is not None:
Expand All @@ -260,9 +265,6 @@ def apply_emicorr(input_model, emicorr_model, save_onthefly_reffile,
# Read image data and set up some variables
orig_data = output_model.data
data = orig_data.copy()
nints, ngroups, ny, nx = np.shape(data)
if nints_to_phase is None:
nints_to_phase = nints

# Correspondance of array order in IDL
# sz[0] = 4 in idl
Expand Down Expand Up @@ -618,10 +620,10 @@ def get_subarcase(subarray_cases, subarray, readpatt, detector):
# search and return the specific values for the configuration
if isinstance(subarray_cases, dict):
for subname in subarray_cases:
if subarray not in subname:
if subarray == 'FULL':
subarray = subarray + '_' + readpatt
if subarray != subname:
continue
if subname == 'FULL':
subname = subname + '_' + readpatt
rowclocks = subarray_cases[subname]["rowclocks"]
frameclocks = subarray_cases[subname]["frameclocks"]
if readpatt == "SLOW":
Expand All @@ -639,6 +641,8 @@ def get_subarcase(subarray_cases, subarray, readpatt, detector):
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 Down

0 comments on commit c357f75

Please sign in to comment.