ChannelRenderer#

class scarlet2.renderer.ChannelRenderer(model_frame, obs_frame)[source]#

Bases: Renderer

Map model to observed channels

This renderer only affects to spectral dimension of the model. It needs to be combined with spatial renderers for a full transformation to the observed frame.

Initialize channel mapping

This method will attempt to find the index in model_frame.channels for every item obs_frame.channels. For this to work, the identifiers of the channels need to be the same, e.g. channels=[‘g’,’r’,’i’] or channels=[0,1,2,3,4].

Parameters:
  • model_frame (Frame) – The model frame to be resampled

  • obs_frame (Frame) – The observation frame to which the model frame is resampled

Raises:

ValueError – If observed channel(s) are not found in model_frame

__call__(model, key=None)[source]#

Map model channels onto the observation channels

Parameters:
  • model (array) – The hyperspectral model

  • key (optional) – Key is needed to chain renderers with eqx.nn.Sequential

Returns:

obs_modelmodel mapped onto the observation channels

Return type:

array

channel_map: (None, <class 'list'>, <class 'scarlet2.renderer.HashableSlice'>, <function array at 0x738a404e03a0>) = None#

Lookup table or transformation matrix

For every channel in the observed frame, this map contained the index or weights of the model 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:

Module