Changeset 457


Ignore:
Timestamp:
04/12/11 09:44:35 (13 years ago)
Author:
smasson
Message:

add allrecords keyword in read_ncdf.pro

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/SRC/ToBeReviewed/LECTURE/read_ncdf.pro

    r399 r457  
    3838; missing values 
    3939; 
     40; @keyword ALLRECORDS 
     41; activate to read all records in a file (no need to specify any 
     42; parameter other than NAME) 
     43; 
    4044; @keyword BOXZOOM 
    4145; Contain the boxzoom on which we have to do the reading 
     
    109113;- 
    110114FUNCTION read_ncdf, name, beginning, ending, compatibility $ 
    111                     , BOXZOOM = boxzoom, FILENAME = filename $ 
     115                    , ALLRECORDS = allrecords, BOXZOOM = boxzoom, FILENAME = filename $ 
    112116                    , PARENTIN = parentin, TIMESTEP = timestep $ 
    113117                    , ADDSCL_BEFORE = addscl_before $ 
     
    176180; check the time axis and the debut and ending dates 
    177181;------------------------------------------------------------ 
    178   IF n_elements(beginning) EQ 0 THEN BEGIN 
     182  IF n_elements(beginning) EQ 0 AND NOT keyword_set(allrecords) THEN BEGIN 
    179183    beginning = 0L 
    180184    timestep = 1L 
     
    199203      lasttps = (where(abs(time - date2) LT 0.9d/86400.d))[0] 
    200204      jpt = lasttps-firsttps+1 
     205    END 
     206    keyword_set(allrecords):BEGIN 
     207      time = ncdf_gettime(filename, cdfid, caller = 'read_ncdf', err = err, _extra = ex) 
     208      IF time[0] LT 0 then BEGIN  
     209        jpt = -time[0] 
     210        time = julday(1, 1, 1) + lindgen(jpt) 
     211      ENDIF 
     212      firsttps = 0 
     213      lasttps = jpt -1 
    201214    END 
    202215    ELSE:BEGIN 
Note: See TracChangeset for help on using the changeset viewer.