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'
getArray(krange=slice(1, None, None))[source]
items()[source]
keys()[source]
read()[source]

provide direct access to the underlying RecordFile read method

read_into(dest)[source]

put values from rffile read into dest dest - numpy or numeric array

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

seekandread(date=None, time=None, k=1, duv=1)[source]

see seek and read

seekandreadinto(dest, date=None, time=None, k=1, duv=1)[source]

see seek and read_into

time_hdr_fmts = {8: 'fi', 12: 'fii'}
timerange()[source]
values()[source]

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

Module contents

wind – Wind File Interfaces