Component#
- class scarlet2.Component(center, spectrum, morphology)[source]#
Bases:
ModuleSingle component of a hyperspectral model
The parameterization of the 3D model (channel, height, width) is defined by the outer product of spectrum and morphology. That means that there is no variation of the spectrum in spatial direction. The center coordinate is only needed to define the bounding box and place the component in the model frame.
- Parameters:
center (
array,astropy.coordinates.SkyCoord) – Center position. If given as astropy sky coordinate, it will be transformed with the WCS of the model frame.spectrum (
Spectrum) – The spectrum of the component.morphology (
Morphology) – The morphology of the component.
Examples
To uniquely determine coordinates, the creation of components is restricted to a context defined by a
Scene, which define theFrameof the model.>>> with Scene(model_frame) as scene: >>> component = Component(center, spectrum, morphology)
- center: Array#
Center position, in pixel coordinates of the model frame
- get(name=None)#
Get parameter(s) from this module
- Parameters:
name (
str, optional) – Name of parameter. If not set, returns all parameters.- Returns:
requested data arrays for parameters
- Return type:
dict
- morphology: (<function array at 0x738a404e03a0>, <class 'scarlet2.morphology.Morphology'>)#
Morphology model
- property parameters#
Parameters defined for this module
- Returns:
name: (node, param) mapping for all parameters
- Return type:
dict
- set(values)#
Set parameter(s) from this module with values
- Parameters:
values (
dict[str,jnp.array]) – values to replace parameters with, identified by their name- Returns:
new module with parameter(s) replaced by values
- Return type:
- spectrum: (<function array at 0x738a404e03a0>, <class 'scarlet2.spectrum.Spectrum'>)#
Spectrum model