Learn R Programming

astrolibR (version 0.1)

sunpos: Compute the Right Ascension and Declination of the Sun at specified Julian date(s)

Description

Compute the Right Ascension and Declination of the Sun at specified Julian date(s)

Usage

sunpos(jd, radian=F)

Arguments

jd
Julian ephemeris date, scalar or vector
radian
if =TRUE, then all output variables are given in radians rather than degrees (default=FALSE)

Value

ra
apparent right ascension of the Sun, referred to the true equator of the specified date(s), in degrees
dec
declination of the Sun, in degrees
elong
ecliptic longitude of the Sun, in degrees
obliquity
obliquity of the ecliptic, in degrees

Details

This function uses a truncated version of Newcomb's Sun http://en.wikipedia.org/wiki/Newcomb's_Tables_of_the_Sun. The returned RA and Dec are in the given date's equinox.

Patrick Wallace (Rutherford Appleton Laboratory, UK) has tested the accuracy of a C adaptation of the IDL sunpos.pro code and found the following results. From 1900-2100 sunpos gave 7.3 arcsec maximum error, 2.6 arcsec RMS. Over the shorter interval 1950-2050 the figures were 6.4 arcsec max, 2.2 arcsec RMS.

See Also

cirrange nutate polyidl ten

Examples

Run this code
# Find the apparent RA and Dec of the Sun on May 1, 1982
# Result:  02 31 32.61  +14 54 34.9 
# The Astronomical Almanac gives 02 31 32.58 +14 54 34.9,
# so the error in sunpos for this case is < 0.5".
       
jd = jdcnv(1982, 5, 1,0)      # Find Julian date jd = 2445090.5   
out = sunpos(jd)  

  
# Plot the apparent declination of the Sun for every day in 1997

jd = jdcnv(1997,1,1,0)  # Julian date on Jan 1, 1997
days = seq(0,365)  
plot(days, sunpos(jd+days)$dec, type='b', pch=20, lwd=2) 

Run the code above in your browser using DataLab