scarlet.frame

class scarlet.frame.Frame(shape, channels, wcs=None, psf=None, dtype=<class 'numpy.float32'>)[source]

Bases: object

Spatial and spectral characteristics of the data

Attributes:
shape: tuple

shape tuple (Channel, Height, Width)

wcs: TBD

World Coordinates

psf: `scarlet.PSF` or its arguments

PSF in each channel

channels: list of hashable elements

Names/identifiers of spectral channels

dtype: `numpy.dtype`

Dtype to represent the data.

Methods

convert_pixel_to(target[, pixel])

Converts pixel coordinates from this frame to target Frame

from_observations(observations[, model_psf, ...])

Generates a suitable model frame for a set of observations.

get_pixel(sky_coord)

Get the pixel coordinate from a world coordinate

get_sky_coord(pixel)

Get the sky coordinate from a pixel coordinate

property C

Number of channels in the model

property Nx

Number of pixels in the x-direction

property Ny

Number of pixel in the y-direction

property bbox

The ~scarlet.bbox.Box of this Frame.

convert_pixel_to(target, pixel=None)[source]

Converts pixel coordinates from this frame to target Frame

Parameters:
target: `~scarlet.Frame`

target frame

pixel: `tuple` or list ((y1,y2, …), (x1, x2, …))

pixel coordinates in this frame If not set, convert all pixels in this frame

Returns:
coord_target: tuple

coordinates at the location of coord in the target frame

static from_observations(observations, model_psf=None, model_wcs=None, obs_id=None, coverage='union')[source]

Generates a suitable model frame for a set of observations.

This method generates a frame from a set of observations by identifying the highest resolution and the smallest PSF and use them to construct a common frame for all observations.

Parameters:
observations: array of `scarlet.Observation` objects

array that contains Observations to match onto a common frame

model_psf: `scarlet.PSF`

PSF of the model frame, to which all observations are to be deconvolved. If None, uses the smallest PSF across all observations and channels.

model_wcs: `astropy.wcs.WCS`

WCS for the model frame. If None, uses transformation of the observation with the smallest pixels.

obs_id: int

index of the reference observation If set to None, uses the observation with the smallest pixels.

coverage: “union” or “intersection”

Sets the frame to incorporate the pixels covered by any observation (‘union’) or by all observations (‘intersection’).

get_pixel(sky_coord)[source]

Get the pixel coordinate from a world coordinate

Parameters:
sky_coord: tuple, array

Coordinates on the sky

get_sky_coord(pixel)[source]

Get the sky coordinate from a pixel coordinate

Parameters:
pixel: tuple, array

Coordinates in the pixel space

property psf
property shape