Changeset 226 for trunk/SRC/ReadWrite/idl-NetCDF
- Timestamp:
- 03/16/07 10:22:26 (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/SRC/ReadWrite/idl-NetCDF/ncdf_quickread/ncdf_quickread_helper.pro
r163 r226 1 1 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 2 2 ; 3 ; ncdf_quickread_helper.pro - This file contains IDL functions to read netCDF 4 ; data files into IDL variables. 3 ; ncdf_quickread_helper.pro - This file contains IDL functions to read netCDF 4 ; data files into IDL variables. 5 5 ; 6 6 ; Adapted from CDF2IDL.pro … … 8 8 ; This file contains the following functions and procedures: 9 9 ; functions: 10 ; ncdf_quickread_getfile - strips the directory and optionally) any 10 ; ncdf_quickread_getfile - strips the directory and optionally) any 11 11 ; suffixes from the path+file 12 12 ; ncdf_quickread_getdir - returns the directory from the full path+file … … 25 25 ; 10 Jun 97 S. Rupert Modified keyword usage. 26 26 ; 03 Feb 98 S. Rupert Added additional error checking, and warning to 27 ; output script. 27 ; output script. 28 28 ; 17 Feb 98 S. Rupert Corrected validation routine to handle instance 29 29 ; of name strating with a number and containing a … … 58 58 ; @examples 59 59 ; Call: file = ncdf_quickread_getfile(fullpath) 60 ; 60 ; 61 61 ; @history 62 62 ; … … 68 68 on_error,2 69 69 compile_opt hidden 70 ; Retrieve the pos tion at which the first '/' character occurs from70 ; Retrieve the position at which the first '/' character occurs from 71 71 ; the end of the string. 72 72 dirlen = rstrpos(fullpath, '/') … … 111 111 ; @examples 112 112 ; Call: dir = ncdf_quickread_getdir(fullpath) 113 ; 113 ; 114 114 ; @history 115 115 ; … … 122 122 on_error,2 123 123 compile_opt hidden 124 ; Retrieve the pos tion at which the first '/' character occurs from124 ; Retrieve the position at which the first '/' character occurs from 125 125 ; the end of the string. 126 126 len = rstrpos(fullpath, '/') … … 139 139 ; @file_comments 140 140 ; This routine ensures that the given name does not start with a number, 141 ; nor contain a dash. IDL cannot accept a variable starting with a 142 ; number or containing a dash. If the name starts with a number, an 143 ; underscore is prepended to the name, and if it contains a dash, the 144 ; dash is replaced with an underscore. 141 ; nor contain a dash. IDL cannot accept a variable starting with a 142 ; number or containing a dash. If the name starts with a number, an 143 ; underscore is prepended to the name, and if it contains a dash, the 144 ; dash is replaced with an underscore. 145 145 ; 146 146 ; @categories … … 149 149 ; @param VARNAME 150 150 ; The name of the variable to be read 151 ; 151 ; 152 152 ; 153 153 ; @returns … … 158 158 ; 159 159 ; @examples 160 ; 161 ; 160 ; 161 ; 162 162 ; @history 163 163 ; … … 186 186 if (strpos(varname, '9') EQ 0) then name = strcompress("_"+varname) 187 187 188 ; If the name contains a dash replace it with an underscore. 188 ; If the name contains a dash replace it with an underscore. 189 189 if (strpos(name, '-') NE -1) then begin 190 190 pieces = str_sep(name, '-') … … 214 214 ; full path to netCDF file of interest 215 215 ; 216 ; @keyword VERBOSE 216 ; @keyword VERBOSE 217 217 ; Set this keyword to return an error message in case of an error. 218 218 ; … … 224 224 ; 225 225 ; @keyword REFORM 226 ; see changelog above .226 ; see changelog above 227 227 ; 228 228 ; @returns … … 233 233 ; 234 234 ; @examples 235 ; 236 ; 235 ; 236 ; 237 237 ; @history 238 238 ; … … 274 274 275 275 ; Place the desired variables in local arrays. 276 for i=0, ncidinfo.Nvars-1 do begin 276 for i=0, ncidinfo.Nvars-1 do begin 277 277 vardata = NCDF_VARINQ(ncid, i) 278 278 if not subset then begin … … 283 283 endelse 284 284 if wanted then begin 285 varname = ncdf_quickread_validatename(vardata.Name) 285 varname = ncdf_quickread_validatename(vardata.Name) 286 286 if keyword_set(prefix) then varname=prefix+varname 287 287 commands=$ … … 304 304 endfor 305 305 306 if (keyword_set(verbose)) then begin 306 if (keyword_set(verbose)) then begin 307 307 for i=0, ncidinfo.Ngatts-1 do begin 308 308 name = NCDF_ATTNAME(ncid, /GLOBAL, i)
Note: See TracChangeset
for help on using the changeset viewer.