Locate a Solar System body in equatorial coordinates at a specified instant, or determine where it appears in the observer's sky.
body.position(
time,
obj = "sun",
loc = NULL,
timezone,
calendar,
dec,
refraction,
atm,
temp,
verbose = T
)
time |
Either a string containing the date and time in the format "YYYY/MM/DD HH:MM:SS"
(see |
obj |
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 |
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 |
Logical. Display progress or informational messages. Default |
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.
The Swiss Ephemeris manual documents planetary coordinates and reference frames.
Astronomical positions require Swiss Ephemeris files covering the epoch. We
recommend installing swephRdata; see skyscapeR-package for setup.
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.
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. See the A02 study in the skyscapeR technical manual.
Structured results carry a provenance attribute. Read it with
attr(result, "provenance"); its packages entry records the loaded
skyscapeR and swephR versions, with NA when a namespace version is unavailable.
This attribute adds no list entries or table columns. Ordinary subsetting or
transformations may discard attributes; save the original result for reference.
It does not identify ephemeris files, catalogue revisions or a development
commit. Retain those and the analysis script separately for exact reproduction.
Across 1,080 geocentric positions, the largest separation from the matching JPL parent was 0.0065 arcseconds. Across 177 lunar skyline crossings the median default bearing difference was 0.059 degrees. A02 study.
For six stars compared with independently propagated catalogue directions, the largest separation was 0.0165 degrees, for Sirius in 3500 BCE. A03 study.
The zero-declination track crossed a level skyline at 90 and 270 degrees at 50 degrees north. The study also checks irregular skylines and JPL crossings. A04 study.
Four lunar standstill limits agreed with the monthly reference tables to within 0.019 degrees. The study also examines sampling of planetary extrema. A06 study.
Independent selection agreed in 31 of 32 lunar event cases. At the equator in autumn 1913 the two illumination estimates straddled the EFM cutoff. A07 study.
Twilight brightness had a mean absolute residual of 0.481 magnitudes against 22 held-out measurements. This benchmark covers twilight only. V03 study.
Astrodienst. Swiss Ephemeris programmer's manual. https://www.astro.com/swisseph/swephprg.htm.
swe_calc_ut, timestring, time2jd
if (requireNamespace("swephRdata", quietly = TRUE)) {
# Position of the sun at noon GMT on Christmas day 2018:
body.position(obj='sun', time='2018/12/25 12:00:00', timezone='GMT')
# Declination of the moon at same time
body.position(obj='moon', time='2018/12/25 12:00:00', timezone='GMT')$equatorial$Dec
# Geometric position using a horizon object's observer location:
hor <- createHor(az=c(0,360), alt=c(2,2), loc=c(51.5,-0.1,25))
body.position(obj='sun', time='2018/12/25 12:00:00', timezone='UTC',
loc=hor, refraction=FALSE)$horizontal
}