Learn R Programming

astrolibR (version 0.1)

hadec2altaz: Convert Hour Angle and Declination to Horizon (alt-az) coordinates

Description

Convert Hour Angle and Declination to Horizon (alt-az) coordinates

Usage

hadec2altaz( ha, dec, lat, ws=F)

Arguments

ha
local apparent hour angle, in degrees, scalar or vector
dec
local apparent declination, in degrees, scalar or vector
lat
local latitude, in degrees, scalar or vector
ws
if FALSE, the output azimuth is measured East from North. If TRUE, the output azimuth is measured West from South. (default=FALSE)

Value

alt
local apparent altitude, in degrees
az
local apparent azimuth, in degrees

Details

This function is intended mainly to be used by function eq2hor. It correctly treats the singularities at the North and South Celestial Poles.

Similar functions, elev and azimuth, are provided in the CRAN package astroFns.

See Also

altaz2hadec eq2hor

Examples

Run this code
# What were the apparent altitude and azimuth of the sun when it transited 
# the local meridian at Pine Bluff Observatory (Lat=+43.07833 degrees) on 
# April 21, 2002?   An object transits the local meridian at 0 hour angle.
# Assume this will happen at roughly 1 PM local time (18:00 UTC).
# Result: Altitude alt = 58.90,  Azimuth  az = 180.0

jd <- jdcnv(2002, 4, 21, 18.) # get rough Julian date to determine Sun declination
sun_pos <- sunpos(jd)
hadec2altaz(0., sun_pos$dec, 43.078333)

Run the code above in your browser using DataLab