MultiSpecModel¶
-
class
jwst.datamodels.
MultiSpecModel
(init=None, int_times=None, **kwargs)[source]¶ Bases:
jwst.datamodels.DataModel
A data model for multi-spec images.
This model has a special member
spec
that can be used to deal with an entire spectrum at a time. It behaves like a list:>>> multispec_model.spec.append(spec_model) >>> multispec_model.spec[0] <SpecModel>
If
init
is aSpecModel
instance, an emptySpecModel
will be created and assigned to attributespec[0]
, and thespec_table
attribute from the inputSpecModel
instance will be copied to the first element ofspec
.SpecModel
objects can be appended to thespec
attribute by using itsappend
method.Parameters: init (any) – Any of the initializers supported by DataModel
.Examples
>>> output_model = datamodels.MultiSpecModel() >>> spec = datamodels.SpecModel() # for the default data type >>> for slit in input_model.slits: >>> slitname = slit.name >>> slitmodel = ExtractModel() >>> slitmodel.fromJSONFile(extref, slitname) >>> column, wavelength, countrate = slitmodel.extract(slit.data) >>> otab = np.array(zip(column, wavelength, countrate), >>> dtype=spec.spec_table.dtype) >>> spec = datamodels.SpecModel(spec_table=otab) >>> output_model.spec.append(spec)
Attributes Summary
schema_url
Attributes Documentation
-
schema_url
= 'multispec.schema.yaml'¶
-