diff --git a/jwst/pipeline/calwebb_ami3.py b/jwst/pipeline/calwebb_ami3.py index ee58f4ac79..cbc6cd2caf 100644 --- a/jwst/pipeline/calwebb_ami3.py +++ b/jwst/pipeline/calwebb_ami3.py @@ -74,7 +74,7 @@ def process(self, input): # Do the LG analysis for this image log.debug('Do LG processing for member %s', input_file) - result1, result2, result3 = self.ami_analyze(input_file) + result1, result2, result3 = self.ami_analyze.run(input_file) # Save the averaged LG analysis results to a file result1.meta.asn.pool_name = asn['asn_pool'] @@ -90,7 +90,7 @@ def process(self, input): # Do the LG analysis for this image log.debug('Do LG processing for member %s', input_file) - result1, result2, result3 = self.ami_analyze(input_file) + result1, result2, result3 = self.ami_analyze.run(input_file) # Save the LG analysis results to a file result1.meta.asn.pool_name = asn['asn_pool'] @@ -104,7 +104,7 @@ def process(self, input): # assuming one ref star exposure per targ exposure if (len(psf_files) > 0) & (len(targ_files) > 0): for (targ, psf) in zip(targ_lg,psf_lg): - result = self.ami_normalize(targ, psf) + result = self.ami_normalize.run(targ, psf) # Save the result result.meta.asn.pool_name = asn['asn_pool'] result.meta.asn.table_name = op.basename(asn.filename) diff --git a/jwst/pipeline/calwebb_coron3.py b/jwst/pipeline/calwebb_coron3.py index 26310a5e7a..54b2b093ec 100644 --- a/jwst/pipeline/calwebb_coron3.py +++ b/jwst/pipeline/calwebb_coron3.py @@ -151,7 +151,7 @@ def process(self, user_input): # Perform outlier detection on the PSFs. if not skip_outlier_detection: for model in psf_models: - self.outlier_detection(model) + self.outlier_detection.run(model) # step may have been skipped for this model; # turn back on for next model self.outlier_detection.skip = False @@ -159,7 +159,7 @@ def process(self, user_input): self.log.info('Outlier detection skipped for PSF\'s') # Stack all the PSF images into a single CubeModel - psf_stack = self.stack_refs(psf_models) + psf_stack = self.stack_refs.run(psf_models) psf_models.close() # Save the resulting PSF stack @@ -175,13 +175,13 @@ def process(self, user_input): # Remove outliers from the target if not skip_outlier_detection: - target = self.outlier_detection(target) + target = self.outlier_detection.run(target) # step may have been skipped for this model; # turn back on for next model self.outlier_detection.skip = False # Call align_refs - psf_aligned = self.align_refs(target, psf_stack) + psf_aligned = self.align_refs.run(target, psf_stack) # Save the alignment results self.save_model( @@ -190,7 +190,7 @@ def process(self, user_input): ) # Call KLIP - psf_sub = self.klip(target, psf_aligned) + psf_sub = self.klip.run(target, psf_aligned) psf_aligned.close() # Save the psf subtraction results @@ -210,7 +210,7 @@ def process(self, user_input): resample_library = ModelLibrary(resample_input, on_disk=False) # Output is a single datamodel - result = self.resample(resample_library) + result = self.resample.run(resample_library) # Blend the science headers try: diff --git a/jwst/pipeline/calwebb_dark.py b/jwst/pipeline/calwebb_dark.py index 9673ffd882..68bc7d0c90 100644 --- a/jwst/pipeline/calwebb_dark.py +++ b/jwst/pipeline/calwebb_dark.py @@ -67,29 +67,29 @@ def process(self, input): # the steps are in a different order than NIR log.debug('Processing a MIRI exposure') - input = self.group_scale(input) - input = self.dq_init(input) - input = self.emicorr(input) - input = self.saturation(input) - input = self.ipc(input) - input = self.firstframe(input) - input = self.lastframe(input) - input = self.reset(input) - input = self.linearity(input) - input = self.rscd(input) + input = self.group_scale.run(input) + input = self.dq_init.run(input) + input = self.emicorr.run(input) + input = self.saturation.run(input) + input = self.ipc.run(input) + input = self.firstframe.run(input) + input = self.lastframe.run(input) + input = self.reset.run(input) + input = self.linearity.run(input) + input = self.rscd.run(input) else: # process Near-IR exposures log.debug('Processing a Near-IR exposure') - input = self.group_scale(input) - input = self.dq_init(input) - input = self.saturation(input) - input = self.ipc(input) - input = self.superbias(input) - input = self.refpix(input) - input = self.linearity(input) + input = self.group_scale.run(input) + input = self.dq_init.run(input) + input = self.saturation.run(input) + input = self.ipc.run(input) + input = self.superbias.run(input) + input = self.refpix.run(input) + input = self.linearity.run(input) log.info('... ending calwebb_dark') diff --git a/jwst/pipeline/calwebb_detector1.py b/jwst/pipeline/calwebb_detector1.py index afc3bc5ab3..44d80450d5 100644 --- a/jwst/pipeline/calwebb_detector1.py +++ b/jwst/pipeline/calwebb_detector1.py @@ -89,18 +89,18 @@ def process(self, input): # the steps are in a different order than NIR log.debug('Processing a MIRI exposure') - input = self.group_scale(input) - input = self.dq_init(input) - input = self.emicorr(input) - input = self.saturation(input) - input = self.ipc(input) - input = self.firstframe(input) - input = self.lastframe(input) - input = self.reset(input) - input = self.linearity(input) - input = self.rscd(input) - input = self.dark_current(input) - input = self.refpix(input) + input = self.group_scale.run(input) + input = self.dq_init.run(input) + input = self.emicorr.run(input) + input = self.saturation.run(input) + input = self.ipc.run(input) + input = self.firstframe.run(input) + input = self.lastframe.run(input) + input = self.reset.run(input) + input = self.linearity.run(input) + input = self.rscd.run(input) + input = self.dark_current.run(input) + input = self.refpix.run(input) # skip until MIRI team has figured out an algorithm # input = self.persistence(input) @@ -110,28 +110,28 @@ def process(self, input): # process Near-IR exposures log.debug('Processing a Near-IR exposure') - input = self.group_scale(input) - input = self.dq_init(input) - input = self.saturation(input) - input = self.ipc(input) - input = self.superbias(input) - input = self.refpix(input) - input = self.linearity(input) + input = self.group_scale.run(input) + input = self.dq_init.run(input) + input = self.saturation.run(input) + input = self.ipc.run(input) + input = self.superbias.run(input) + input = self.refpix.run(input) + input = self.linearity.run(input) # skip persistence for NIRSpec if instrument != 'NIRSPEC': - input = self.persistence(input) + input = self.persistence.run(input) - input = self.dark_current(input) + input = self.dark_current.run(input) # apply the charge_migration step - input = self.charge_migration(input) + input = self.charge_migration.run(input) # apply the jump step - input = self.jump(input) + input = self.jump.run(input) # apply the clean_flicker_noise step - input = self.clean_flicker_noise(input) + input = self.clean_flicker_noise.run(input) # save the corrected ramp data, if requested if self.save_calibrated_ramp: @@ -143,15 +143,15 @@ def process(self, input): # objects, but when the step is skipped due to `skip = True`, # only the input is returned when the step is invoked. if self.ramp_fit.skip: - input = self.ramp_fit(input) + input = self.ramp_fit.run(input) ints_model = None else: - input, ints_model = self.ramp_fit(input) + input, ints_model = self.ramp_fit.run(input) # apply the gain_scale step to the exposure-level product if input is not None: self.gain_scale.suffix = 'gain_scale' - input = self.gain_scale(input) + input = self.gain_scale.run(input) else: log.info("NoneType returned from ramp_fit. Gain Scale step skipped.") @@ -159,7 +159,7 @@ def process(self, input): # if it exists, and then save it if ints_model is not None: self.gain_scale.suffix = 'gain_scaleints' - ints_model = self.gain_scale(ints_model) + ints_model = self.gain_scale.run(ints_model) self.save_model(ints_model, 'rateints') # setup output_file for saving @@ -176,4 +176,4 @@ def setup_output(self, input): if input.meta.cal_step.ramp_fit == 'COMPLETE': self.suffix = 'rate' else: - self.suffix = 'ramp' \ No newline at end of file + self.suffix = 'ramp' diff --git a/jwst/pipeline/calwebb_guider.py b/jwst/pipeline/calwebb_guider.py index 87bfc864b0..0f519b5954 100644 --- a/jwst/pipeline/calwebb_guider.py +++ b/jwst/pipeline/calwebb_guider.py @@ -52,9 +52,9 @@ def process(self, input): input = datamodels.GuiderRawModel(input) # Apply the steps - input = self.dq_init(input) - input = self.guider_cds(input) - input = self.flat_field(input) + input = self.dq_init.run(input) + input = self.guider_cds.run(input) + input = self.flat_field.run(input) log.info('... ending calwebb_guider') diff --git a/jwst/pipeline/calwebb_image2.py b/jwst/pipeline/calwebb_image2.py index 64aab36d80..82c18ea149 100644 --- a/jwst/pipeline/calwebb_image2.py +++ b/jwst/pipeline/calwebb_image2.py @@ -150,12 +150,12 @@ def process_exposure_product( self.bkg_subtract.save_results = True # Call the background subtraction step - input = self.bkg_subtract(input, members_by_type['background']) + input = self.bkg_subtract.run(input, members_by_type['background']) # work on slope images - input = self.assign_wcs(input) - input = self.flat_field(input) - input = self.photom(input) + input = self.assign_wcs.run(input) + input = self.flat_field.run(input) + input = self.photom.run(input) # Resample individual exposures, but only if it's one of the # regular 2D science image types @@ -163,7 +163,7 @@ def process_exposure_product( len(input.data.shape) == 2: self.resample.save_results = self.save_results self.resample.suffix = 'i2d' - self.resample(input) + self.resample.run(input) # That's all folks self.log.info( diff --git a/jwst/pipeline/calwebb_image3.py b/jwst/pipeline/calwebb_image3.py index 757622a627..36d1a85680 100644 --- a/jwst/pipeline/calwebb_image3.py +++ b/jwst/pipeline/calwebb_image3.py @@ -84,24 +84,24 @@ def process(self, input_data): is_moving = is_moving_target(model) input_models.shelve(model, 0, modify=False) if is_moving: - input_models = self.assign_mtwcs(input_models) + input_models = self.assign_mtwcs.run(input_models) else: - input_models = self.tweakreg(input_models) + input_models = self.tweakreg.run(input_models) - input_models = self.skymatch(input_models) - input_models = self.outlier_detection(input_models) + input_models = self.skymatch.run(input_models) + input_models = self.outlier_detection.run(input_models) elif self.skymatch.skymethod == 'match': self.log.warning("Turning 'skymatch' step off for a single " "input image when 'skymethod' is 'match'") else: - input_models = self.skymatch(input_models) + input_models = self.skymatch.run(input_models) - result = self.resample(input_models) + result = self.resample.run(input_models) del input_models if isinstance(result, datamodels.ImageModel) and result.meta.cal_step.resample == 'COMPLETE': - self.source_catalog(result) + self.source_catalog.run(result) def _load_input_as_library(self, input): @@ -128,4 +128,4 @@ def _load_input_as_library(self, input): elif isinstance(input, datamodels.JwstDataModel): return ModelLibrary([input], asn_exptypes=['science'], on_disk=not self.in_memory) else: - raise TypeError(f"Input type {type(input)} not supported.") \ No newline at end of file + raise TypeError(f"Input type {type(input)} not supported.") diff --git a/jwst/pipeline/calwebb_spec2.py b/jwst/pipeline/calwebb_spec2.py index 36e2993113..1502338cbd 100644 --- a/jwst/pipeline/calwebb_spec2.py +++ b/jwst/pipeline/calwebb_spec2.py @@ -225,7 +225,7 @@ def process_exposure_product( # `assign_wcs` is the critical step. Without it, processing cannot proceed. assign_wcs_exception = None try: - calibrated = self.assign_wcs(science) + calibrated = self.assign_wcs.run(science) except Exception as exception: assign_wcs_exception = exception if assign_wcs_exception is not None or \ @@ -252,7 +252,7 @@ def process_exposure_product( # Self-calibrate to flag bad/warm pixels, and apply flags # to both background and science exposures. # skipped by default for all modes - result = self.badpix_selfcal( + result = self.badpix_selfcal.run( calibrated, members_by_type['selfcal'], members_by_type['background'], ) if isinstance(result, datamodels.JwstDataModel): @@ -264,10 +264,10 @@ def process_exposure_product( members_by_type['background'] = bkg_outlier_flagged # apply msa_flagging (flag stuck open shutters for NIRSpec IFU and MOS) - calibrated = self.msa_flagging(calibrated) + calibrated = self.msa_flagging.run(calibrated) # apply the "nsclean" 1/f correction to NIRSpec images - calibrated = self.nsclean(calibrated) + calibrated = self.nsclean.run(calibrated) # Apply nsclean to NIRSpec imprint and background members if not self.nsclean.skip: @@ -279,7 +279,7 @@ def process_exposure_product( self.nsclean.output_file = imprint_file.meta.filename else: self.nsclean.output_file = os.path.basename(imprint_file) - imprint_nsclean = self.nsclean(imprint_file) + imprint_nsclean = self.nsclean.run(imprint_file) members_by_type['imprint'][i] = imprint_nsclean for i, bkg_file in enumerate(members_by_type['background']): @@ -288,21 +288,21 @@ def process_exposure_product( self.nsclean.output_file = bkg_file.meta.filename else: self.nsclean.output_file = os.path.basename(bkg_file) - bkg_nsclean = self.nsclean(bkg_file) + bkg_nsclean = self.nsclean.run(bkg_file) members_by_type['background'][i] = bkg_nsclean # Leakcal subtraction (imprint) occurs before background subtraction on a per-exposure basis. # If there is only one `imprint` member, this imprint exposure is subtracted from all the # science and background exposures. Otherwise, there will be as many `imprint` members as # there are science plus background members. - calibrated = self.imprint_subtract(calibrated, members_by_type['imprint']) + calibrated = self.imprint_subtract.run(calibrated, members_by_type['imprint']) # for each background image subtract an associated leak cal for i, bkg_file in enumerate(members_by_type['background']): - bkg_imprint_sub = self.imprint_subtract(bkg_file, members_by_type['imprint']) + bkg_imprint_sub = self.imprint_subtract.run(bkg_file, members_by_type['imprint']) members_by_type['background'][i] = bkg_imprint_sub - calibrated = self.bkg_subtract(calibrated, members_by_type['background']) + calibrated = self.bkg_subtract.run(calibrated, members_by_type['background']) # The order of the next few steps is tricky, depending on mode: # WFSS/Grism data need flat_field before extract_2d, but other modes @@ -334,8 +334,8 @@ def process_exposure_product( resampled = calibrated.copy() # interpolate pixels that have a NaN value or are flagged # as DO_NOT_USE or NON_SCIENCE. - resampled = self.pixel_replace(resampled) - resampled = self.resample_spec(resampled) + resampled = self.pixel_replace.run(resampled) + resampled = self.resample_spec.run(resampled) elif is_nrs_slit_linelamp(calibrated): @@ -343,8 +343,8 @@ def process_exposure_product( resampled = calibrated.copy() # interpolate pixels that have a NaN value or are flagged # as DO_NOT_USE or NON_SCIENCE. - resampled = self.pixel_replace(resampled) - resampled = self.resample_spec(resampled) + resampled = self.pixel_replace.run(resampled) + resampled = self.resample_spec.run(resampled) elif (exp_type in ['MIR_MRS', 'NRS_IFU']) or is_nrs_ifu_linelamp(calibrated): @@ -355,21 +355,21 @@ def process_exposure_product( resampled = calibrated.copy() # interpolate pixels that have a NaN value or are flagged # as DO_NOT_USE or NON_SCIENCE. - resampled = self.pixel_replace(resampled) - resampled = self.cube_build(resampled) + resampled = self.pixel_replace.run(resampled) + resampled = self.cube_build.run(resampled) if query_step_status(resampled, "cube_build") == 'COMPLETE': self.save_model(resampled[0], suffix='s3d') elif exp_type in ['MIR_LRS-SLITLESS']: resampled = calibrated.copy() # interpolate pixels that have a NaN value or are flagged # as DO_NOT_USE or NON_SCIENCE. - resampled = self.pixel_replace(resampled) + resampled = self.pixel_replace.run(resampled) else: # will be run if set in parameter ref file or by user resampled = calibrated.copy() # interpolate pixels that have a NaN value or are flagged # as DO_NOT_USE or NON_SCIENCE. - resampled = self.pixel_replace(resampled) + resampled = self.pixel_replace.run(resampled) # Extract a 1D spectrum from the 2D/3D data if exp_type in ['MIR_MRS', 'NRS_IFU'] and query_step_status(resampled, "cube_build") == 'SKIPPED': # Skip extract_1d for IFU modes where no cube was built @@ -384,7 +384,7 @@ def process_exposure_product( self.photom.suffix = 'x1d' self.extract_1d.save_results = False x1d = resampled.copy() - x1d = self.extract_1d(x1d) + x1d = self.extract_1d.run(x1d) # Possible that no fit was possible - if so, skip photom if (x1d is None) or (x1d.meta.cal_step.extract_1d == "SKIPPED"): @@ -401,7 +401,7 @@ def process_exposure_product( x1d = resampled.copy() else: x1d = resampled.copy() - x1d = self.extract_1d(x1d) + x1d = self.extract_1d.run(x1d) resampled.close() if x1d is not None: @@ -510,7 +510,7 @@ def _process_grism(self, data): """ # Apply flat-field correction - calibrated = self.flat_field(data) + calibrated = self.flat_field.run(data) # Create and save a WFSS e-/sec image, if requested if self.save_wfss_esec: @@ -547,14 +547,14 @@ def _process_grism(self, data): # Continue with remaining calibration steps, using the original # DN/sec image - calibrated = self.extract_2d(calibrated) - calibrated = self.srctype(calibrated) - calibrated = self.straylight(calibrated) - calibrated = self.fringe(calibrated) - calibrated = self.pathloss(calibrated) - calibrated = self.barshadow(calibrated) - calibrated = self.wfss_contam(calibrated) - calibrated = self.photom(calibrated) + calibrated = self.extract_2d.run(calibrated) + calibrated = self.srctype.run(calibrated) + calibrated = self.straylight.run(calibrated) + calibrated = self.fringe.run(calibrated) + calibrated = self.pathloss.run(calibrated) + calibrated = self.barshadow.run(calibrated) + calibrated = self.wfss_contam.run(calibrated) + calibrated = self.photom.run(calibrated) return calibrated def _process_nirspec_slits(self, data): @@ -568,14 +568,14 @@ def _process_nirspec_slits(self, data): Note that NIRSpec MOS and FS need srctype and wavecorr before flat_field. """ - calibrated = self.extract_2d(data) - calibrated = self.srctype(calibrated) - calibrated = self.master_background_mos(calibrated) - calibrated = self.wavecorr(calibrated) - calibrated = self.flat_field(calibrated) - calibrated = self.pathloss(calibrated) - calibrated = self.barshadow(calibrated) - calibrated = self.photom(calibrated) + calibrated = self.extract_2d.run(data) + calibrated = self.srctype.run(calibrated) + calibrated = self.master_background_mos.run(calibrated) + calibrated = self.wavecorr.run(calibrated) + calibrated = self.flat_field.run(calibrated) + calibrated = self.pathloss.run(calibrated) + calibrated = self.barshadow.run(calibrated) + calibrated = self.photom.run(calibrated) return calibrated @@ -592,8 +592,8 @@ def _process_nirspec_msa_slits(self, data): Note that NIRSpec MOS and FS need srctype and wavecorr before flat_field. Also have to deal with master background operations. """ - calibrated = self.extract_2d(data) - calibrated = self.srctype(calibrated) + calibrated = self.extract_2d.run(data) + calibrated = self.srctype.run(calibrated) # Split the datamodel into 2 pieces: one with MOS slits and # the other with FS slits @@ -609,12 +609,12 @@ def _process_nirspec_msa_slits(self, data): # First process MOS slits through all remaining steps calib_mos.update(calibrated) if len(calib_mos.slits) > 0: - calib_mos = self.master_background_mos(calib_mos) - calib_mos = self.wavecorr(calib_mos) - calib_mos = self.flat_field(calib_mos) - calib_mos = self.pathloss(calib_mos) - calib_mos = self.barshadow(calib_mos) - calib_mos = self.photom(calib_mos) + calib_mos = self.master_background_mos.run(calib_mos) + calib_mos = self.wavecorr.run(calib_mos) + calib_mos = self.flat_field.run(calib_mos) + calib_mos = self.pathloss.run(calib_mos) + calib_mos = self.barshadow.run(calib_mos) + calib_mos = self.photom.run(calib_mos) # Now repeat for FS slits if len(calib_fss.slits) > 0: @@ -631,7 +631,7 @@ def _process_nirspec_msa_slits(self, data): step.suffix = f'{current_suffix}_fs' # Run step - calib_fss = step(calib_fss) + calib_fss = step.run(calib_fss) # Reset suffix step.suffix = current_suffix @@ -655,25 +655,25 @@ def _process_niriss_soss(self, data): New SOSS extraction requires input to extract_1d step in units of DN/s, with photom step to be run afterwards. """ - calibrated = self.srctype(data) - calibrated = self.flat_field(calibrated) - calibrated = self.straylight(calibrated) - calibrated = self.fringe(calibrated) - calibrated = self.pathloss(calibrated) - calibrated = self.barshadow(calibrated) + calibrated = self.srctype.run(data) + calibrated = self.flat_field.run(calibrated) + calibrated = self.straylight.run(calibrated) + calibrated = self.fringe.run(calibrated) + calibrated = self.pathloss.run(calibrated) + calibrated = self.barshadow.run(calibrated) return calibrated def _process_common(self, data): """Common spectral processing""" - calibrated = self.srctype(data) - calibrated = self.straylight(calibrated) - calibrated = self.flat_field(calibrated) - calibrated = self.fringe(calibrated) - calibrated = self.pathloss(calibrated) - calibrated = self.barshadow(calibrated) - calibrated = self.photom(calibrated) - calibrated = self.residual_fringe(calibrated) # only run on MIRI_MRS data + calibrated = self.srctype.run(data) + calibrated = self.straylight.run(calibrated) + calibrated = self.flat_field.run(calibrated) + calibrated = self.fringe.run(calibrated) + calibrated = self.pathloss.run(calibrated) + calibrated = self.barshadow.run(calibrated) + calibrated = self.photom.run(calibrated) + calibrated = self.residual_fringe.run(calibrated) # only run on MIRI_MRS data return calibrated @@ -707,13 +707,13 @@ def _extract_nirspec_msa_slits(self, resampled): self.extract_1d.save_results = False if len(resamp_mos.slits) > 0: self.log.info(f'Extracting {len(resamp_mos.slits)} MSA slitlets') - x1d = self.extract_1d(resamp_mos) + x1d = self.extract_1d.run(resamp_mos) # Extract the FS slits if len(resamp_fss.slits) > 0: self.log.info(f'Extracting {len(resamp_fss.slits)} fixed slits') resamp_fss.meta.exposure.type = "NRS_FIXEDSLIT" - x1d_fss = self.extract_1d(resamp_fss) + x1d_fss = self.extract_1d.run(resamp_fss) if x1d is None: x1d = x1d_fss x1d.meta.exposure.type = "NRS_MSASPEC" diff --git a/jwst/pipeline/calwebb_spec3.py b/jwst/pipeline/calwebb_spec3.py index d62bcc926f..707a67f5c0 100644 --- a/jwst/pipeline/calwebb_spec3.py +++ b/jwst/pipeline/calwebb_spec3.py @@ -140,11 +140,11 @@ def process(self, input): if is_moving_target(input_models[0]): self.log.info("Assigning WCS to a Moving Target exposure.") # assign_mtwcs modifies input_models in-place - self.assign_mtwcs(input_models) + self.assign_mtwcs.run(input_models) # If background data are present, call the master background step if members_by_type['background']: - source_models = self.master_background(input_models) + source_models = self.master_background.run(input_models) source_models.asn_table = input_models.asn_table # If the step is skipped, do the container splitting that @@ -218,7 +218,7 @@ def process(self, input): # Call the skymatch step for MIRI MRS data if exptype in ['MIR_MRS']: - result = self.mrs_imatch(result) + result = self.mrs_imatch.run(result) # Call outlier detection and pixel replacement if exptype not in SLITLESS_TYPES: @@ -231,21 +231,21 @@ def process(self, input): self.outlier_detection.mode = 'ifu' else: self.outlier_detection.mode = 'spec' - result = self.outlier_detection(result) + result = self.outlier_detection.run(result) # interpolate pixels that have a NaN value or are flagged # as DO_NOT_USE or NON_SCIENCE. - result = self.pixel_replace(result) + result = self.pixel_replace.run(result) # Resample time. Dependent on whether the data is IFU or not. resample_complete = None if exptype in IFU_EXPTYPES: - result = self.cube_build(result) + result = self.cube_build.run(result) try: resample_complete = result[0].meta.cal_step.cube_build except AttributeError: pass else: - result = self.resample_spec(result) + result = self.resample_spec.run(result) try: resample_complete = result.meta.cal_step.resample except AttributeError: @@ -256,7 +256,7 @@ def process(self, input): # interpolate pixels that have a NaN value or are flagged # as DO_NOT_USE or NON_SCIENCE - result = self.pixel_replace(result) + result = self.pixel_replace.run(result) # For slitless data, extract 1D spectra and then combine them if exptype in ['NIS_SOSS']: @@ -265,17 +265,17 @@ def process(self, input): # those instead. self.extract_1d.save_results = False - result = self.extract_1d(result) + result = self.extract_1d.run(result) # SOSS F277W may return None - don't bother with that. if result is not None: self.photom.save_results = self.save_results self.photom.suffix = 'x1d' - result = self.photom(result) + result = self.photom.run(result) else: - result = self.extract_1d(result) + result = self.extract_1d.run(result) - result = self.combine_1d(result) + result = self.combine_1d.run(result) elif resample_complete is not None and resample_complete.upper() == 'COMPLETE': @@ -290,10 +290,10 @@ def process(self, input): self.spectral_leak.search_output_file = False self.spectral_leak.save_results = self.save_results - result = self.extract_1d(result) + result = self.extract_1d.run(result) if exptype in ['MIR_MRS']: - result = self.spectral_leak(result) + result = self.spectral_leak.run(result) else: self.log.warning( 'Resampling was not completed. Skipping extract_1d.' diff --git a/jwst/pipeline/calwebb_tso3.py b/jwst/pipeline/calwebb_tso3.py index f5d974f48b..58c87d753b 100644 --- a/jwst/pipeline/calwebb_tso3.py +++ b/jwst/pipeline/calwebb_tso3.py @@ -91,7 +91,7 @@ def process(self, input): break self.log.info("Performing outlier detection on input images ...") - cube = self.outlier_detection(cube) + cube = self.outlier_detection.run(cube) # Save crfints products if cube.meta.cal_step.outlier_detection == 'COMPLETE': @@ -124,7 +124,7 @@ def process(self, input): for cube in input_models: # Extract Photometry from imaging data - phot_result_list.append(self.tso_photometry(cube)) + phot_result_list.append(self.tso_photometry.run(cube)) # Spectroscopy else: @@ -147,12 +147,12 @@ def process(self, input): for cube in input_models: # interpolate pixels that have a NaN value or are flagged # as DO_NOT_USE or NON_SCIENCE. - cube = self.pixel_replace(cube) + cube = self.pixel_replace.run(cube) state = cube.meta.cal_step.pixel_replace # Process spectroscopic TSO data # extract 1D self.log.info("Extracting 1-D spectra ...") - result = self.extract_1d(cube) + result = self.extract_1d.run(cube) for row in cube.int_times: # Subtract one to assign 1-indexed int_nums to int_times array locations x1d_result.int_times[row[0] - 1] = row @@ -164,13 +164,13 @@ def process(self, input): if input_exptype == 'NIS_SOSS': # SOSS data have yet to be photometrically calibrated # Calibrate 1D spectra here. - result = self.photom(result) + result = self.photom.run(result) x1d_result.spec.extend(result.spec) # perform white-light photometry on 1d extracted data self.log.info("Performing white-light photometry ...") - phot_result_list.append(self.white_light(result)) + phot_result_list.append(self.white_light.run(result)) # Update some metadata from the association x1d_result.meta.asn.pool_name = input_models.asn_table["asn_pool"]