Changeset 542
- Timestamp:
- 04/30/12 12:49:45 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/idl_amsu_netcdf.pro
r532 r542 43 43 ; ======== 44 44 ; 45 ; To produce :file:`${PROJECT_OD}/AMSU/a5_20060801_20060812_01000w2000n_00100w3000n.nc`:: 45 ; To produce 46 ; :file:`${PROJECT_OD}/AMSU/a5_20060801_20060812_01000w2000n_00100w3000n.nc`:: 46 47 ; 47 48 ; numch = 'a5' … … 52 53 ; idl_amsu_netcdf, numch , datain, lats, lons, timesin 53 54 ; 55 ; TIPS 56 ; ==== 57 ; 58 ; File produced by can be read using :func:`read_ncdf <saxo:read_ncdf>` :: 59 ; 60 ; tb=read_ncdf('moyenne_tb', 20060801, 20060802, file='/homedata/pinsard/varamma_d/AMSU/a5mrt0.5rh1.0_20060801_20060804_02400w0400s_02400e1900n.nc') 61 ; 54 62 ; SEE ALSO 55 63 ; ======== … … 65 73 ; 66 74 ; 75 ; ++ test si toutes les valeurs sont des valeurs manquantes/aberantes 76 ; si ou ne rien écrire 77 ; 78 ; improve tip 79 ; 67 80 ; check arg : time in julian days. check for noon !! 68 81 ; … … 85 98 ; 86 99 ; $URL$ 100 ; 101 ; - fplod 20120430 102 ; 103 ; * time unlimited 104 ; * time origine is a ttribute of time not of tb 105 ; * fix double vs fltarr 106 ; * fix missing value 107 ; 108 ; nb : now cdo showdate and showtime work 87 109 ; 88 110 ; - lelod 20120410 … … 134 156 ; 135 157 ;- 136 pro idl_amsu_netcdf, numch, temp, rtemp,rhdeg, datain, lats, lons, timesin158 pro idl_amsu_netcdf, numch, temp, rtemp, rhdeg, datain, lats, lons, timesin 137 159 ; 138 160 compile_opt idl2, strictarrsubs … … 149 171 rt=string(rtemp,format='(f3.1)') 150 172 rh=string(rhdeg,format='(f3.1)') 151 prefix = numch + temp + 'rt' +rt+'rh'+rh +'_'152 173 prefix = numch + temp + 'rt' + rt + 'rh' + rh + '_' 174 ; 153 175 look = 'filename' 154 176 scale = 100. … … 166 188 + '.nc' 167 189 ; 168 ; definition des tableaux qui vont contenir les valeurs des fichiers ascii 190 ; definition des tableaux qui vont contenir les valeurs à écrire 191 ; dans les fichiers NetCDF 169 192 moyenne_tb = fltarr(nblon, nblat, nbtime) 170 193 xlon = fltarr(nblon) … … 184 207 print,"nb valeurs manquantes", nnbad 185 208 ; 209 ; ++ test si toutes les valeurs sont des valeurs manquantes/aberantes 210 ; si ou ne rien écrire 211 ; 186 212 ; 187 213 ;--------------------------------------- … … 197 223 print, 'ouverture pour ecriture de ', cdfout 198 224 id = ncdf_create(cdfout,/clobber) 199 ;++ncdf_control, id, /nofill 225 ncdf_control, id, /nofill 226 ; 200 227 ; dimension 201 228 dimidx = ncdf_dimdef(id, 'xlon', nblon) 202 229 dimidy = ncdf_dimdef(id, 'ylat', nblat) 203 dimidt = ncdf_dimdef(id, 'time', nbtime)230 dimidt = ncdf_dimdef(id, 'time', /UNLIMITED) 204 231 ; 205 232 ; attributs globaux … … 209 236 creation_date = string(jul2date(SYSTIME(/JULIAN, /UTC )), format='(I8)') 210 237 ncdf_attput, id, 'Creation_date', creation_date, /GLOBAL 211 ;print, creation_date238 ;print, creation_date 212 239 ; 213 240 ; declaration des variables 214 241 varid = lonarr(4) 215 varid[0] = ncdf_vardef(id, 'xlon', [dimidx], / double)216 varid[1] = ncdf_vardef(id, 'ylat', [dimidy], / double)217 varid[2] = ncdf_vardef(id, 'time', [dimidt], / double)242 varid[0] = ncdf_vardef(id, 'xlon', [dimidx], /float) 243 varid[1] = ncdf_vardef(id, 'ylat', [dimidy], /float) 244 varid[2] = ncdf_vardef(id, 'time', [dimidt], /float) 218 245 varid[3] = ncdf_vardef(id, 'moyenne_tb',[dimidx,dimidy,dimidt], /float) 219 246 ; … … 221 248 ncdf_attput, id, varid[0], 'units', 'degrees_east' 222 249 ncdf_attput, id, varid[0], 'title', 'Longitude' 250 ; 223 251 ncdf_attput, id, varid[1], 'units', 'degrees_north' 224 252 ncdf_attput, id, varid[1], 'title', 'Latitude' 253 ; 225 254 ncdf_attput, id, varid[2], 'units', 'days since 2000-01-01 00:00:00' 226 ncdf_attput, id, varid[2], 'long_name', 'Time axis' 227 ncdf_attput, id, varid[3], 'time_origin', '2000-01-01 00:00:00' 255 ncdf_attput, id, varid[2], 'long_name', 'time' 256 ncdf_attput, id, varid[2], 'short_name', 'time' 257 ncdf_attput, id, varid[2], 'axis', 'T' 258 ncdf_attput, id, varid[2], 'time_origin', '2000-01-01 00:00:00' 259 ; 228 260 ncdf_attput, id, varid[3], 'short_name', 'amsu_tb' 229 ncdf_attput, id, varid[3], 'missing_value', '-9999.00'261 ncdf_attput, id, varid[3], 'missing_value', -9999.00 230 262 ncdf_attput, id, varid[3], 'unit', 'degree_kelvin' 231 263 ;
Note: See TracChangeset
for help on using the changeset viewer.