Skip to content

Commit

Permalink
Update extract_1d_step.py to call pastasoss
Browse files Browse the repository at this point in the history
This calls the pastasoss module to generate the correct wavemap and spectrace reffiles for the PWCPOS of the given observation.
  • Loading branch information
hover2pi authored Mar 29, 2024
1 parent 415de86 commit 6a595da
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion jwst/extract_1d/extract_1d_step.py
Original file line number Diff line number Diff line change
Expand Up @@ -430,7 +430,18 @@ def process(self, input):
wavemap_ref_name = self.get_reference_file(input_model, 'wavemap')
specprofile_ref_name = self.get_reference_file(input_model, 'specprofile')
speckernel_ref_name = self.get_reference_file(input_model, 'speckernel')


# Generate modified wavemap and spectrace reference files that include PWCPOS information
import pastasoss
pwcpos = input_model.find_fits_keyword('PWCPOS')
new_wavemap_ref_name = wavemap_ref_name.replace('.fits', '_pwcpos.fits')
new_spectrace_ref_name = spectrace_ref_name.replace('.fits', '_pwcpos.fits')
pastasoss.write_soss_reffiles(pwcpos=pwcpos, wavemap_filepath=new_wavemap_ref_name, spectrace_filepath=new_spectrace_ref_name)

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

View check run for this annotation

Codecov / codecov/patch

jwst/extract_1d/extract_1d_step.py#L435-L439

Added lines #L435 - L439 were not covered by tests

# Update the spectrace and wavemap reference file locations
wavemap_ref_name = new_wavemap_ref_name
spectrace_ref_name = new_spectrace_ref_name

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

View check run for this annotation

Codecov / codecov/patch

jwst/extract_1d/extract_1d_step.py#L442-L443

Added lines #L442 - L443 were not covered by tests

# Build SOSS kwargs dictionary.
soss_kwargs = dict()
soss_kwargs['threshold'] = self.soss_threshold
Expand Down

0 comments on commit 6a595da

Please sign in to comment.