Find when and where a star or Solar System body first rises above or sets below the horizon at an observing site.
riseset(
loc,
date,
jd,
obj = "sun",
alt = 0,
timezone,
calendar,
dec,
refraction,
atm,
temp,
verbose = TRUE
)
loc |
Location, either a skyscapeR.horizon or a vector containing the latitude, longitude and elevation of location, in this order. |
date |
Either a string containing the date in the format "YYYY/MM/DD"
(see |
jd |
A numeric containing the julian date (see |
obj |
Solar System body, Western star name or fixed-star catalogue identifier (including M 45). Defaults to 'sun'. |
alt |
The altitude of the horizon to consider. Defaults to zero degrees. |
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 |
The event is a crossing of the local horizon by the body's centre. A raised ridge can delay the first visible rise and an uneven horizon can give several appearances or disappearances. Choose the horizon model, atmosphere, calendar and time convention to match the observation.
Events refer to the centre of the disc. For a Solar System body with a coordinate vector, alt is one constant horizon altitude and the Swiss Ephemeris rise/set solver is used. For stars, the daily track is evaluated against the supplied constant altitude or site skyline. With a horizon object, its profile is linearly interpolated in azimuth and compared with the body's topocentric altitude; do not supply alt as well. Refraction TRUE uses apparent altitude; FALSE uses geometric altitude. The constant-altitude solver likewise disables refraction only when FALSE. For a profile, search the 48 hours after each requested local midnight and return the first upward and first downward crossing separately. They need not enclose one continuous visibility interval or occur on the requested day. Missing crossings return NA fields. A one-minute base grid, quarter-step samples, azimuth turning points and recursively subdivided rapid azimuth motion bracket visits to the profile's corners. Each smooth segment is also searched for an interior altitude extremum, so short emergence/reoccultation pairs need not straddle time samples. A pure tangency without a sign change is not a rise or set. Horizon altitudes at 0 and 360 degrees must agree. Root tolerance is 0.01 seconds; interior optimization uses relative seconds to avoid precision loss from large Julian dates. These settings are not a physical accuracy guarantee: finite precision, unresolved terrain and near-zenith azimuth singularities limit numerical completeness. The dec argument controls returned declination, not the topocentric event search.
The Swiss Ephemeris manual documents the fixed-altitude rise/set calculation.
Astronomical positions require Swiss Ephemeris files covering the epoch. We
recommend installing swephRdata; see skyscapeR-package for setup.
A list containing object, rise and set; rise/set are data frames with date, time, azimuth and declination columns. Missing events have NA fields.
A02 tested sensitivity to ephemeris conventions using a separate solver on airless lunar-centre trajectories. Across 177 prehistoric skyline crossings, default azimuths differed from JPL Horizons by a median of 0.059 degrees and a maximum of 0.322 degrees. Matching delta T reduced the maximum to 0.027 degrees. See the A02 study in the skyscapeR technical manual.
A04 recovered the expected crossing counts and order on synthetic ridges, notches and grazing tracks; solar and lunar centre crossings at the Malta test site agreed with JPL Horizons within 0.85 seconds and 0.0041 degrees. See the A04 check in the technical manual.
H07 verified that a partial panorama is rejected before searching for solar or stellar crossings on an unobserved skyline. See the H07 check in the technical manual.
The result supplies geometry and time. It applies neither atmospheric extinction
nor a twilight detection threshold and does not test whether the star can be
seen. A centre exactly at the skyline can remain obscured in a plot or too faint
to detect. Use star.phases to select a candidate season, then
inspect moments after the crossing with sketchSky and
skyStep. The extra time needed for clearance depends on track
slope, latitude and terrain; a universal minute offset is inappropriate.
A numerical root tolerance describes the solver, not observational timing accuracy. Uncertain terrain height, refraction and ancient Earth-rotation models can dominate it. Saved output contains formatted civil times rather than a complete record of the input atmosphere and horizon. Preserve the original call and convert date/time back with matching calendar and timezone.
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.
A partial photographic horizon returned missing altitudes outside its sector. Full-sky event searches rejected it and accepted the complete profile. H07 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.
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.
First-morning dates fell within seven days of 22 of 23 sightings and last-evening dates within seven days of 21 of 33. The respective median predictions were two days early and five days late. V01 study.
The field-to-sky replay recovered the Gacrux position between the Skorba West entrance edges, 2.41 degrees above the measured skyline at the illustrated instant. W02 study.
Astrodienst. Swiss Ephemeris programmer's manual. https://www.astro.com/swisseph/swephprg.htm.
swe_calc_ut, swe_azalt, body.position, star.phases
if (requireNamespace("swephRdata", quietly = TRUE)) {
# Rising and setting of the sun on june solstice 2018, from the location of London
riseset(obj='sun', date='2018/06/21', loc=c(51.5, 0.11, 100))
## Not run:
# Horizon searches and multi-date calculations can exceed five seconds.
# Rising and setting of the moon on june solstice 2018, using a horizon profile
hor <- malta_horizons[[1]]
riseset(obj='moon', date='2018/06/21', loc=hor)
# Rising and setting of the sun throughout February 1999, from the location of London
riseset(obj='sun', date='1999/02', loc=c(51.5, 0.11, 100))
# Rising and setting of the sun throughout 3001 BC, from the location of London
riseset(obj='sun', date=-3000, loc=c(51.5, 0.11, 100))
## End(Not run)
}