ProjectionAstropyView#

class lsst.images.ProjectionAstropyView(ast_pixel_to_sky: Mapping, bbox: Box | None)#

Bases: BaseLowLevelWCS, HighLevelWCSMixin

An Astropy-interface view of a Projection.

Notes#

The constructor of this classe is considered a private implementation detail; use Projection.as_astropy instead.

This object satisfies the astropy.wcs.wcsapi.BaseHighLevelWCS and astropy.wcs.wcsapi.BaseLowLevelWCS interfaces while evaluating the underlying Projection itself. It is not an astropy.wcs.WCS subclass, which is a type that also satisfies those interfaces but only supports FITS WCS representations (see Projection.as_fits_wcs).

Attributes Summary

array_shape

The shape of the data that the WCS applies to as a tuple of length pixel_n_dim in (row, column) order (the convention for arrays in Python).

axis_correlation_matrix

Returns an (world_n_dim, pixel_n_dim) matrix that indicates using booleans whether a given world coordinate depends on a given pixel coordinate.

low_level_wcs

Returns a reference to the underlying low-level WCS object.

pixel_axis_names

An iterable of strings describing the name for each pixel axis.

pixel_bounds

The bounds (in pixel coordinates) inside which the WCS is defined, as a list with pixel_n_dim (min, max) tuples.

pixel_n_dim

The number of axes in the pixel coordinate system.

pixel_shape

The shape of the data that the WCS applies to as a tuple of length pixel_n_dim in (x, y) order (where for an image, x is the horizontal coordinate and y is the vertical coordinate).

serialized_classes

Indicates whether Python objects are given in serialized form or as actual Python objects.

world_axis_names

An iterable of strings describing the name for each world axis.

world_axis_object_classes

A dictionary giving information on constructing high-level objects for the world coordinates.

world_axis_object_components

A list with world_n_dim elements giving information on constructing high-level objects for the world coordinates.

world_axis_physical_types

An iterable of strings describing the physical type for each world axis.

world_axis_units

An iterable of strings given the units of the world coordinates for each axis.

world_n_dim

The number of axes in the world coordinate system.

Methods Summary

array_index_to_world(*index_arrays)

Convert array indices to world coordinates (represented by Astropy objects).

array_index_to_world_values(*index_arrays)

Convert array indices to world coordinates.

pixel_to_world(*pixel_arrays)

Convert pixel coordinates to world coordinates (represented by high-level objects).

pixel_to_world_values(x, y)

Convert pixel coordinates to world coordinates.

world_to_array_index(*world_objects)

Convert world coordinates (represented by Astropy objects) to array indices.

world_to_array_index_values(*world_arrays)

Convert world coordinates to array indices.

world_to_pixel(*world_objects)

Convert world coordinates (represented by Astropy objects) to pixel coordinates.

world_to_pixel_values(ra, dec)

Convert world coordinates to pixel coordinates.

Attributes Documentation

array_shape#
axis_correlation_matrix#
low_level_wcs#
pixel_axis_names#
pixel_bounds#
pixel_n_dim#
pixel_shape#
serialized_classes#
world_axis_names#
world_axis_object_classes#
world_axis_object_components#
world_axis_physical_types#
world_axis_units#
world_n_dim#

Methods Documentation

array_index_to_world(*index_arrays)#

Convert array indices to world coordinates (represented by Astropy objects).

If a single high-level object is used to represent the world coordinates (i.e., if len(wcs.world_axis_object_classes) == 1), it is returned as-is (not in a tuple/list), otherwise a tuple of high-level objects is returned. See array_index_to_world_values for pixel indexing and ordering conventions.

array_index_to_world_values(*index_arrays)#

Convert array indices to world coordinates.

This is the same as pixel_to_world_values except that the indices should be given in (i, j) order, where for an image i is the row and j is the column (i.e. the opposite order to pixel_to_world_values).

If world_n_dim is 1, this method returns a single scalar or array, otherwise a tuple of scalars or arrays is returned.

pixel_to_world(*pixel_arrays)#

Convert pixel coordinates to world coordinates (represented by high-level objects).

If a single high-level object is used to represent the world coordinates (i.e., if len(wcs.world_axis_object_classes) == 1), it is returned as-is (not in a tuple/list), otherwise a tuple of high-level objects is returned. See pixel_to_world_values for pixel indexing and ordering conventions.

pixel_to_world_values(x: ndarray, y: ndarray) XY[ndarray]#

Convert pixel coordinates to world coordinates.

This method takes pixel_n_dim scalars or arrays as input, and pixel coordinates should be zero-based. Returns world_n_dim scalars or arrays in units given by world_axis_units. Note that pixel coordinates are assumed to be 0 at the center of the first pixel in each dimension. If a pixel is in a region where the WCS is not defined, NaN should be returned. The coordinates should be specified in the (x, y) order, where for an image, x is the horizontal coordinate and y is the vertical coordinate.

If world_n_dim is 1, this method returns a single scalar or array, otherwise a tuple of scalars or arrays is returned.

world_to_array_index(*world_objects)#

Convert world coordinates (represented by Astropy objects) to array indices.

If pixel_n_dim is 1, this method returns a single scalar or array, otherwise a tuple of scalars or arrays is returned. See world_to_array_index_values for pixel indexing and ordering conventions. The indices should be returned as rounded integers.

world_to_array_index_values(*world_arrays)#

Convert world coordinates to array indices.

This is the same as world_to_pixel_values except that the indices should be returned in (i, j) order, where for an image i is the row and j is the column (i.e. the opposite order to pixel_to_world_values). The indices should be returned as rounded integers.

If pixel_n_dim is 1, this method returns a single scalar or array, otherwise a tuple of scalars or arrays is returned.

world_to_pixel(*world_objects)#

Convert world coordinates (represented by Astropy objects) to pixel coordinates.

If pixel_n_dim is 1, this method returns a single scalar or array, otherwise a tuple of scalars or arrays is returned. See world_to_pixel_values for pixel indexing and ordering conventions.

world_to_pixel_values(ra: ndarray, dec: ndarray) XY[ndarray]#

Convert world coordinates to pixel coordinates.

This method takes world_n_dim scalars or arrays as input in units given by world_axis_units. Returns pixel_n_dim scalars or arrays. Note that pixel coordinates are assumed to be 0 at the center of the first pixel in each dimension. If a world coordinate does not have a matching pixel coordinate, NaN should be returned. The coordinates should be returned in the (x, y) order, where for an image, x is the horizontal coordinate and y is the vertical coordinate.

If pixel_n_dim is 1, this method returns a single scalar or array, otherwise a tuple of scalars or arrays is returned.