Grid

class sofia_redux.scan.coordinate_systems.grid.grid.Grid[source]

Bases: ABC

Initialize a Grid.

The Grid abstract class is a base for representation of astronomical data on a regular grid. The exact coordinate system used is not specified, and should be defined by the user. At the simplest level, a grid consists of a coordinate system (set of axes), a reference position, and the grid resolution.

The grid is used to convert from coordinates to offsets in relation to a specified reference onto a regular grid, and the reverse operation.

Forward transform: grid projection -> offsets -> coordinates Reverse transform: coordinates -> offsets -> grid projection

Attributes Summary

coordinate_system

Return the coordinate system.

fits_id

Return the FITS ID for the grid.

ndim

Return the number of grid dimensions.

reference

Return the grid reference position.

referenced_attributes

Return attributes that should be referenced rather than copied.

resolution

Return the grid resolution.

Methods Summary

copy()

Create and return a copy.

get_default_coordinate_instance()

Return a coordinate for the dimensions of the grid.

get_dimensions()

Return the number of grid dimensions.

get_fits_id()

Return the FITS variant ID for the grid.

get_grid_class(name)

Return a grid class of the given name.

get_grid_instance(name)

Return a grid instance for the given name.

get_reference()

Return the reference position of the grid.

get_reference_index()

Return the reference index of the reference position on the grid.

get_resolution()

Return the grid resolution.

set_coordinate_system(system)

Set the coordinate system for the grid.

set_reference(value)

Set the reference position of the grid.

set_reference_index(value)

Set the reference index of the reference position on the grid.

set_resolution(value)

Set the grid resolution.

Attributes Documentation

coordinate_system

Return the coordinate system.

Returns:
CoordinateSystem
fits_id

Return the FITS ID for the grid.

Returns:
str
ndim

Return the number of grid dimensions.

Returns:
n_dimensionsint
reference

Return the grid reference position.

Returns:
Coordinate
referenced_attributes

Return attributes that should be referenced rather than copied.

Returns:
set (str)
resolution

Return the grid resolution.

Returns:
Coordinate

Methods Documentation

copy()[source]

Create and return a copy.

Note that the copy scan is a reference. The configuration is unlinked (i.e. is no longer a reference).

Returns:
Channels
get_default_coordinate_instance()[source]

Return a coordinate for the dimensions of the grid.

Returns:
Coordinate
abstract get_dimensions()[source]

Return the number of grid dimensions.

Returns:
n_dimensionsint
get_fits_id()[source]

Return the FITS variant ID for the grid.

Returns:
str
static get_grid_class(name)[source]

Return a grid class of the given name.

Parameters:
namestr

The name of the grid.

Returns:
gridclass
static get_grid_instance(name)[source]

Return a grid instance for the given name.

Parameters:
namestr

The name of the grid.

Returns:
gridGrid or Grid2D1
abstract get_reference()[source]

Return the reference position of the grid.

Returns:
referenceCoordinate
abstract get_reference_index()[source]

Return the reference index of the reference position on the grid.

Returns:
indexOffset
abstract get_resolution()[source]

Return the grid resolution.

Returns:
resolutionOffset
set_coordinate_system(system)[source]

Set the coordinate system for the grid.

Parameters:
systemCoordinateSystem
Returns:
None
abstract set_reference(value)[source]

Set the reference position of the grid.

Parameters:
valueCoordinate

The reference coordinate to set.

Returns:
None
abstract set_reference_index(value)[source]

Set the reference index of the reference position on the grid.

Parameters:
valueOffset
Returns:
None
abstract set_resolution(value)[source]

Set the grid resolution.

Parameters:
valueOffset
Returns:
None