PseudoNetCDF.camxfiles.point_source package

Submodules

PseudoNetCDF.camxfiles.point_source.Memmap module

Memmap – point_source Memmap interface

class PseudoNetCDF.camxfiles.point_source.Memmap.point_source(*args, **kwds)[source]

Bases: PseudoNetCDFFile

point_source provides a PseudoNetCDF interface for CAMx point_source files. Where possible, the inteface follows IOAPI conventions (see www.baronams.com).

ex:
>>> point_source_path = 'camx_point_source.bin'
>>> rows,cols = 65,83
>>> point_sourcefile = point_source(point_source_path,rows,cols)
>>> point_sourcefile.variables.keys()
['TFLAG', 'ETFLAG', 'TFLAG', 'XSTK', 'YSTK', 'HSTK', 'DSTK', 'TSTK',
 'VSTK', 'KCELL', 'FLOW', 'PLMHT', 'NSTKS', 'NO', 'NO2', ...]
>>> tflag = point_sourcefile.variables['TFLAG']
>>> tflag.dimensions
('TSTEP', 'VAR', 'DATE-TIME')
>>> tflag[0,0,:]
array([2005185,       0])
>>> tflag[-1,0,:]
array([2005185,  240000])
>>> v = point_sourcefile.variables['XSTK']
>>> v.dimensions
('NSTK',)
>>> v.shape
(38452,)
>>> v = point_sourcefile.variables['NO2']
>>> v.dimensions
('TSTEP', 'NSTK')
>>> v.shape
(25, 38452)
>>> point_sourcefile.dimensions
{'TSTEP': 25, 'NSTK': 38452}

Initialization included reading the header and learning about the format.

see __readheader and __gettimestep() for more info

classmethod isMine(path)[source]

True if this file or object can be identified for use by this class. Useful to override for classes that can be initialized from disk.

PseudoNetCDF.camxfiles.point_source.Read module

Read – point_source Read interface

class PseudoNetCDF.camxfiles.point_source.Read.point_source(*args, **kwds)[source]

Bases: PseudoNetCDFFile

point_source provides a PseudoNetCDF interface for CAMx point_source files. Where possible, the inteface follows IOAPI conventions (see www.baronams.com).

ex:
>>> point_source_path = 'camx_point_source.bin'
>>> rows,cols = 65,83
>>> point_sourcefile = point_source(point_source_path,rows,cols)
>>> point_sourcefile.variables.keys()
['TFLAG', 'ETFLAG', 'TFLAG', 'XSTK', 'YSTK', 'HSTK', 'DSTK', 'TSTK',
 'VSTK', 'KCELL', 'FLOW', 'PLMHT', 'NSTKS', 'NO', 'NO2', ...]
>>> tflag = point_sourcefile.variables['TFLAG']
>>> tflag.dimensions
('TSTEP', 'VAR', 'DATE-TIME')
>>> tflag[0,0,:]
array([2005185,       0])
>>> tflag[-1,0,:]
array([2005185,  240000])
>>> v = point_sourcefile.variables['XSTK']
>>> v.dimensions
('NSTK',)
>>> v.shape
(38452,)
>>> v = point_sourcefile.variables['NO2']
>>> v.dimensions
('TSTEP', 'NSTK')
>>> v.shape
(25, 38452)
>>> point_sourcefile.dimensions
{'TSTEP': 25, 'NSTK': 38452}

Initialization included reading the header and learning about the format.

see __readheader and __gettimestep() for more info

cell_hdr_fmt = 'iiii'
data_fmt = 'f'
emiss_hdr_fmt = '10i60i3ifif'
getArray()[source]
grid_hdr_fmt = 'ffiffffiiiiifff'
header()[source]
id_fmt = 'i10i'
id_size = 44
items()[source]
keys()[source]
nstk_hdr_fmt = 'ii'
padded_nstk_hdr_size = 16
padded_time_hdr_size = 24
read(fmt=None)[source]

Provide direct access to record file read

read_into(dest)[source]

Transfer values from current record to dest dest - numeric or numpy array

seek(date=None, time=None, spc=-1, offset=False)[source]

Move file cursor to the beginning of the specified record see __recordposition for parameter definitions

seekandread(date=None, time=None, spc=1, offset=False, fmt=None)[source]

see seek and read

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

see seek and read_into

spc_fmt = '10i'
stk_hdr_fmt = 'ffffff'
stkprops = ['XSTK', 'YSTK', 'HSTK', 'DSTK', 'TSTK', 'VSTK']
stktimeprops = ['KCELL', 'FLOW', 'PLMHT']
time_hdr_fmt = 'ifif'
timerange()[source]
values()[source]

PseudoNetCDF.camxfiles.point_source.Write module

Write – CAMx point_source writer

PseudoNetCDF.camxfiles.point_source.Write.write_point(start_date, start_time, time_step, hdr, vals)[source]

Module contents

point_source – Point Source File Interfaces