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.

59 lines (58 loc) 2.18 kB
/*****************************************************************************************************************/ /*****************************************************************************************************************/ import type { GeographicCoordinate, Interval } from './common'; /*****************************************************************************************************************/ export declare enum Twilight { /** * * Night - The time when the sun is -18 degrees below the horizon. * */ Night = "Night", /** * * Astronomical - The time when the sun is between -12 and -18 degrees below the horizon. * */ Astronomical = "Astronomical", /** * * Nautical - The time when the sun is between -6 and -12 degrees below the horizon. * */ Nautical = "Nautical", /** * * Civil - The time when the sun is between 0 and -6 degrees below the horizon. * */ Civil = "Civil", /** * * Day - The time when the sun is above the horizon. * */ Day = "Day" } /*****************************************************************************************************************/ export type TwilightBand = { name: Twilight; interval: Interval; }; /*****************************************************************************************************************/ /** * * getTwilightBandsForDay() * * Returns the twilight bands for a given day, e.g., Night, Astronomical, Nautical, Civil, Day and their respective * intervals for a given observer (latitude and longitude) and datetime. * * @param datetime - The date and time for which to calculate the twilight bands * @param observer - The geographic coordinates of the observer * @param params - Optional parameters for the calculation * @returns An array of twilight bands for the given day */ export declare const getTwilightBandsForDay: (datetime: Date, observer: GeographicCoordinate, params?: { stepSeconds?: number; }) => TwilightBand[]; /*****************************************************************************************************************/