api.radiantdrift.com
  • Radiant Drift API
    • Subscription Plans
    • Educational Use and Research
    • API End Points
  • Getting Started
    • About your account
    • Request Authentication
    • Managing API Keys
    • OpenAPI Specification
    • Date/Time Format
    • Validity, Accuracy, and Precision
  • Usage Guidelines
    • Acceptable Use Policy
    • Usage Credits and Call Costs
    • Attribution
    • Rate Limits
  • Julian Day
  • Delta-T
  • Rise, Transit, Set Times
  • Body Position
    • Request Parameters
    • Position at a given time
    • Positions for a time range
    • Observer location
  • Solar Eclipses
    • Embeddable Web Widgets
      • Eclipse Map
      • Eclipse Simulator
    • Besselian Elements
    • Local Circumstances
    • Eclipse Paths
    • Five Millennium Canon of Solar Eclipses
  • The Moon
    • Lunar Libration
    • Lunar Limb Profile
  • Geospatial
    • Geodesic
    • Elevation
  • Reference
    • Definitions
    • Errors
Powered by GitBook
On this page
  1. Body Position

Observer location

Calculating local horizontal coordinates with respect to an observer

To calculate local horizontal coordinates (topocentric) for an observer located at an arbitrary location on (or above) the Earth's surface, include a suitable value for the obs query parameter:

 axios({
	"method": "GET",
	"url": "https://api.radiantdrift.com/body-position/DATE_TIME_FROM",
 	"params": {
		"body": "[BODIES]",
		"obs": "LAT,LNG,HEIGHT"
	},
})
curl "https://api.radiantdrift.com/body-position/DATE_TIME_FROM/?obs=LAT,LNG,HEIGHT&body=BODIES"

LAT is the observer latitude in decimal degrees and LNG is the longitude (negative west). HEIGHT is the observer elevation above mean sea level, given in meters. If no elevation value is available, use zero (0m).

Example

The following query calculates the position of the Moon for March 21 2025 at 13:04:30 UTC as observed in Boulder, Colorado, USA:

GET https://api.radiantdrift.com/body-position/2025-03-21T13:04:30Z/?obs=40.009728,-105.237709,1612&body=moon

A localHorizontal object is included in the response, giving true and apparent azimuth/altitude coordinates for the observer, together with parallax and the effect of estimated refraction.

{
  "query": {
    "name": "body-position",
    "start-date": "2025-03-21T13:04:30.000Z",
    "obs": {
      "lat": 40.009728,
      "lng": -105.237709,
      "height": 1612
    },
    "alg": "standard",
    "high-accuracy": false,
    "body": [
      "moon"
    ],
    "ra-decl": null,
    "extras": [],
    "interval": 60
  },
  "response": {
    "2025-03-21T13:04:30.000Z": {
      "moon": {
        "dateTD": "2025-03-21T13:05:39.073Z",
        "jde": 2460756.04559112,
        "eclipticCoordinates": {
          "λ": 260.52729877,
          "β": -5.25429849
        },
        "geocentricSphericalCoordinates": {
          "λ": 260.52729877,
          "β": -5.25429849,
          "Δ": 398136.53563773
        },
        "apparentCoordinates": {
          "ra": -100.73114387,
          "decl": -28.34079256
        },
        "apparentLongitude": 260.52750373,
        "obliquityOfEcliptic": 23.43866925,
        "radiusVector": 13135.97563773,
        "nutationInLongitude": 0.00020496,
        "nutationInObliquity": 0.00265718,
        "equatorialHorizontalParallax": 0.91791617,
        "meanElongation": 267.39595465,
        "meanAnomalySun": 75.93822925,
        "meanAnomalyMoon": 237.2096644,
        "argOfLatitude": 269.42006603,
        "localHorizontal": {
          "true": {
            "azimuth": 190.28208172,
            "altitude": 20.04241573
          },
          "apparent": {
            "azimuth": 190.28208172,
            "altitude": 20.08140602
          },
          "parallax": {
            "azimuth": 0,
            "altitude": 0.85634116
          },
          "refraction": 0.0389903
        }
      }
    }
  }
}

The effect of atmospheric refraction is generally to increase the altitude of the body for the observer, as seen in the example above. The effect is more pronounced near the horizon.

PreviousPositions for a time rangeNextSolar Eclipses

Last updated 1 year ago