CubeBuildStep

class jwst.cube_build.cube_build_step.CubeBuildStep(name=None, parent=None, config_file=None, _validate_kwds=True, **kws)[source]

Bases: JwstStep

Create a 3-D spectral cube from IFU data.

This is the controlling routine for building IFU Spectral Cubes. It loads and sets the various input data and parameters needed by the cube_build_step.

This routine does the following operations:

1. Extracts the input parameters from the cubepars reference file and merges them with any user-provided values. 2. Creates the output WCS from the input images and defines the mapping between all the input arrays and the output array. 3. Passes the input data to the function to map all their input data to the output array. 4. Updates the output data model with correct meta data.

Create a Step instance.

Parameters:
  • name (str, optional) – The name of the Step instance. Used in logging messages and in cache filenames. If not provided, one will be generated based on the class name.

  • parent (Step instance, optional) – The parent step of this step. Used to determine a fully-qualified name for this step, and to determine the mode in which to run this step.

  • config_file (str or pathlib.Path, optional) – The path to the config file that this step was initialized with. Use to determine relative path names of other config files.

  • **kws (dict) – Additional parameters to set. These will be set as member variables on the new Step instance.

Attributes Summary

class_alias

reference_file_types

spec

Methods Summary

check_offset_file()

Read in an optional ra and dec offset for each file.

process(input_data)

Build an IFUCube from overlapping IFUImage data.

read_user_input()

Read user input options for channel, subchannel, filter, or grating.

Attributes Documentation

class_alias = 'cube_build'
reference_file_types: ClassVar = ['cubepar']
spec
channel = option('1','2','3','4','all',default='all') # Channel
band = option('short','medium','long','short-medium','short-long','medium-short',                 'medium-long', 'long-short', 'long-medium','all',default='all') # Band
grating   = option('prism','g140m','g140h','g235m','g235h','g395m','g395h','all',default='all') # Grating
filter   = option('clear','f100lp','f070lp','f170lp','f290lp','all',default='all') # Filter
output_type = option('band','channel','grating','multi',default=None) # Type IFUcube to create.
scalexy = float(default=0.0) # cube sample size to use for axis 1 and axis2, arc seconds
scalew = float(default=0.0) # cube sample size to use for axis 3, microns
weighting = option('emsm','msm','drizzle',default = 'drizzle') # Type of weighting function
coord_system = option('skyalign','world','internal_cal','ifualign',default='skyalign') # Output Coordinate system.
ra_center = float(default=None) # RA center of the IFU cube
dec_center = float(default=None) # Declination center of the IFU cube
cube_pa = float(default=None) # The position angle of the desired cube in decimal degrees E from N
nspax_x = integer(default=None) # The odd integer number of spaxels to use in the x dimension of cube tangent plane.
nspax_y = integer(default=None) # The odd integer number of spaxels to use in the y dimension of cube tangent plane.
rois = float(default=0.0) # region of interest spatial size, arc seconds
roiw = float(default=0.0) # region of interest wavelength size, microns
weight_power = float(default=2.0) # Weighting option to use for Modified Shepard Method
wavemin = float(default=None)  # Minimum wavelength to be used in the IFUCube
wavemax = float(default=None)  # Maximum wavelength to be used in the IFUCube
single = boolean(default=false) # Internal pipeline option used by mrs_imatch & outlier detection
skip_dqflagging = boolean(default=false) # skip setting the DQ plane of the IFU
search_output_file = boolean(default=false)
output_use_model = boolean(default=true) # Use filenames in the output models
suffix = string(default='s3d')
offset_file = string(default=None) # Filename containing a list of Ra and Dec offsets to apply to files.
debug_spaxel = string(default='-1 -1 -1') # Default not used

Methods Documentation

check_offset_file()[source]

Read in an optional ra and dec offset for each file.

Check that the offset file is an asdf file. Check that the file has the correct format using an local schema file. For each file in the input association check that there is a corresponding file in the offset file.

Returns:

offsets – Dictionary containing offset information.

Return type:

dict

process(input_data)[source]

Build an IFUCube from overlapping IFUImage data.

Parameters:

input_data (list of DataModel or str) – List of datamodels or string of input fits filenames or association name.

Returns:

cube_container – Container (list) of IFUCube models

Return type:

ModelContainer

read_user_input()[source]

Read user input options for channel, subchannel, filter, or grating.

Determine if any of the input parameters channel, band, filter or grating have been set by the user. This routine updates the dictionary self.pars_input with any user provided inputs. In particular it sets pars_input[‘channel’], pars_input[‘sub_channel’], pars_input[‘grating’], and pars_input[‘filter’] with user provided values.