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 12, 2024
1 parent ef42111 commit 099b2b3
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}')

psf_ref = self.get_reference_file(model, 'psf')
self.log.info(f'Using PSF file {psf_ref}')
else:
specwcs_ref = 'N/A'
psf_ref = 'N/A'
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)


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,
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 099b2b3

Please sign in to comment.