SphericalGrid

class sofia_redux.scan.coordinate_systems.grid.spherical_grid.SphericalGrid(reference=None)[source]

Bases: Grid2D

Initialize a spherical grid.

The spherical grid is used to convert between longitude/latitude coordinates on a sphere and offsets in relation to a specified reference position onto a regular grid, and the reverse operation.

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

Parameters:
referenceSphericalCoordinates

The reference coordinate from which to base any projections.

Attributes Summary

fits_x_unit

Return the unit for the FITS x-axis.

fits_y_unit

Return the unit for the FITS y-axis.

reference

Return the reference value for the spherical grid.

Methods Summary

get_coordinate_instance_for(ctype)

Return a coordinate instance for the given name.

get_default_unit()

Return the default unit for the grid class.

is_reverse_x()

Returns if the x-axis is reversed.

is_reverse_y()

Returns if the y-axis is reversed.

parse_projection(header)

Parse the projection from the header.

set_defaults()

Set the default values for the grid.

set_reference(reference)

Set the reference position of the grid.

Attributes Documentation

fits_x_unit

Return the unit for the FITS x-axis.

Returns:
units.Unit
fits_y_unit

Return the unit for the FITS y-axis.

Returns:
units.Unit
reference

Return the reference value for the spherical grid.

Returns:
SphericalCoordinates

Methods Documentation

classmethod get_coordinate_instance_for(ctype)[source]

Return a coordinate instance for the given name.

Parameters:
ctypestr
Returns:
SphericalCoordinates
classmethod get_default_unit()[source]

Return the default unit for the grid class.

Returns:
unitunits.Unit
is_reverse_x()[source]

Returns if the x-axis is reversed.

Returns:
bool
is_reverse_y()[source]

Returns if the y-axis is reversed.

Returns:
bool
parse_projection(header)[source]

Parse the projection from the header.

The projection is taken from the CTYPE1 value in the header (if no alternate designation is prescribed), beginning with the 5th character. For example, RA—TAN parses “-TAN” to create a gnomonic projection.

Parameters:
headerfits.Header
Returns:
None
set_defaults()[source]

Set the default values for the grid.

Returns:
None
set_reference(reference)[source]

Set the reference position of the grid.

Parameters:
referenceSphericalCoordinates
Returns:
None