Siddhanta Parity API Documentation - v1.3.0
    Preparing search index...
    • Finds the next time the center of a body passes through a given altitude.

      Finds when the center of the given body ascends or descends through a given altitude angle, as seen by an observer at the specified location on the Earth. By using the appropriate combination of direction and altitude parameters, this function can be used to find when civil, nautical, or astronomical twilight begins (dawn) or ends (dusk).

      Civil dawn begins before sunrise when the Sun ascends through 6 degrees below the horizon. To find civil dawn, pass +1 for direction and -6 for altitude.

      Civil dusk ends after sunset when the Sun descends through 6 degrees below the horizon. To find civil dusk, pass -1 for direction and -6 for altitude.

      Nautical twilight is similar to civil twilight, only the altitude value should be -12 degrees.

      Astronomical twilight uses -18 degrees as the altitude value.

      By convention for twilight time calculations, the altitude is not corrected for atmospheric refraction. This is because the target altitudes are below the horizon, and refraction is not directly observable.

      SearchAltitude is not intended to find rise/set times of a body for two reasons: (1) Rise/set times of the Sun or Moon are defined by their topmost visible portion, not their centers. (2) Rise/set times are affected significantly by atmospheric refraction. Therefore, it is better to use SearchRiseSet to find rise/set times, which corrects for both of these considerations.

      SearchAltitude will not work reliably for altitudes at or near the body's maximum or minimum altitudes. To find the time a body reaches minimum or maximum altitude angles, use SearchHourAngle.

      Parameters

      • body: Body

        The Sun, Moon, any planet other than the Earth, or a user-defined star that was created by a call to DefineStar.

      • observer: Observer

        Specifies the geographic coordinates and elevation above sea level of the observer.

      • direction: number

        Either +1 to find when the body ascends through the altitude, or -1 for when the body descends through the altitude. Any other value will cause an exception to be thrown.

      • dateStart: FlexibleDateTime

        The date and time after which the specified altitude event is to be found.

      • limitDays: number

        Limits how many days to search for the body reaching the altitude angle, and defines the direction in time to search. When limitDays is positive, the search is performed into the future, after dateStart. When negative, the search is performed into the past, before dateStart. To limit the search to the same day, you can use a value of 1 day. In cases where you want to find the altitude event no matter how far in the future (for example, for an observer near the south pole), you can pass in a larger value like 365.

      • altitude: number

        The desired altitude angle of the body's center above (positive) or below (negative) the observer's local horizon, expressed in degrees. Must be in the range [-90, +90].

      Returns AstroTime | null

      The date and time of the altitude event, or null if no such event occurs within the specified time window.