Changeset 130 for trunk/SRC/ReadWrite/read_grads.pro
- Timestamp:
- 07/06/06 16:48:41 (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/SRC/ReadWrite/read_grads.pro
- Property svn:executable deleted
- Property svn:keywords set to Id
r121 r130 3 3 ;------------------------------------------------------------ 4 4 ;+ 5 ; @file_comments reading grads file (except "data type station" or "grib") 5 ; @file_comments 6 ; reading grads file (except "data type station" or "grib") 6 7 ; from the grads control file even if there is multiple data files. 7 8 ; 8 9 ; @categories reading function 9 10 ; 10 ; @param var {in}{required} the variable name 11 ; @param date1 {in}{required} date of the beginning (yyyymmdd if TIMESTEP is not activate) 12 ; @param date2 {in}{optional} last date. Optionnal, if not scpecified date2=date1 13 ; 14 ; @keyword FILENAME the grads control file name: 'xxxx.ctl' 15 ; 16 ; @file_comments keyword GLAMBOUNDARY (via computegrid.pro) a 2 elements vector, 17 ; {lon1,lon2], giving the longitude boundaries that should be 18 ; used to visualize the data. 11 ; @param var {in}{required} 12 ; the variable name 13 ; 14 ; @param date1 {in}{required} 15 ; date of the beginning (yyyymmdd if TIMESTEP is not activate) 16 ; 17 ; @param date2 {in}{optional} 18 ; last date. Optionnal, if not scpecified date2=date1 19 ; 20 ; @keyword FILENAME 21 ; the grads control file name: 'xxxx.ctl' 22 ; 23 ; @file_comments 24 ; keyword GLAMBOUNDARY (via computegrid.pro) a 2 elements vector, 25 ; {lon1,lon2], giving the longitude boundaries that should be 26 ; used to visualize the data. 19 27 ; lon2 > lon1 20 28 ; lon2 - lon1 eq 360 21 ; key_shift will be automatically defined according to 22 ; GLAMBOUNDARY. 23 ; 24 ; @keyword /TIMESTEP to specify that the dates are time steps instead of 25 ; true calendar. 26 ; 27 ; @file_comments keyword IODIRECTORY a string giving the name of iodirectory (see 28 ; isafile.pro for all possibilities). default value is common 29 ; variable iodir 29 ; key_shift will be automatically defined according to GLAMBOUNDARY. 30 ; 31 ; @keyword TIMESTEP 32 ; to specify that the dates are time steps instead of true calendar. 30 33 ; 31 34 ; @file_comments 35 ; keyword IODIRECTORY 36 ; a string giving the name of iodirectory 37 ; (see isafile.pro for all possibilities). 38 ; default value is common variable iodir 39 ; 40 ; @todo 32 41 ;--------------- 33 42 ; NOT yet available 34 43 ;--------------- 35 44 ; 36 ; @hidden BOX a 4 or 6 elements 1d array, [lon1,lon2,lat1,lat2, depth1,45 ; BOX a 4 or 6 elements 1d array, [lon1,lon2,lat1,lat2, depth1, 37 46 ; depth2], that specifies the area where data must be read 38 47 ; 39 ; @hidden EVERYTHING 40 ; 41 ; @hidden NOSTRUCTURE 42 ; 43 ; @returns an array 48 ; EVERYTHING 49 ; 50 ; NOSTRUCTURE 51 ; 52 ; @returns 53 ; an array 44 54 ; 45 55 ; @uses common 46 56 ; 47 ; @restriction define all the grid parameters (defined in common.pro) 57 ; @restriction 58 ; define all the grid parameters (defined in common.pro) 48 59 ; associated to the data. 49 60 ; 50 ; @restrictions this function call the procedure scanfile that use the 51 ; unix commands grep and sed 61 ; @restrictions 62 ; this function call the procedure scanfile that use the 63 ; unix commands grep and sed 52 64 ; 53 65 ; @examples 54 ; 55 ; 66 ; IDL> a=read_grads('sst',19900101,19900131,filename='outputs.ctl') 67 ; IDL> plt, a 56 68 ; 57 69 ; @history Sebastien Masson (smasson\@lodyc.jussieu.fr) 70 ; 71 ; @version $Id$ 58 72 ; 59 73 ;- … … 211 225 'float':a=assoc(unit,fltarr(jpi,jpj,/nozero), offset+4*f77sequential) 212 226 endcase 213 res[*, *, i+alreadyread]=a[0] 227 res[*, *, i+alreadyread]=a[0] 214 228 ENDIF ELSE BEGIN ; more than 1 level to be read 215 229 if f77sequential then BEGIN ; sequential access … … 238 252 'float':a=assoc(unit,fltarr(jpi,jpj,varslev[varid],/nozero),offset) 239 253 endcase 240 if keyword_set(key_zreverse) then res[*, *, *, i+alreadyread]=reverse(a[0], 3) ELSE res[*, *, *, i+alreadyread]=a[0] 254 if keyword_set(key_zreverse) then res[*, *, *, i+alreadyread]=reverse(a[0], 3) ELSE res[*, *, *, i+alreadyread]=a[0] 241 255 ENDELSE 242 256 ENDELSE
Note: See TracChangeset
for help on using the changeset viewer.