coolest.api.coordinates#

Classes#

Coordinates

Object that holds the grid of pixel coordinates and provides

Module Contents#

class Coordinates(nx, ny, matrix_ij_to_xy, x_at_ij_0, y_at_ij_0)[source]#

Object that holds the grid of pixel coordinates and provides conversions between coordinates in pixel units (‘i’, ‘j’) and physical (‘x’, ‘y’, in arcseconds) units.

Parameters:
  • nx (int) – Number of pixels along the x axis

  • ny (int) – Number of pixels along the y axis

  • matrix_ij_to_xy (2x2 ndarray) – Matrix such that when multiplied to vector of coordinates in pixel units, it returns the vector in physical units. Note that it should be diagonal according to COOLEST conventions.

  • x_at_ij_0 (physical) – x-coordinate of the pixel with index (0, 0)

  • y_at_ij_0 (_type_) – y-coordinate of the pixel with index (0, 0)

property pixel_area[source]#
property pixel_size[source]#
property num_points[source]#
property pixel_coordinates[source]#
property pixel_axes[source]#
property extent[source]#

set of extreme coordinates points

property plt_extent[source]#

set of coordinates of the borders of the grid (useful for matplotlib functions)

property shape[source]#
property center[source]#
property x_is_inverted[source]#
property y_is_inverted[source]#
static map_coord(ra, dec, x_0, y_0, M)[source]#
radec_to_pixel(ra, dec)[source]#
pixel_to_radec(x, y)[source]#
static grid_from_coordinate_transform(nx, ny, Mpix2coord, x_at_ij_0, y_at_ij_0)[source]#
coordinate_grid_1d(nx, ny)[source]#
coordinate_grid_2d(nx, ny)[source]#
create_new_coordinates(pixel_scale_factor=None, grid_center=None, grid_shape=None)[source]#

Based on the current coordinates, creates a sub-coordinates system potentially shifted, with a different pixel size and field-of-view.

Parameters:
  • pixel_scale_factor (float, optional) – Ratio between the new pixel size and the original pixel size, by default None

  • grid_center ((float, float), optional) – x and y center coordinates of the new coordinates grid, by default None

  • grid_shape ((float, float), optional) – Width and height (in arcsec) of the new coordinates grid, by default None

Returns:

New instance of a Coordinates object

Return type:

Coordinates