diff --git a/breads/instruments/jwstnirspec_cal.py b/breads/instruments/jwstnirspec_cal.py index d11e6ec..3e00bc4 100644 --- a/breads/instruments/jwstnirspec_cal.py +++ b/breads/instruments/jwstnirspec_cal.py @@ -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 @@ -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 diff --git a/breads/jwst_tools/reduction_utils.py b/breads/jwst_tools/reduction_utils.py index b1990fb..6ec0b0a 100644 --- a/breads/jwst_tools/reduction_utils.py +++ b/breads/jwst_tools/reduction_utils.py @@ -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 @@ -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},