- Timestamp:
- Feb 26, 2015, 11:34:12 AM (10 years ago)
- Location:
- trunk/tools
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tools/nc_var.py
r192 r311 24 24 'flipdim', 'fvaradd', 'gaddattrk', 'gaddattr', 'get_namelist_vars', 'grattr', \ 25 25 'grmattr', 'igattrs', 'isgattrs', 'isvattrs', 'ivars', 'ivattrs', 'maskvar', \ 26 'ncreplace', 'n etcdf_concatenation', 'netcdf_fold_concatenation',\26 'ncreplace', 'ncstepdiff', 'netcdf_concatenation', 'netcdf_fold_concatenation', \ 27 27 'compute_opersvarsfiles', \ 28 28 'seasmean', 'sellonlatbox', 'sellonlatlevbox', 'setvar_asciivalues', \ … … 168 168 elif oper == 'ncreplace': 169 169 ncvar.ncreplace(opts.values, opts.ncfile, opts.varname) 170 elif oper == 'ncstepdiff': 171 ncvar.ncstepdiff(opts.values, opts.ncfile, opts.varname) 170 172 elif oper == 'netcdf_concatenation': 171 173 ncvar.netcdf_concatenation(opts.ncfile) -
trunk/tools/nc_var_tools.py
r310 r311 2648 2648 if not searchInlist(attvar, 'units'): 2649 2649 print warnmsg 2650 print ' cls_time_information: time variable "' , tname,\2650 print ' cls_time_information: time variable "' + tname + \ 2651 2651 '" does not have attribute: "units"' 2652 2652 units = None … … 13452 13452 return 13453 13453 13454 def ncste diffp(values, ncfile, varn):13454 def ncstepdiff(values, ncfile, varn): 13455 13455 """ Function to compute differencies between time-steps (deacumulate) a netCDF file 13456 13456 new variables labelled [varn] + 'de'will be added to the file … … 13460 13460 ncfile= netCDF file to replace something 13461 13461 varn= ',' list of variables to deaccumulate ('all' for all) 13462 ncste diffp('Time,Times', '/home/lluis/PY/wrfout_d01_2001-11-11_00:00:00.tests', 'Q2')13462 ncstepdiff('Time,Times', '/home/lluis/PY/wrfout_d01_2001-11-11_00:00:00.tests', 'Q2') 13463 13463 """ 13464 fname = 'ncste diffp'13464 fname = 'ncstepdiff' 13465 13465 13466 13466 if values == 'h': 13467 13467 print fname + '_____________________________________________________________' 13468 print ncste diffp.__doc__13468 print ncstepdiff.__doc__ 13469 13469 quit() 13470 13470 … … 13480 13480 if varn.find(',') != -1: 13481 13481 if varn != 'all': 13482 varns = varn.s lipt(',')13482 varns = varn.split(',') 13483 13483 else: 13484 13484 varns = onc.variables … … 13526 13526 else: 13527 13527 print warnmsg 13528 print ' ' + fname + ": variable '" + vn + "de' already exist !!"13529 print ' replacing values'13528 print ' ' + fname + ": variable '" + vn + "de' already exist " + \ 13529 'replacing values !!' 13530 13530 newvar = onc.variables[vn + 'de'] 13531 13531 … … 13547 13547 13548 13548 return 13549 ncstediffp('Time,Times', '/home/lluis/PY/wrfout_d01_2001-11-11_00:00:00.tests', 'Q2') 13550 quit() 13549 #ncstepdiff('Time,Times', '/home/lluis/PY/wrfout_d01_2001-11-11_00:00:00.tests', 'Q2,T2') 13551 13550 13552 13551 #quit()
Note: See TracChangeset
for help on using the changeset viewer.