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=integer)
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
optional
type: scalar (integer or double) or array of scalars
Number of the desired month (1 = January, ..., 12 = December).
day
in
optional
type: scalar (integer or double) or array of scalars
Number of day of the month.
yearin
in
optional
type: scalar (integer or double) or array of scalars
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
0 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)
hour
in
optional
type: scalar (integer or double) or array of scalars
default: 12
Number of the hour of the day.
minute
in
optional
type: scalar (integer or double) or array of scalars
default: 0
Number of the minute of the hour.
second
in
optional
type: scalar (integer or double) or array of scalars
default: 0
Number of the second of the minute.
Keywords
NDAYSPM
type: integer
default: 30
To use a calendar with fixed number of days per month.
see also the use of key_caltype (variable of the common file cm_4cal)
Version history
Version
$Id: julday.pro 396 2009-04-08 16:14:31Z smasson $
History
Translated from "Numerical Recipes 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 different 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.