az2dec: Calculates declination from azimuth and altitude measurements

View source: R/mechanics.R

az2decR Documentation

Calculates declination from azimuth and altitude measurements

Description

This function calculates the declination corresponding to an orientation , i.e. an azimuth. The altitude can either be given or, alternatively, if a skyscapeR.horizon object is provided, the corresponding horizon altitude will be automatically retrieved. This function is a wrapper for function swe_azalt_rev of package swephR.

Usage

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

Arguments

az

Azimuth(s) for which to calculate declination(s). See examples below.

loc

Location, can be either a skyscapeR.horizon object or, alternatively, an array of latitude values.

alt

(Optional) Altitude of orientation. If left empty and a skyscapeR.horizon is provided then this is will automatically retrieved from the horizon data via hor2alt

refraction

(Optional) Whether atmospheric refraction is to be taken into account. If not given the value set by skyscapeR.vars will be used instead.

atm

(Optional) Atmospheric pressure for refraction calculation. If not given the value set by skyscapeR.vars will be used instead.

temp

(Optional) Atmospheric temperature for refraction calculation. If not given the value set by skyscapeR.vars will be used instead.

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)

f-silva-archaeo/skyscapeR documentation built on Sept. 24, 2023, 8:14 p.m.