Changeset 136 for trunk/SRC/Calendar
- Timestamp:
- 07/10/06 17:20:19 (18 years ago)
- Location:
- trunk/SRC/Calendar
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/SRC/Calendar/caldat.pro
r134 r136 2 2 ; 3 3 ; @file_comments 4 ; Return the calendar date and time given julian date.5 ; 4 ; Return the calendar date and time given Julian date. 5 ; This is the inverse of the function JULDAY. 6 6 ; 7 7 ; @categories Calendar 8 8 ; 9 ; 10 ; @param JULIAN {in}{required} contains the Julian Day Number (which begins at noon) of the 11 ; specified calendar date. It should be a long integer. 12 ; 13 ; @param MONTH {out} Number of the desired month (1 = January, ..., 12 = December). 14 ; 15 ; @param DAY {out} Number of day of the month. 16 ; 17 ; @param YEAR {out} Number of the desired year. 18 ; 19 ; @param HOUR {out} Hour of the day 20 ; 21 ; @param Minute {out} Minute of the day 22 ; 23 ; @param Second {out} Second (and fractions) of the day. 24 ; 25 ; 26 ; @keyword NDAYSPM {default=30} for using a calendar with fixed number of days per 27 ; months. 9 ; @param JULIAN {in}{required} 10 ; contains the Julian Day Number (which begins at noon) of the 11 ; specified calendar date. It should be a long integer. 12 ; 13 ; @param MONTH {out} 14 ; Number of the desired month (1 = January, ..., 12 = December). 15 ; 16 ; @param DAY {out} 17 ; Number of day of the month. 18 ; 19 ; @param YEAR {out} 20 ; Number of the desired year. 21 ; 22 ; @param HOUR {out} 23 ; Hour of the day 24 ; 25 ; @param Minute {out} 26 ; Minute of the day 27 ; 28 ; @param Second {out} 29 ; Second (and fractions) of the day. 30 ; 31 ; @keyword NDAYSPM {default=30} 32 ; for using a calendar with fixed number of days per months. 28 33 ; 29 34 ; @uses cm_4cal 30 35 ; 31 ; 32 ; @restrictions Accuracy using IEEE double precision numbers is approximately 33 ; 1/10000th of a second. 34 ; 35 ; @history Translated from "Numerical Recipies in C", by William H. Press, 36 ; Brian P. Flannery, Saul A. Teukolsky, and William T. Vetterling. 37 ; Cambridge University Press, 1988 (second printing). 38 ; 39 ; DMS, July 1992. 40 ; DMS, April 1996, Added HOUR, MINUTE and SECOND keyword 41 ; AB, 7 December 1997, Generalized to handle array input. 42 ; 43 ; Eric Guilyardi, June 1999 44 ; Added key_work ndayspm for fixed number of days per months 45 ; 46 ; AB, 3 January 2000, Make seconds output as DOUBLE in array output. 36 ; @restrictions 37 ; Accuracy using IEEE double precision numbers is approximately 1/10000th of a 38 ; second. 39 ; 40 ; @history 41 ; Translated from "Numerical Recipes in C", by William H. Press, 42 ; Brian P. Flannery, Saul A. Teukolsky, and William T. Vetterling. 43 ; Cambridge University Press, 1988 (second printing). 44 ; 45 ; DMS, July 1992. 46 ; DMS, April 1996, Added HOUR, MINUTE and SECOND keyword 47 ; AB, 7 December 1997, Generalized to handle array input. 48 ; 49 ; Eric Guilyardi, June 1999 50 ; Added key_work ndayspm for fixed number of days per months 51 ; 52 ; AB, 3 January 2000, Make seconds output as DOUBLE in array output. 47 53 ; 48 54 ; @version $Id$ -
trunk/SRC/Calendar/date2jul.pro
r134 r136 5 5 ; 6 6 ; @file_comments 7 ; gives julian day equivalent of a date in yyyymmdd format7 ; gives Julian day equivalent of a date in yyyymmdd format 8 8 ; 9 9 ; @categories calendar 10 10 ; 11 ; @param date {in}{required} date in yyyymmdd format 11 ; @param date {in}{required} 12 ; date in yyyymmdd format 12 13 ; 13 14 ; @keyword GRADS {in}{optional} … … 15 16 ; if 50 <= year <= 99 --> year = 1900 + year 16 17 ; 17 ; @returns date in julian day 18 ; @returns 19 ; date in Julian day 18 20 ; 19 21 ; @examples -
trunk/SRC/Calendar/date2string.pro
r134 r136 9 9 ; @categories calendar, string 10 10 ; 11 ; @param yyyymmdd {in}{required} the date in the format yyyymmdd 11 ; @param yyyymmdd {in}{required} 12 ; the date in the format yyyymmdd 12 13 ; 13 ; @file_comments keyword parameters of string function to specify the format of the month (the C format) can be used 14 ; @file_comments 15 ; keyword parameters of string function to specify the format of 16 ; the month (the C format) can be used 14 17 ; 15 ; @keyword _EXTRA used to pass your keywords to the created procedure. 18 ; @keyword _EXTRA 19 ; used to pass your keywords to the created procedure. 16 20 ; 17 ; @returns a string containing the date in a easy readable format 21 ; @returns 22 ; a string containing the date in a easy readable format 18 23 ; 19 24 ; @examples -
trunk/SRC/Calendar/daysinmonth.pro
r134 r136 15 15 ; If not provided, we take month and year from "time" common variable. 16 16 ; 17 ; @returns number of days in a month or -1 in case of error 17 ; @returns 18 ; number of days in a month or -1 in case of error 18 19 ; 19 20 ; @uses cm_4cal … … 23 24 ; 24 25 ; @history Sebastien Masson (smasson\@lodyc.jussieu.fr) 25 ; 26 ; 2/7/98 26 27 ; update/review/english/new commons: June 2005 Sebastien Masson. 27 28 ; -
trunk/SRC/Calendar/jul2date.pro
r134 r136 5 5 ; 6 6 ; @file_comments 7 ; gives yyyymmdd date equivalent of a julian day7 ; gives yyyymmdd date equivalent of a Julian day 8 8 ; 9 9 ; @categories calendar 10 10 ; 11 ; @param jday {in}{required} julian day 11 ; @param jday {in}{required} 12 ; Julian day 12 13 ; 13 ; @returns date in yyyymmdd format 14 ; @returns 15 ; date in yyyymmdd format 14 16 ; 15 17 ; @examples -
trunk/SRC/Calendar/julday.pro
r134 r136 2 2 ; 3 3 ; @file_comments 4 ; 5 ; 6 ; 4 ; Calculate the Julian Day Number for a given month, day, and year. 5 ; This is the inverse of the library function CALDAT. 6 ; See also caldat, the inverse of this function. 7 7 ; 8 8 ; @categories Calendar 9 9 ; 10 ; @param MONTH {in}{required} Number of the desired month (1 = January, ..., 12 = December). Can be scalar or array 11 ; 12 ; @param DAY {in}{required} Number of day of the month.Can be scalar or array 13 ; 14 ; @param YEAR {in}{required} Number of the desired year.Year parameters must be valid 15 ; values from the civil calendar. Years B.C.E. are represented 16 ; as negative integers. Years in the common era are represented 17 ; as positive integers. In particular, note that there is no 18 ; year 0 in the civil calendar. 1 B.C.E. (-1) is followed by 19 ; 1 C.E. (1). Can be scalar or array 20 ; 21 ; @param HOUR {in}{optional} Number of the hour of the day. Can be scalar or array 22 ; 23 ; @param MINUTE {in}{optional} Number of the minute of the hour. Can be scalar or array 24 ; 25 ; @param SECOND {in}{optional} Number of the second of the minute. Can be scalar or array 26 ; 27 ; @restrictions The Result will have the same dimensions as the smallest array, or 28 ; will be a scalar if all arguments are scalars. 10 ; @param MONTH {in}{required} 11 ; Number of the desired month (1 = January, ..., 12 = December). 12 ; Can be scalar or array 13 ; 14 ; @param DAY {in}{required} 15 ; Number of day of the month.Can be scalar or array 16 ; 17 ; @param YEARin {in}{required} 18 ; Number of the desired year. Year parameters must be valid 19 ; values from the civil calendar. Years B.C.E. are represented 20 ; as negative integers. Years in the common era are represented 21 ; as positive integers. In particular, note that there is no 22 ; year 0 in the civil calendar. 1 B.C.E. (-1) is followed by 23 ; 1 C.E. (1). Can be scalar or array 24 ; 25 ; @param HOUR {in}{optional} 26 ; Number of the hour of the day. Can be scalar or array 27 ; 28 ; @param MINUTE {in}{optional} 29 ; Number of the minute of the hour. Can be scalar or array 30 ; 31 ; @param SECOND {in}{optional} 32 ; Number of the second of the minute. Can be scalar or array 33 ; 34 ; @restrictions 35 ; The Result will have the same dimensions as the smallest array, or 36 ; will be a scalar if all arguments are scalars. 29 37 ; 30 ; 31 ; @keywords NDAYSPM {default=30} for using a calendar with fixed number of days per32 ; months.33 ; 34 ; @ returns JULDAY: the Julian Day Number (which begins at noon) of the35 ; specified calendar date. If Hour, Minute, and Second are not specified,36 ; then the result will be a long integer, otherwise the result is a37 ; double precision floating pointnumber.38 ; @keyword NDAYSPM {default=30} 39 ; for using a calendar with fixed number of days per months. 40 ; 41 ; @returns 42 ; the Julian Day Number (which begins at noon) of the specified calendar date. 43 ; If Hour, Minute, and Second are not specified, then the result will be a 44 ; long integer, otherwise the result is a double precision floating point 45 ; number. 38 46 ; 39 47 ; @uses cm_4cal 40 48 ; 41 ; @restrictions Accuracy using IEEE double precision numbers is approximately 42 ; 1/10000th of a second, with higher accuracy for smaller (earlier) 43 ; Julian dates. 44 ; 45 ; @history Translated from "Numerical Recipies in C", by William H. Press, 46 ; Brian P. Flannery, Saul A. Teukolsky, and William T. Vetterling. 47 ; Cambridge University Press, 1988 (second printing). 48 ; 49 ; AB, September, 1988 50 ; DMS, April, 1995, Added time of day. 51 ; 52 ; Eric Guilyardi, June 1999 53 ; Added key_work ndayspm for fixed number of days per months 54 ; + change to accept year 0 55 ; 56 ; Sebastien Masson, Aug. 2003 57 ; fix bug for negative and large values of month values 58 ; eg. julday(349,1,1970) 59 ; 60 ; CT, April 2000, Now accepts vectors or scalars. 49 ; @restrictions 50 ; Accuracy using IEEE double precision numbers is approximately 51 ; 1/10000th of a second, with higher accuracy for smaller (earlier) 52 ; Julian dates. 53 ; 54 ; @history Translated from "Numerical Recipes in C", by William H. Press, 55 ; Brian P. Flannery, Saul A. Teukolsky, and William T. Vetterling. 56 ; Cambridge University Press, 1988 (second printing). 57 ; 58 ; AB, September, 1988 59 ; DMS, April, 1995, Added time of day. 60 ; 61 ; Eric Guilyardi, June 1999 62 ; Added keyword ndayspm for fixed number of days per months 63 ; + change to accept year 0 64 ; 65 ; Sebastien Masson, Aug. 2003 66 ; fix bug for negative and large values of month values 67 ; eg. julday(349,1,1970) 68 ; 69 ; CT, April 2000, Now accepts vectors or scalars. 61 70 ; 62 71 ; @version $Id$ … … 84 93 85 94 86 ; Gregorian Cal ander was adopted on Oct. 15, 158295 ; Gregorian Calender was adopted on Oct. 15, 1582 87 96 ; skipping from Oct. 4, 1582 to Oct. 15, 1582 88 97 GREG = 2299171L ; incorrect Julian day for Oct. 25, 1582 … … 151 160 ; change to accept year 0 152 161 ; if (MAX(L_YEAR eq 0) NE 0) then message, $ 153 ; 162 ; 'There is no year zero in the civil calendar.' 154 163 ; 155 164 ; by seb Aug 2003 … … 177 186 JUL = floor(365.25d * JY) + floor(30.6001d*TEMPORARY(JM)) + L_DAY + 1720995L 178 187 179 ; Test whether to change to Gregorian Cal andar.188 ; Test whether to change to Gregorian Calendar. 180 189 IF (MIN(JUL) GE GREG) THEN BEGIN ; change all dates 181 190 JA = long(0.01d * TEMPORARY(JY)) … … 197 206 eps = (MACHAR(/DOUBLE)).eps 198 207 eps = eps*ABS(jul) > eps 199 ; For Hours, divide by 24, then subtract 0.5, in case we have unsigned int s.208 ; For Hours, divide by 24, then subtract 0.5, in case we have unsigned integers. 200 209 jul = TEMPORARY(JUL) + ( (TEMPORARY(d_Hour)/24d - 0.5d) + $ 201 210 TEMPORARY(d_Minute)/1440d + TEMPORARY(d_Second)/86400d + eps ) -
trunk/SRC/Calendar/leapyr.pro
r134 r136 9 9 ; @categories calendar 10 10 ; 11 ; @param year {in}{required} year to be tested as a leap year 11 ; @param year {in}{required} 12 ; year to be tested as a leap year 12 13 ; 13 ; @returns 0 then not a leap year14 ; 14 ; @returns 15 ; 0 then not a leap year, 1 then year is a leap year 15 16 ; 16 17 ; @uses cm_4cal … … 32 33 ; This means that year 1800, 1900, 2100, 2200, 2300 and 2500 are 33 34 ; NOT leap years, while year 2000 and 2400 are leap years. 34 ; + sup ress the automatic change 89 -> 198935 ; + suppress the automatic change 89 -> 1989 35 36 ; 36 37 ; June 2005 update for new commons, Sebastien Masson. -
trunk/SRC/Calendar/monthname.pro
r134 r136 9 9 ; @categories calendar 10 10 ; 11 ; @param mm1 {in}{required} the month number (from 1 to 12) 11 ; @param mm1 {in}{required} 12 ; the month number (from 1 to 12) 12 13 ; 13 ; @keyword _EXTRA used to pass your keywords to the created procedure. 14 ; @keyword _EXTRA 15 ; used to pass your keywords to the created procedure. 14 16 ; 15 ; @file_comments keyword parameters of string function to specify the format of the month (the C format) can be used. 17 ; @file_comments 18 ; keyword parameters of string function to specify the format of the 19 ; month (the C format) can be used. 16 20 ; 17 ; @returns the month's name 21 ; @returns 22 ; the month's name 18 23 ; 19 24 ; @examples
Note: See TracChangeset
for help on using the changeset viewer.