Changeset 137 for trunk/SRC/Calendar


Ignore:
Timestamp:
07/12/06 11:33:44 (18 years ago)
Author:
smasson
Message:

review of Colors and Calendar routines

Location:
trunk/SRC/Calendar
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/SRC/Calendar/caldat.pro

    r136 r137  
    22; 
    33; @file_comments 
    4 ; Return the calendar date and time given Julian date. 
     4; Return the calendar date and time given julian date. 
    55; This is the inverse of the function JULDAY. 
    6 ;  
     6; 3 calendars are avalable according to the value of key_caltype  
     7; (variable of the common file cm_4cal): 'greg', '360d', 'noleap' 
     8; 
    79; @categories Calendar 
    810; 
     
    3032; 
    3133; @keyword NDAYSPM {default=30}  
    32 ; for using a calendar with fixed number of days per months. 
     34; To use a calendar with fixed number of days per months. 
     35; see also the use of key_caltype (variable of the common file cm_4cal) 
    3336; 
    3437; @uses cm_4cal 
     
    3942; 
    4043; @history  
    41 ; Translated from "Numerical Recipes in C", by William H. Press, 
     44; Translated from "Numerical Recipies in C", by William H. Press, 
    4245; Brian P. Flannery, Saul A. Teukolsky, and William T. Vetterling. 
    4346; Cambridge University Press, 1988 (second printing). 
     
    5154; 
    5255; AB, 3 January 2000, Make seconds output as DOUBLE in array output. 
     56; 
     57; Sebastien Masson, May 2006, add diferent calendat with key_caltype  
     58; (variable of the common file cm_4cal) 
    5359; 
    5460; @version $Id$ 
  • trunk/SRC/Calendar/date2jul.pro

    r136 r137  
    1212; date in yyyymmdd format 
    1313; 
    14 ; @keyword GRADS {in}{optional} 
     14; @keyword GRADS 
    1515; if  1 <= year <= 49 --> year = 2000 + year 
    1616; if 50 <= year <= 99 --> year = 1900 + year 
     
    2727;       1 
    2828; 
    29 ; @history Sebastien Masson (smasson@lodyc.jussieu.fr) 
    30 ;                       June 2005 
     29; @history  
     30; Sebastien Masson (smasson\@lodyc.jussieu.fr) June 2005 
    3131; 
    3232; @version $Id$ 
  • trunk/SRC/Calendar/date2string.pro

    r136 r137  
    1 ;------------------------------------------------------------ 
    2 ;------------------------------------------------------------ 
    31;------------------------------------------------------------ 
    42;+ 
     
    108; 
    119; @param yyyymmdd {in}{required}  
    12 ; the date in the format yyyymmdd 
    13 ; 
    14 ; @file_comments  
    15 ; keyword parameters of string function to specify the format of  
    16 ; the month (the C format) can be used 
     10; the date in the format yyyymmdd. Can be scalar or array 
    1711; 
    1812; @keyword _EXTRA  
    19 ; used to pass your keywords to the created procedure. 
     13; used to pass your keywords to other procedures, for example 
     14; keyword FORMAT of string function (see example bellow)  
    2015; 
    21 ; @returns  
    22 ; a string containing the date in a easy readable format 
     16; @returns 
     17; a string containing the date in a easy readable format with the 
     18; same number of elements than yyyymmdd. 
    2319; 
    2420; @examples 
     
    3733;- 
    3834;------------------------------------------------------------ 
    39 ;------------------------------------------------------------ 
    40 ;------------------------------------------------------------ 
    4135FUNCTION date2string, yyyymmdd, _EXTRA = ex 
    4236; 
  • trunk/SRC/Calendar/daysinmonth.pro

    r136 r137  
    99; @categories calendar 
    1010; 
    11 ; @param month {in}{optional} 
    12 ; @param year {in}{optional} 
    13 ; Year is used only if the  common variable key_caltype = 'greg'. 
    14 ; In that case, month and year must have the same number of elements. 
    15 ; If not provided, we take month and year from "time" common variable. 
     11; @param year {in}{optional}{default=from "time" common variable of cm_4cal} 
     12; To specify the year of the onth. Used only if the common variable 
     13; key_caltype = 'greg'. In that case, month and year must have the same 
     14; number of elements. 
    1615; 
    1716; @returns  
    1817; number of days in a month or -1 in case of error 
    1918; 
    20 ; @uses cm_4cal 
     19; @uses cm_4cal, updatenew 
    2120; 
    2221; @examples 
  • trunk/SRC/Calendar/jul2date.pro

    r136 r137  
    1 ;------------------------------------------------------------ 
    2 ;------------------------------------------------------------ 
    31;------------------------------------------------------------ 
    42;+ 
     
    2725;- 
    2826;------------------------------------------------------------ 
    29 ;------------------------------------------------------------ 
    30 ;------------------------------------------------------------ 
    3127function jul2date, jday 
    3228; 
  • trunk/SRC/Calendar/julday.pro

    r136 r137  
    44; Calculate the Julian Day Number for a given month, day, and year. 
    55; This is the inverse of the library function CALDAT. 
    6 ; See also caldat, the inverse of this function. 
     6; 3 calendars are avalable according to the value of key_caltype  
     7; (variable of the common file cm_4cal): 'greg', '360d', 'noleap' 
    78; 
    89; @categories Calendar 
     
    1516; Number of day of the month.Can be scalar or array 
    1617; 
    17 ; @param YEARin {in}{required}  
    18 ; Number of the desired year. Year parameters must be valid 
     18; @param YEARin {in}{required}   
     19; Number of the desired year.Year parameters must be valid 
    1920; 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 
     21; as negative integers. Years in the common era are represented 
     22; as positive integers. In particular, note that there is no 
    2223; 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}  
     24; 1 C.E. (1).  
     25; Change: However for climatological year, we do accept the year  
     26; O but we change it for year 654321L (the same trick is done in 
     27; caldat so caldat, julday(1,1,0) gives you back Jan 1st of year 0) 
     28; Can be scalar or array 
     29; 
     30; @param HOUR {in}{optional}{default=12}  
    2631; Number of the hour of the day. Can be scalar or array 
    2732; 
    28 ; @param MINUTE {in}{optional}  
     33; @param MINUTE {in}{optional}{default=0} 
    2934; Number of the minute of the hour. Can be scalar or array 
    3035; 
    31 ; @param SECOND {in}{optional}  
     36; @param SECOND {in}{optional}{default=0} 
    3237; Number of the second of the minute. Can be scalar or array 
    3338; 
     
    3742;  
    3843; @keyword NDAYSPM {default=30}  
    39 ; for using a calendar with fixed number of days per months. 
     44; To use a calendar with fixed number of days per months. 
     45; see also the use of key_caltype (variable of the common file cm_4cal) 
    4046; 
    4147; @returns  
     
    5258; Julian dates. 
    5359; 
    54 ; @history Translated from "Numerical Recipes in C", by William H. Press, 
     60; @history  
     61; Translated from "Numerical Recipies in C", by William H. Press, 
    5562; Brian P. Flannery, Saul A. Teukolsky, and William T. Vetterling. 
    5663; Cambridge University Press, 1988 (second printing). 
     
    6067; 
    6168; Eric Guilyardi, June 1999 
    62 ; Added keyword ndayspm for fixed number of days per months 
    63 ; + change to accept year 0 
     69; Added key_work ndayspm for fixed number of days per months 
     70; 
     71; CT, April 2000, Now accepts vectors or scalars. 
    6472; 
    6573; Sebastien Masson, Aug. 2003 
     
    6775; eg. julday(349,1,1970) 
    6876; 
    69 ; CT, April 2000, Now accepts vectors or scalars. 
     77; Sebastien Masson, May 2006, add diferent calendat with key_caltype  
     78; (variable of the common file cm_4cal) 
    7079; 
    7180; @version $Id$ 
  • trunk/SRC/Calendar/leapyr.pro

    r136 r137  
    1010; 
    1111; @param year {in}{required}  
    12 ; year to be tested as a leap year 
     12; year to be tested as a leap year. Can be scalar or array 
    1313; 
    1414; @returns  
    1515; 0 then not a leap year, 1 then year is a leap year 
     16; with the same number of elements than year. 
    1617; 
    1718; @uses cm_4cal 
     
    2526;20/09/88 
    2627; 
    27 ;       November 2004: correction for century years... S. Masson; 
     28; November 2004: correction for century years... S. Masson; 
    2829; 
    29 ;       Every year divisible by 4 is a leap year. 
    30 ;       But every year divisible by 100 is NOT a leap year 
    31 ;       Unless the year is also divisible by 400, then it is still a 
    32 ;       leap year. 
    33 ;       This means that year 1800, 1900, 2100, 2200, 2300 and 2500 are 
    34 ;       NOT leap years, while year 2000 and 2400 are leap years. 
    35 ;       + suppress the automatic change 89 -> 1989 
     30; Every year divisible by 4 is a leap year. 
     31; But every year divisible by 100 is NOT a leap year 
     32; Unless the year is also divisible by 400, then it is still a 
     33; leap year. 
     34; This means that year 1800, 1900, 2100, 2200, 2300 and 2500 are 
     35; NOT leap years, while year 2000 and 2400 are leap years. 
     36; + supress the automatic change 89 -> 1989 
    3637; 
    37 ;       June 2005 update for new commons, Sebastien Masson. 
    38 ; 
     38; June 2005 update for new commons, Sebastien Masson. 
    3939; 
    4040; @version $Id$ 
  • trunk/SRC/Calendar/monthname.pro

    r136 r137  
    1 ;------------------------------------------------------------ 
    2 ;------------------------------------------------------------ 
    31;------------------------------------------------------------ 
    42;+ 
     
    75; gives the name of a month 
    86; 
    9 ; @categories calendar 
     7; @categories calendar, string 
    108; 
    11 ; @param mm1 {in}{required} 
    12 ; the month number (from 1 to 12) 
     9; @param month {in}{required}  
     10; the month number (from 1 to 12). Can be scalar or array 
    1311; 
    14 ; @keyword _EXTRA  
    15 ; used to pass your keywords to the created procedure. 
     12; @keyword _EXTRA 
     13; used to pass your keywords to other procedures, for example 
     14; keyword FORMAT of string function (see example bellow)  
    1615; 
    17 ; @file_comments  
    18 ; keyword parameters of string function to specify the format of the  
    19 ; month (the C format) can be used. 
    20 ; 
    21 ; @returns  
    22 ; the month's name 
     16; @returns 
     17; the month names, a string with the same number of elements than month. 
    2318; 
    2419; @examples 
     
    3227;- 
    3328;------------------------------------------------------------ 
    34 ;------------------------------------------------------------ 
    35 ;------------------------------------------------------------ 
    36 FUNCTION monthname,  mm1, _EXTRA = ex 
     29FUNCTION monthname, month, _EXTRA = ex 
    3730; 
    3831  compile_opt idl2, strictarrsubs 
    3932; 
    40    return, string(format='(C(CMoA0))',31*(mm1-1), _EXTRA = ex) 
     33   return, string(format='(C(CMoA0))',31*(month-1), _EXTRA = ex) 
    4134end 
Note: See TracChangeset for help on using the changeset viewer.