coordinates#
Methods for dealing with coordinates.
- hsr4hci.coordinates.cartesian2polar(position, frame_size)[source]#
Convert a position in Cartesian coordinates (in pixels) to astronomical polar coordinates.
- Parameters:
- Returns:
A 2-tuple (separation, angle), where the separation is a
Quantityin pixels, and angle is aQuantityin radian. The angle uses the astronomical convention for polar coordinates, that is, 0 is βupβ, not βrightβ (unlike in mathematical polar coordinates).- Return type:
- hsr4hci.coordinates.get_center(frame_size)[source]#
Using the frame size of an image, determine the precise position of its center in the usual coordinate system that we place on our data: The center of the pixel in the bottom left corner of the image is defined as (0, 0), so the bottom left corner of the image is located at (-0.5, -0.5).
This function is essentially a simplified port of the corresponding PynPoint function
pynpoint.util.image.center_subpixel().
- hsr4hci.coordinates.polar2cartesian(separation, angle, frame_size)[source]#
Convert a position in astronomical polar coordinates to Cartesian coordinates (in pixels).
- Parameters:
separation (Quantity) β Separation from the center (as a
Quantityobject that can be converted to pixels).angle (Quantity) β Angle, measured from the up = North direction (this corresponds to a -90Β° offset compared to βnormalβ polar coordinates), as a
Quantityobject that can be converted to degrees or radian.frame_size (Tuple[int, int]) β A 2-tuple (x_size, y_size) of integers specifying the size of the frame that we are working with.
- Returns:
A 2-tuple (x, y) containing the Cartesian representation of the position specified by the (separation, angle) tuple. The Cartesian representation uses the astropy convention for the position of the origin, and the numpy convention for the order of the dimensions.
- Return type: