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
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'
- grid_hdr_fmt = 'ffiffffiiiiifff'
- id_fmt = 'i10i'
- id_size = 44
- nstk_hdr_fmt = 'ii'
- padded_nstk_hdr_size = 16
- padded_time_hdr_size = 24
- 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
- spc_fmt = '10i'
- stk_hdr_fmt = 'ffffff'
- stkprops = ['XSTK', 'YSTK', 'HSTK', 'DSTK', 'TSTK', 'VSTK']
- stktimeprops = ['KCELL', 'FLOW', 'PLMHT']
- time_hdr_fmt = 'ifif'