PseudoNetCDF.camxfiles.wind package
Submodules
PseudoNetCDF.camxfiles.wind.Memmap module
Memmap
– wind Memmap interface
- class PseudoNetCDF.camxfiles.wind.Memmap.wind(*args, **kwds)[source]
Bases:
PseudoNetCDFFile
wind provides a PseudoNetCDF interface for CAMx wind files. Where possible, the inteface follows IOAPI conventions (see www.baronams.com).
- ex:
>>> wind_path = 'camx_wind.bin' >>> rows,cols = 65,83 >>> windfile = wind(wind_path,rows,cols) >>> windfile.variables.keys() ['TFLAG', 'U', 'V'] >>> v = windfile.variables['V'] >>> tflag = windfile.variables['TFLAG'] >>> tflag.dimensions ('TSTEP', 'VAR', 'DATE-TIME') >>> tflag[0,0,:] array([2005185, 0]) >>> tflag[-1,0,:] array([2005185, 240000]) >>> v.dimensions ('TSTEP', 'LAY', 'ROW', 'COL') >>> v.shape (25, 28, 65, 83) >>> windfile.dimensions {'TSTEP': 25, 'LAY': 28, 'ROW': 65, 'COL': 83}
PseudoNetCDF.camxfiles.wind.Read module
Read
– wind Read interface
- class PseudoNetCDF.camxfiles.wind.Read.wind(*args, **kwds)[source]
Bases:
PseudoNetCDFFile
wind provides a PseudoNetCDF interface for CAMx wind files. Where possible, the inteface follows IOAPI conventions (see www.baronams.com).
- ex:
>>> wind_path = 'camx_wind.bin' >>> rows,cols = 65,83 >>> windfile = wind(wind_path,rows,cols) >>> windfile.variables.keys() ['TFLAG', 'U', 'V'] >>> v = windfile.variables['V'] >>> tflag = windfile.variables['TFLAG'] >>> tflag.dimensions ('TSTEP', 'VAR', 'DATE-TIME') >>> tflag[0,0,:] array([2005185, 0]) >>> tflag[-1,0,:] array([2005185, 240000]) >>> v.dimensions ('TSTEP', 'LAY', 'ROW', 'COL') >>> v.shape (25, 28, 65, 83) >>> windfile.dimensions {'TSTEP': 25, 'LAY': 28, 'ROW': 65, 'COL': 83}
Initialization included reading the header and learning about the format.
see __readheader and __gettimestep() for more info
- data_fmt = 'f'
- seek(date=None, time=None, k=1, uv=1)[source]
Move file cursor to beginning of specified record see __recordposition for a definition of variables
- time_hdr_fmts = {8: 'fi', 12: 'fii'}
PseudoNetCDF.camxfiles.wind.Transforms module
Write
– CAMx wind variable transformations
- class PseudoNetCDF.camxfiles.wind.Transforms.wind_center_time_cell(*args, **kwds)[source]
Bases:
PseudoNetCDFFile
CAMx Files
PseudoNetCDF.camxfiles.wind.Write module
Write
– CAMx wind writer
- PseudoNetCDF.camxfiles.wind.Write.write_wind(sdate, stime, time_step, vals, lstagger=None)[source]
Takes an iterable and some defining information and creates a CAMx read wind file
sdate - integer start date stime - float start time time_step - float increment between times
vals - array axes time,uv,xy,z