scarlet.renderer

class scarlet.renderer.ConvolutionRenderer(data_frame, model_frame, *parameters, convolution_type='fft', padding=10, psf_shift=None)[source]

Bases: scarlet.renderer.Renderer

Attributes
children

List of child models

convolution_bounds

Build the slices needed for convolution in real space

parameters

List of parameters, including from the children

Methods

__call__(model, *parameters)

Call self as a function.

check_parameters()

Check that all parameters have finite elements

convolve(model[, convolution_type, psf_shift])

Convolve the model in a single band

get_channel_map(data_frame, model_frame)

Compute the mapping between channels in the model frame and this observation

get_model(*parameters)

Get the model realization

get_models_of_children(*parameters, **kwargs)

Get realization of all child models

get_parameter(i, *parameters)

Access parameters by list index or by name

map_channels(model)

Map to model channels onto the observation channels

update()

Update internal state or configuration of the model

property convolution_bounds

Build the slices needed for convolution in real space

convolve(model, convolution_type=None, psf_shift=None)[source]

Convolve the model in a single band

get_model(*parameters)[source]

Get the model realization

Parameters
parameters: tuple of optimimzation parameters
Returns
model: array

Realization of the model

class scarlet.renderer.NullRenderer(data_frame, model_frame)[source]

Bases: scarlet.renderer.Renderer

Attributes
children

List of child models

parameters

List of parameters, including from the children

Methods

__call__(model, *parameters)

Call self as a function.

check_parameters()

Check that all parameters have finite elements

get_channel_map(data_frame, model_frame)

Compute the mapping between channels in the model frame and this observation

get_model()

Get the model realization

get_models_of_children(*parameters, **kwargs)

Get realization of all child models

get_parameter(i, *parameters)

Access parameters by list index or by name

map_channels(model)

Map to model channels onto the observation channels

update()

Update internal state or configuration of the model

get_model()[source]

Get the model realization

Parameters
parameters: tuple of optimimzation parameters
Returns
model: array

Realization of the model

class scarlet.renderer.Renderer(data_frame, model_frame, *parameters)[source]

Bases: scarlet.model.Model

Attributes
children

List of child models

parameters

List of parameters, including from the children

Methods

__call__(model, *parameters)

Call self as a function.

check_parameters()

Check that all parameters have finite elements

get_channel_map(data_frame, model_frame)

Compute the mapping between channels in the model frame and this observation

get_model(*parameters, **kwargs)

Get the model realization

get_models_of_children(*parameters, **kwargs)

Get realization of all child models

get_parameter(i, *parameters)

Access parameters by list index or by name

map_channels(model)

Map to model channels onto the observation channels

update()

Update internal state or configuration of the model

get_channel_map(data_frame, model_frame)[source]

Compute the mapping between channels in the model frame and this observation

Parameters
model_frame: a `scarlet.Frame` instance

The frame to match

Returns
channel_map: None, slice, or array

None for identical channels in both frames; slice for concatenated channels; array for linear mapping of model channels onto observation channels

map_channels(model)[source]

Map to model channels onto the observation channels

Parameters
model: array

The hyperspectral model

Returns
obs_model: array

model mapped onto the observation channels

class scarlet.renderer.ResolutionRenderer(data_frame, model_frame, padding=10)[source]

Bases: scarlet.renderer.Renderer

Attributes
children

List of child models

parameters

List of parameters, including from the children

Methods

__call__(model, *parameters)

Call self as a function.

build_diffkernel(data_frame, model_frame)

Builds the differential convolution kernel between the observation and the model psf

check_parameters()

Check that all parameters have finite elements

get_channel_map(data_frame, model_frame)

Compute the mapping between channels in the model frame and this observation

get_model(*parameters)

Get the model realization

get_models_of_children(*parameters, **kwargs)

Get realization of all child models

get_parameter(i, *parameters)

Access parameters by list index or by name

map_channels(model)

Map to model channels onto the observation channels

sinc_shift(imgs, shifts, axes)

Performs 2 1D sinc convolutions and shifting along one rotated axis in Fourier space.

update()

Update internal state or configuration of the model

build_diffkernel(data_frame, model_frame)[source]

Builds the differential convolution kernel between the observation and the model psf

Parameters
model_frame: Frame object

the frame of the model

Returns
——-
diff_psf: array

the differential psf between observation and frame psf.

get_model(*parameters)[source]

Get the model realization

Parameters
parameters: tuple of optimimzation parameters
Returns
model: array

Realization of the model

sinc_shift(imgs, shifts, axes)[source]

Performs 2 1D sinc convolutions and shifting along one rotated axis in Fourier space.

Parameters
imgs: Fourier

a Fourier object of 2D data to sinc convolve and shift to the adequate shape.

shifts: array

an array of the shift values for each line and columns of data in imgs

axes: array

Optional argument that specifies the axes along which to apply sinc convolution.

Returns
result: array

the shifted and sinc convolved array in configuration space