Skip to content
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
4 changes: 2 additions & 2 deletions breads/instruments/jwstnirspec_cal.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ def _init_wcs(self, filename):
from gwcs import wcstools

hdulist = pyfits.open(filename)
calfile = jwst.datamodels.open(hdulist) # save time opening by passing the already opened file
calfile = datamodels.open(filename)
photom_dataset = DataSet(calfile)

# Compute 2D wavelength and pixel area arrays for the whole image
Expand Down Expand Up @@ -135,7 +135,7 @@ def _init_wcs(self, filename):
y = y.reshape(y.shape[0], 1) * np.ones((1, xmax - xmin))

# Transform all those pixels to RA, Dec, wavelength
skycoords, speccoord = wcses[i](x, y, with_units=True)
skycoords, speccoord = wcses[i].pixel_to_world(x, y)

ra_array[ymin:ymax, xmin:xmax] = skycoords.ra
dec_array[ymin:ymax, xmin:xmax] = skycoords.dec
Expand Down
5 changes: 4 additions & 1 deletion breads/jwst_tools/reduction_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,9 @@ def run_stage2(rate_files, output_dir, skip_cubes=True, overwrite=False, TA=Fals

pathloss_skip = TA # For target acq images, skip the pathloss step, otherwise don't skip it.

from packaging.version import Version
clean_flicker_step = 'clean_flicker_noise' if Version(jwst.__version__) > Version("1.20") else 'nsclean'

step_parameters = {
# spec2.assign_wcs.skip = False
# spec2.bkg_subtract.skip = False
Expand All @@ -253,7 +256,7 @@ def run_stage2(rate_files, output_dir, skip_cubes=True, overwrite=False, TA=Fals
# spec2.flat_field.skip = False
# spec2.pathloss.skip = False
'pathloss':{'skip':pathloss_skip},
'nsclean':{'skip':nsclean_skip},
clean_flicker_step: {'skip': nsclean_skip},
# spec2.photom.skip = False
'cube_build': {'skip': skip_cubes}, # We do not want or need interpolated cubes
'extract_1d': {'skip': True},
Expand Down
Loading