UNPKG

@observerly/astrometry

Version:

observerly's lightweight, zero-dependency, type safe astrometry library written in Typescript for calculating the position of celestial objects in the sky.

105 lines (104 loc) 2.9 kB
/*****************************************************************************************************************/ /*****************************************************************************************************************/ import type { CartesianCoordinate, EquatorialCoordinate } from './common'; /*****************************************************************************************************************/ export type SIP2DParameters = { AOrder: number; APower: { [key: string]: number; }; BOrder: number; BPower: { [key: string]: number; }; }; /*****************************************************************************************************************/ export declare const parseSIPTerm: (term: string, prefix: 'A' | 'B') => [number, number] | null; /*****************************************************************************************************************/ export type WCS = { /** * * * The central or reference pixel for the WCS, e.g., the central pixel of the image. * * */ crpix: CartesianCoordinate; /** * * * The central or reference equatorial coordinate for the WCS, corresponding to the pixel at the central reference pixel. * * */ crval: EquatorialCoordinate; /** * * * CD Matrix Element 1,1 for the WCS * * */ cd11: number; /** * * * CD Matrix Element 1,2 for the WCS * * */ cd12: number; /** * * * CD Matrix Element 2,1 for the WCS * * */ cd21: number; /** * * * CD Matrix Element 2,2 for the WCS * * */ cd22: number; /** * * * Constant term for the right ascension (from the Affine transformation matrix) * * */ E: number; /** * * * Constant term for the declination (from the Affine transformation matrix) * * */ F: number; /** * * * SIP (Simple Imaging Polynomial) parameters for the WCS * * */ SIP?: SIP2DParameters; }; /*****************************************************************************************************************/ /** * * convertPixelToWorldCoordinateSystem * * Converts a given image pixel to an equatorial coordinate base on the prescribed WCS * * @param wcs the World Coordinate System (WCS) parameters to use for the conversion * @param pixel the pixel to convert to an equatorial coordinate, e.g., { x: 0, y: 0 } * @returns the equatorial coordinate of a given pixel in the prescribed WCS */ export declare const convertPixelToWorldCoordinateSystem: (wcs: WCS, pixel: CartesianCoordinate) => EquatorialCoordinate; /*****************************************************************************************************************/