Calendar/
julday.pro
Calculate the Julian Day Number for a given month, day, and year.
This is the inverse of the library function CALDAT.
3 calendars are available according to the value of key_caltype
(variable of the common file cm_4cal): 'greg', '360d', 'noleap'
julday Calendar
result = julday(MONTH, DAY, YEARin[, Hour][, Minute][, Second], NDAYSPM=NDAYSPM)
Return value
the Julian Day Number (which begins at noon) of the specified calendar date.
If Hour, Minute, and Second are not specified, then the result will be a
long integer, otherwise the result is a double precision floating point
number.
Parameters
MONTH
in
required
Number of the desired month (1 = January, ..., 12 = December).
Can be scalar or array
DAY
in
required
Number of day of the month.Can be scalar or array
YEARin
in
required
Number of the desired year.Year parameters must be valid
values from the civil calendar. Years B.C.E. are represented
as negative integers. Years in the common era are represented
as positive integers. In particular, note that there is no
year 0 in the civil calendar. 1 B.C.E. (-1) is followed by
1 C.E. (1).
Change: However for climatological year, we do accept the year
O but we change it for year 654321L (the same trick is done in
caldat so caldat, julday(1,1,0) gives you back Jan 1st of year 0)
Can be scalar or array
Hour
in
optional
default: 12
Number of the hour of the day. Can be scalar or array
Minute
in
optional
default: 0
Number of the minute of the hour. Can be scalar or array
Second
in
optional
default: 0
Number of the second of the minute. Can be scalar or array
Keywords
NDAYSPM
default: 30
To use a calendar with fixed number of days per months.
see also the use of key_caltype (variable of the common file cm_4cal)
Version history
Version
$Id: julday.pro 137 2006-07-12 09:33:44Z smasson $
History
Translated from "Numerical Recipies in C", by William H. Press,
Brian P. Flannery, Saul A. Teukolsky, and William T. Vetterling.
Cambridge University Press, 1988 (second printing).
AB, September, 1988
DMS, April, 1995, Added time of day.
Eric Guilyardi, June 1999
Added key_work ndayspm for fixed number of days per months
CT, April 2000, Now accepts vectors or scalars.
Sebastien Masson, Aug. 2003
fix bug for negative and large values of month values
eg. julday(349,1,1970)
Sebastien Masson, May 2006, add diferent calendat with key_caltype
(variable of the common file cm_4cal)
Known issues
Restrictions
The Result will have the same dimensions as the smallest array, or
will be a scalar if all arguments are scalars.
Accuracy using IEEE double precision numbers is approximately
1/10000th of a second, with higher accuracy for smaller (earlier)
Julian dates.
Other attributes
Uses routines
cm_4cal
Produced by IDLdoc 2.0 on Tue Aug 29 14:49:05 2006.