Convert from calendar to Reduced Julian Date
Julian Day Number is a count of days elapsed since Greenwich mean noon
on 1 January 4713 B.C. The Julian Date is the Julian day number
followed by the fraction of the day elapsed since the preceding noon.
This procedure duplicates the functionality of the JULDAY() function in
in the standard IDL distribution, but also allows interactive input and
gives output as Reduced Julian date (=JD - 2400000.)
(Also note that prior to V5.1 there was a bug in JULDAY() that gave
answers offset by 0.5 days.)
JULDATE, /PROMPT ;Prompt for calendar Date, print Julian Date
JULDATE, date, jd
DATE - 3 to 6-element vector containing year,month (1-12),day, and
optionally hour, minute, and second all specified as numbers
(Universal Time). Year should be supplied with all digits.
Years B.C should be entered as negative numbers (and note that
Year 0 did not exist). If Hour, minute or seconds are not
supplied, they will default to 0.
JD - Reduced Julian date, double precision scalar. To convert to
Julian Date, add 2400000. JULDATE will print the value of
JD at the terminal if less than 2 parameters are supplied, or
if the /PROMPT keyword is set
Optional Input Keyword
/PROMPT - If this keyword is set and non-zero, then JULDATE will prompt
for the calendar date at the terminal.
The procedure HELIO_JD can be used after JULDATE, if a heliocentric
Julian date is required.
A date of 25-DEC-2006 06:25 UT may be expressed as either
IDL> juldate, [2006, 12, 25, 6, 25], jd
IDL> juldate, [2006, 12, 25.2673611d], jd
In either case, one should obtain a Reduced Julian date of
JD = 54094.7673611
Adapted from IUE RDAF (S. Parsons) 8-31-87
Algorithm from Sky and Telescope April 1981
Added /PROMPT keyword, W. Landsman September 1992
Converted to IDL V5.0 W. Landsman September 1997
Make negative years correspond to B.C. (no year 0), work for year 1582
Disallow 2 digit years. W. Landsman March 2000