Learn R Programming

astroFns (version 4.2-1)

ut2lst: Universal time to local sidereal time or hour angle

Description

Functions to calculate local sidereal time (LST) or hour angle (HA) from Universal time (strictly, UTC1).

Usage

ut2lst(yr = 2012, mo = 1, dy = 1, hr = 0, mi = 0, se = 0,
lon.obs = "W 79d 50.5m")

ut2ha(yr = 2012, mo = 1, dy = 1, hr = 0, mi = 0, se = 0, ra.sou = "13h 31m 08.3s", lon.obs = "W 79d 50m 23.4s")

Arguments

yr

UT1 Year

mo

UT1 Month number

dy

UT1 Day number

hr

UT1 Hour

mi

UT1 Minute

se

UT1 Seconds

ra.sou

String with source Right Ascension

lon.obs

String with observatory longitude

Value

Returns decimal local sidereal time in range 0 to 24 hours and hour angle from -1 to 12 hours, with class fracHrs (prints as h:m:s). For elapsed siderial time difference over multiple sidereal days, difference UT days (from e.g. ut2dmjd) and multiply by 1.002737909350795.

Details

If this input is hr = Sys.time() the function uses system time, including conversion to UT. UT is within a few seconds of UT1.

References

Greenwich mean sidereal time (GMST) at 0h UT1 from the "Explanatory Supplement to the Astronomical Almanac, " Seidelmann (ed), c. 1992. Approximate equation of the equinoxes from http://aa.usno.navy.mil/faq/docs/GAST.php.

See Also

ymd2jd, gmst1, dms2rad and hms2rad for input formats, Sys.time, Sys.timezone and time zone examples in as.POSIXlt.

Examples

Run this code
# NOT RUN {
# LST at UT1 midnight on the first of every month for Green Bank, WV, USA
midLST <- ut2lst(yr = 2012, mo = 1:12, dy = 1, hr = 0, mi = 0, se = 0,
                 lon.obs="W 79d 50.5m")
str(midLST)
midLST

# LST at EST midnight on the first of every month for Green Bank, WV, USA
# (EST = UT1-5 hours)
midLST <- ut2lst(yr = 2012, mo = 1:12, dy = 1, hr = -5, mi = 0, se = 0,
                 lon.obs="W 79d 50.5m")
str(midLST)
midLST

# LST in Green Bank, WV, USA, now, and 12 hours from now.
ut2lst(Sys.time())
ut2lst(Sys.time() + 12*3600)

# Hour angle of 3C286 in Green Bank now (using function defaults)
ut2ha(Sys.time())

# }

Run the code above in your browser using DataLab