Skip to content

Commit

Permalink
Get PSF file from CRDS; turn on position optimization
Browse files Browse the repository at this point in the history
  • Loading branch information
melanieclarke committed Dec 26, 2024
1 parent d42c597 commit 77847cc
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
6 changes: 4 additions & 2 deletions jwst/extract_1d/extract_1d_step.py
Original file line number Diff line number Diff line change
Expand Up @@ -222,8 +222,10 @@ def _get_extract_reference_files_by_mode(self, model, exp_type):

if exp_type in extract.OPTIMAL_EXPTYPES:
specwcs_ref = self.get_reference_file(model, 'specwcs')
#psf_ref = self.get_reference_file(model, 'psf')
psf_ref = "MIRI_LRS_SLIT_EPSF_20240602_WAVE_1D.fits"
self.log.info(f'Using SPECWCS file {specwcs_ref}')

Check warning on line 225 in jwst/extract_1d/extract_1d_step.py

View check run for this annotation

Codecov / codecov/patch

jwst/extract_1d/extract_1d_step.py#L223-L225

Added lines #L223 - L225 were not covered by tests

psf_ref = self.get_reference_file(model, 'psf')
self.log.info(f'Using PSF file {psf_ref}')

Check warning on line 228 in jwst/extract_1d/extract_1d_step.py

View check run for this annotation

Codecov / codecov/patch

jwst/extract_1d/extract_1d_step.py#L227-L228

Added lines #L227 - L228 were not covered by tests
else:
specwcs_ref = 'N/A'
psf_ref = 'N/A'

Check warning on line 231 in jwst/extract_1d/extract_1d_step.py

View check run for this annotation

Codecov / codecov/patch

jwst/extract_1d/extract_1d_step.py#L230-L231

Added lines #L230 - L231 were not covered by tests
Expand Down
3 changes: 2 additions & 1 deletion jwst/extract_1d/psf_profile.py
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,7 @@ def _profile_residual(param, cutout, cutout_var, xidx, yidx, psf_subpix,
**extract_kwargs)
var = result[1].T
model = result[-1].T
var[var == 0] = 1.0
return np.nansum((model - cutout)**2 / var)

Check warning on line 191 in jwst/extract_1d/psf_profile.py

View check run for this annotation

Codecov / codecov/patch

jwst/extract_1d/psf_profile.py#L188-L191

Added lines #L188 - L191 were not covered by tests


Expand Down Expand Up @@ -239,7 +240,7 @@ def nod_pair_location(input_model, middle_wl, dispaxis):


def psf_profile(input_model, psf_ref_name, specwcs_ref_name, middle_wl, location,

Check warning on line 242 in jwst/extract_1d/psf_profile.py

View check run for this annotation

Codecov / codecov/patch

jwst/extract_1d/psf_profile.py#L242

Added line #L242 was not covered by tests
optimize_shifts=False, model_nod_pair=True):
optimize_shifts=True, model_nod_pair=True):
"""Create a spatial profile from a PSF reference.
Currently only works on MIRI LRS-FIXEDSLIT exposures.
Expand Down

0 comments on commit 77847cc

Please sign in to comment.