As the instant of an object’s rising or setting is linked to the Earth’s rotation and the calendar, the correct time scale and calendar must be selected, depending on the requested date. The default behavior of the API is to use the UTC timescale and the Gregorian calendar.
The following example retrieves the apparent position (right ascension, declination) of the Sun on July 5th, 2020 every hour from 0h UTC to 23h UTC for an observer located at Paris (48.8534°N,2.34880°E,39m) with a spaced output table.
wget "https://opale.imcce.fr/api/v1/positions/10?date=2020-07-05T00:00:00&nbd=24×cale=UTC&observer=48.8534,2.3488,39&quantities=radec&places=apparent&format=text"
The following example retrieves the astrometric position (right ascension, declination) of the Sun at some dates (July 5th at 12h15 , August 1st at 13h30 , September 2nd at 14h00 ) in the timescale TT, for at the geocenter with an output encoded in json.
import json
import requests
content = {
"body": 10,
"observer": 399,
"frame": "TrueOfDate",
"timescale": "TT",
"reference": "origin",
"places": "astrometric",
"quantities":
[
"radec"
],
"date-set":
[
"2020-07-05T12:15:00.000",
"2020-08-01T13:30:00.000",
"2020-09-02T14:00:00.000"
]
}
apicall = "https://opale.imcce.fr/api/v1/positions"
response = requests.post( apicall, data = json.dumps(content) )
print(response.json())
The following example retrieves the apparent position (right ascension, declination) of the Sun on July 5th, 2020 every hour from 0h UTC to 23h UTC for an observer located at Paris (48.8534°N,2.34880°E,39m) with a spaced output table.
wget "https://opale.imcce.fr/api/v1/positions/10?date=2020-07-05T00:00:00&nbd=24×cale=UTC&observer=48.8534,2.3488,39&quantities=radec&places=apparent&format=text"