Convert azimuth and altitude to declination

Description

Find the celestial declination corresponding to a terrestrial sightline at a known latitude and horizon altitude.

Usage

az2dec(
  az,
  loc,
  alt,
  refraction = skyscapeR.env$refraction,
  atm = skyscapeR.env$atm,
  temp = skyscapeR.env$temp
)

Arguments

az

True bearing or vector of bearings in degrees clockwise from north.

loc

One latitude or one per bearing (degrees north), a site matrix with one row per bearing (latitude, longitude and optional elevation), a shared horizon or a list of horizons in measurement order.

alt

Horizon altitude in degrees, shared or one per bearing. Omit when supplying horizons to interpolate altitude at each bearing with hor2alt.

refraction

Logical. Apply atmospheric refraction. Defaults to the session setting in skyscapeR.vars.

atm

Atmospheric pressure in mbar. Defaults to the session setting in skyscapeR.vars.

temp

Air temperature in degrees Celsius. Defaults to the session setting in skyscapeR.vars.

Details

The same true bearing can indicate different declinations when the observer or horizon changes. Supply angular altitude directly or interpolate it from one shared horizon or one horizon per observation. Numeric latitude inputs imply zero longitude and elevation; a location matrix can include both. When refraction is enabled, the function adjusts the input altitude using pressure, temperature and elevation, then calls the inverse Swiss Ephemeris horizontal transformation. Bearings are clockwise from north; the routine shifts them to the engine convention and rounds the returned declinations using the input bearing representation.

Value

Numeric declination in degrees for the supplied azimuth and altitude values.

Scientific checks

See Also

swe_azalt_rev, hor2alt

Examples

dec <- az2dec(az=92, loc=35, alt=2)

dec <- az2dec(az=c(92,89,102), loc=35, alt=c(0,2,4))

# flat horizon with 2 degrees of altitude
hor <- createHor(az=c(0,360), alt=c(2,2), loc=c(35,-8,25))
dec <- az2dec(92, loc=hor)

# Can also be used for an array of azimuths:
decs <- az2dec(az=c(87,92,110), loc=hor)