StaticArraySpectrum#
- class scarlet2.StaticArraySpectrum(data, bands, band_selector=<function StaticArraySpectrum.<lambda>>)[source]#
Bases:
SpectrumStatic (non-variable) source in a transient scene
In the frames of transient scenes, the attribute
channelsare overloaded and defined with a spectral and a temporal component, e.g. channel = (band, epoch). This class is for models that do not vary in time, i.e. only have a spectral dependency. The length ofdatais thus given by the number of distinct spectral bands.- Parameters:
data (
array) – Spectrum without temporal variation. Contains as many elements as there are spectral channels in the model.bands (
list,array) – Identifier for the list of unique bands in the model frame channelsband_selector (
callable, optional) – Identify the spectral “band” component from the name/ID used in the channels of the model frame
Examples
>>> # model channels: [('G',0),('G',1),('R',0),('R',1),('R',2)] >>> spectrum = jnp.ones(2) >>> bands = ['G','R'] >>> band_selector = lambda channel: channel[0] >>> StaticArraySpectrum(spectrum, bands, band_selector=band_selector)
This constructs a 2-element spectrum to describe the spectral properties in all epochs 0,1,2.
See also
- bands: list#
Identifier for the list of unique bands in the model frame channels
- 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
- 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:
- property shape#
The shape of the spectrum data