body.position()
Scientific results for this function.
A02 validation. In A02, file-backed geocentric directions for ten bodies agreed with their matching JPL parent to within 0.0065 arcseconds across 1,080 comparisons. At the sampled prehistoric epochs the public topocentric convention differed from JPL Horizons by up to 0.70 degrees in local sky direction at a specified instant. Geocentric and local position results.
An alignment comparison needs an epoch, a reference frame and, for a local sightline, a site. Character times are converted to UT Julian dates using the selected calendar and timezone; numeric times are already UT Julian dates. Swiss Ephemeris supplies right ascension and declination. Without a site the function uses the geocentric frame. With a site it can use a topocentric position and convert to local azimuth and altitude. A vector of times is evaluated one instant at a time and returned in input order.
Only the horizon object's location is used; its altitude profile is not used to determine whether the body is visible above the terrain. With a location, horizontal altitude is apparent when refraction is TRUE and geometric when FALSE. Azimuth is measured clockwise from north.
Method references
Astrodienst. Swiss Ephemeris programmer's manual. https://www.astro.com/swisseph/swephprg.htm.
Interpretation and limits. Use the same instant, coordinate frame, observer, refraction and ephemeris files when comparing against another engine. Agreement in equatorial coordinates alone leaves the local horizontal conversion untested.
Implementation arguments, return value and documented modes
| Argument | Formal default | Behaviour in this interface |
|---|---|---|
time |
— | Either a string containing the date and time in the format "YYYY/MM/DD HH:MM:SS" (see |
obj |
"sun" |
String containing name of the solar system body of interest. Can be any of the planets (inc. Pluto), the Moon, the Sun or the Ecliptic. Defaults to 'sun'. |
loc |
NULL |
Observer location: a numeric vector containing latitude and longitude in degrees and elevation in metres, in that order, or a skyscapeR.horizon object whose metadata supplies those coordinates. Required for topocentric coordinates and for horizontal output in either frame. With no location, only geocentric equatorial coordinates are returned. |
timezone |
— | Timezone for civil timestamps. Use UTC or a fixed offset for dates before 1900. See |
calendar |
— | Calendar for civil dates. Use |
dec |
— | Output declination: geo for the geocentric, or topo for the topocentric frame of reference. If not given the value set by |
refraction |
— | Logical. Apply atmospheric refraction. Defaults to the session setting in |
atm |
— | Atmospheric pressure in mbar. Defaults to the session setting in |
temp |
— | Air temperature in degrees Celsius. Defaults to the session setting in |
verbose |
T |
Logical. Display progress or informational messages. Default |
Return value
A list containing an equatorial data frame with columns
RA and Dec, in degrees. When loc is supplied, the list
also contains a horizontal data frame with columns az and
alt, in degrees. Each data frame has one row per input time.
Implementation. R/mechanics.R. Full function help · Sky reconstruction · Ephemeris · Time, coordinates and ephemerides outline · Terrain crossings and event searches · Identifying celestial candidates and limiting declinations · Astronomical conventions and stellar positions