UNPKG

target-position

Version:

Resolve target names to positions using the Sesame web service.

52 lines (51 loc) 1.53 kB
/** * A target position. * * Params: * ------- * rightAscension: Right ascension, in degrees. * declination: Declination, in degrees. * equinox: Equinox, as a float. */ export interface IPosition { rightAscension: number; declination: number; equinox: number; } /** * A resolver for resolving target names. */ declare type Resolver = "Simbad" | "NED" | "VizieR"; /** * Resolve a target name to a position by means of the Sesame web service. * * The position is returned as an object with a right ascension (in degrees), a * declination (in degrees) and an equinox (as a float). * * The function accepts an array of resolvers. The order of the array items * matters; the resolvers are tried in the order they appear in the array, and * the first target position found is returned. * * A promise is returned. If the target can be resolved, the promise is * resolved with the target position. Otherwise it is rejected with an Error. * * Params: * ------- * targetName: Target name. * resolvers: Resolvers, in the order in which they should be tried, * * Returns: * -------- * A promise which is resolved with the target position (if one is found) or * rejected with an Error. */ export default function targetPosition(targetName: string, resolvers?: Resolver[]): Promise<IPosition | null>; /** * Set the base URL for the Sesame web service. * * Params: * ------- * url: The base URL for the Sesame web service. */ export declare function setMirror(url: string): void; export {};