Module Listing¶
PseudoNetCDF provides basic interfaces for emulating NetCDF and manipulating or extending existing NetCDF like files
-
PseudoNetCDF.
PNC
(*args, **kwds)[source]¶ - Parameters
- Command Line arguments/options for PseudoNetCDF (args) – for full list of potential args PNC(‘–help’)
- (ifiles) –
- (default (actions) –
False) False: only open files do not make outputs True: enable dump,gen,map,etc output actions
for action options see subparsers help e.g., PNC(‘dump’, ‘–help’, actions = True)
- Returns
- out - Namespace object with parsed arguments
including a list of processed files (out.ifiles)
Example
# Single File out = PNC(‘–format=netcdf’, inpath) infile = out.ifiles[0] O3 = infile.variables[‘O3’]
# Multiple Files out = PNC(‘–format=netcdf’, inpath1, inpath2) infile1, infile2 = out.ifiles O3_1 = infile1.variables[‘O3’] O3_2 = infile2.variables[‘O3’]
# With Actions out = PNC(‘dump’, ‘–variables=O3’, ‘–format=netcdf’, inpath)
netcdf icartt/dc3-mrg60-dc8_merge_20120518_R7_thru20120622.nc { dimensions:
POINTS = 6817 ;
- variables:
- double O3(TSTEP, LAY, ROW, COL);
O3_ESRL:units = “ppbV” ; O3_ESRL:standard_name = “Ozone” ; O3_ESRL:missing_value = -999999 ;
…
-
class
PseudoNetCDF.
Pseudo2NetCDF
(datafirst=False, verbose=1)[source]¶ Pseudo2NetCDF is a base class for conversion. Properties and methods can be overwritten to facilitate conversion of special PseudoNetCDFFiles.
Specifically: ignore_global_properties and ignore_variable_properties lists can be overwritten so that class properties and methods are not written to a netCDF file
-
re
= <module 're' from '/home/docs/checkouts/readthedocs.org/user_builds/pseudonetcdf/conda/latest/lib/python3.6/re.py'>¶
-
-
PseudoNetCDF.
PseudoIOAPIVariable
(parent, name, typecode, dimensions, **kwds)[source]¶ Creates a variable using the dimensions as defined in the parent object
- Parameters
parent (PseudoNetCDFFile) – an object with a dimensions variable
name (string) – name for variable
typecode (string or numpy.dtype) – numpy style typecode
dimensions (tuple of strings) – dimension names to be used from parent
**kwds (dictionary) – units: default = none long_name: default = name var_desc: default = name
-
class
PseudoNetCDF.
PseudoNetCDFDimension
(group, name, size)[source]¶ Dimension object responds like that of netcdf4-python
-
class
PseudoNetCDF.
PseudoNetCDFFile
(*args, **kwds)[source]¶ PseudoNetCDFFile provides an interface and standard set of methods that a file should present to act like a netCDF file using the Scientific.IO.NetCDF.NetCDFFile interface.
-
apply
(verbose=0, **dimfuncs)¶ Similar to numpy.apply_along_axis, but for damed dimensions and processes dimensions as well as variables
- Parameters
dimfuncs (dictionary) – key value pairs where the key is a dimensions and the value is a 1D function (func1d) or a dictionary. If the value is a dictionary it must include func1d as a function and any keyword arguments as additional options
verbose (integer) – 0 silent, 1 show variable, 2 show dimensions and variables
- Returns
outf – instance with variables and dimensions after processing
- Return type
-
applyAlongDimensions
(verbose=0, **dimfuncs)[source]¶ Similar to numpy.apply_along_axis, but for damed dimensions and processes dimensions as well as variables
- Parameters
dimfuncs (dictionary) – key value pairs where the key is a dimensions and the value is a 1D function (func1d) or a dictionary. If the value is a dictionary it must include func1d as a function and any keyword arguments as additional options
verbose (integer) – 0 silent, 1 show variable, 2 show dimensions and variables
- Returns
outf – instance with variables and dimensions after processing
- Return type
-
copy
(props=True, dimensions=True, variables=True, data=True)[source]¶ Function for making copies of the same type
- Parameters
props (boolean) – include properties (default: True)
dimensions (boolean) – include dimensions (default: True)
variables (boolean) – include variable structures (default: True)
data (boolean) – include variable data (default: True)
- Returns
outf
- Return type
PseudoNetCDFFile instance
-
copyVariable
(var, key=None, dtype=None, dimensions=None, fill_value=None, withdata=True)[source]¶ Copy var into self as vark
- Parameters
var (PseudoNetCDFVariable) – netCDF4.Variable-like object (must have ncattrs and setncatts)
key (string) – key for variable in self (can be omitted if var has name, standard_name, or long_name)
dtype (string or numpy.dtype) – change the data type to dtype
dimensions (iterable of strings) – change the dimensions to dimensions
fill_value (integer or flaot) – change the fill_value to this values
withdata (boolean) – default True, copies data
- Returns
myvar – copy of var in this file
- Return type
PseuodNetCDFVairable
-
createDimension
(name, length)[source]¶ Create a dimension
- Parameters
name (string) – name for dimension
length (integer) – maximum length of dimension
- Returns
dim – new dimension
- Return type
PseudoNetCDFDimensions
-
createVariable
(name, type, dimensions, fill_value=None, **properties)[source]¶ Create a variable
- Parameters
name (string) – name for new variable
type (string or numpy dtype) – code (e.g., ‘f’, ‘i’, ‘d’)
dimensions (tuple of strigns) – dimension keys that can be found in objects’ dimensions dictionary
- Returns
var
- Return type
new variable
-
date2num
(time, timekey='time')[source]¶ - Parameters
time (array-like) – array of datetime.datetime objects
timekey (str) – time variable key which requires units and should have calendar. If calendar is missing, standard is the default. default ‘time’
- Returns
num – time in relative time as defined by units of time variable (i.e., timekey) which defaults to ‘time’
- Return type
array-like
-
eval
(expr, inplace=False, copyall=False)[source]¶ Evaluate expr and return a PseudoNetCDFFile object with resutl
- Parameters
expr (string) – expression to evaluate
inplace (boolean) – create the new variable in this netcdf file (default False)
copyall (boolean) – if not inplace, should all variables be copied to new file
- Returns
outf – instance with renamed variable (this file if inplace = True)
- Return type
-
flush
()¶ Does nothing. Implemented for continuity with Scientific.IO.NetCDF
-
classmethod
from_ncf
(infile)[source]¶ - Parameters
infile (PseudoNetCDF-like file) –
- Returns
outf
- Return type
PseudoNetcdf-like file
-
classmethod
from_ncvs
(*invars, **invarkw)[source]¶ - Parameters
invars (list) – NetCDF-like variable must have standard_name, long_name or name
invarkw (kwds) – NetCDF-like variables
- Returns
outf
- Return type
PseudoNetcdf-like file
-
getMap
(maptype='basemap_auto', **kwds)[source]¶ Description
- Parameters
maptype (string) –
choices ‘basemap’, ‘basemap_auto’, ‘cartopy’ (not yet) basemap : attempts to open a basemap with only supplied kwds basemap_auto : automatically adds llcrnrlon,llcrnrlat,u
rcrnrlon,urcrnrlat based on longitude_bounds
**kwds (keywords) – for basemap or cartopy
- Returns
map
- Return type
basemap or cartopy axis
-
getTimes
(datetype='datetime', bounds=False)[source]¶ Get an array of datetime objects
- Parameters
datetype (string or numpy.dtype) – ‘datetime’ or datetime64 dtype
bounds (boolean) – get time boundaries
- Returns
out – datetime objects or array of numpy’s datetype type
- Return type
array
Notes
self must have a time or TFLAG variable
-
get_dest
()[source]¶ - Returns
path – path where a new file is created on some action
- Return type
str
Notes
If None, a file is created in memory. Else, a netcdf file is created on disk.
-
get_varopt
()[source]¶ Get options
- Parameters
None –
- Returns
options
- Return type
dictionary of options
-
getncatts
()[source]¶ Return all ncattrs keys and values as a dictionary
- Returns
attdict – key/value pairs of properties
- Return type
dictionary
-
getproj
(withgrid=False, projformat='pyproj')[source]¶ Description
- Parameters
withgrid (boolean) – use grid units instead of meters
projformat (string) – ‘pyproj’ (default), ‘proj4’ or ‘wkt’ allows function to return a pyproj projection object or a string in the format of proj4 or WKT
- Returns
proj – (wkt, proj4) or pyprojProj (pyproj)
- Return type
string pyproj.Proj
-
ij2ll
(i, j)[source]¶ Converts i, j to lon, lat (no false easting/northing) using cell centers assuming 0-based i/j
- Parameters
i (scalar/iterable) – indicies (0-based) for the west-east dimension
j (scalar/iterable) – indicies (0-based) for the south-north dimension
- Returns
lon, lat – longitudes and latitudes in decimal degrees
- Return type
scalars or iterables
-
insertDimension
(newonly=True, multionly=False, before=None, after=None, inplace=False, **newdims)[source]¶ Insert dimensions with keys and lengths from newdims
- Parameters
**newdims (dictionary) – where key is the new dimension and value is the length
newonly (boolean) – Only add dimension to variables that do not already have it, default True
multionly (boolean) – Only add dimension if there are already more than one (good for ignoring coordinate dimensions)
before (string) – if variable has this dimension, insert the new dimension before it. Otherwise, add to the beginning. (before takes precedence)
after (string) – if variable has this dimension, insert the new dimension after it. Otherwise, add to the beginning.
inplace (boolean) – create the new variable in this netcdf file (default False)
- Returns
outf – instance will new dimension in dimensions and variables
- Return type
Notes
Adding a non unity dimension will cause the data to be repeated along the new axis.
If order of addition matters, use multiple calls. newdimsuse will be a non-ordered dictionary
-
interpDimension
(dimkey, newdimvals, coordkey=None, **interpkwds)[source]¶ - Parameters
dimkey (string) – the new dimension for interpolation
newdimvals (iterable) – the new values to interpolate to
coordkey (string) – the variable to use as the old coordinate values
interptype (string) –
- ‘linear’ or ‘conserve’. linear uses a linear interpolation
conserve uses a mass conserving interpolation
extrapolate (boolean) – allow extrapolation beyond bounds with linear, default False
fill_value (numeric value) – set fill value (e.g, nan) to prevent extrapolation or edge continuation
- Returns
outf – instance with all variables interpolated
- Return type
Notes
When extrapolate is false, the edge values are used for points beyond the inputs.
-
classmethod
isMine
(*args, **kwds)[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.
-
ll2ij
(lon, lat, bounds='ignore', clean='none')[source]¶ Converts lon/lat to 0-based indicies (0,M), (0,N)
- Parameters
lon (scalar or iterable) – longitudes in decimal degrees
lat (scalar or iterable) – latitudes in decimal degrees
bounds (string) – ignore, error, warn if i,j are out of domain
clean (string) – none - return values regardless of bounds; mask - mask values out of bounds; clip - return min(max(0, v), nx - 1)
- Returns
i, j
- Return type
indices (0-based) for variables
-
ll2xy
(lon, lat)[source]¶ Converts lon/lat to x distances (no false easting/northing)
- Parameters
lon (scalar or iterable) – longitudes in decimal degrees
lat (scalar or iterable) – latitudes in decimal degrees
- Returns
x, y – coordinates in map projection (meters or radians)
- Return type
tuple of arrays
-
mask
(where=None, less=None, less_equal=None, greater=None, greater_equal=None, values=None, equal=None, invalid=False, mask=None, dims=None, fill_value=- 999, coords=False, verbose=0)[source]¶ Apply mask to all variables of same shape or just where dimensions match.
- Parameters
where (array-like) – boolean array to use as a mask see numpy.ma.masked_where
greater (scalar) – mask when values are greater than this value see numpy.ma.masked_greater
less (scalar) – mask when values are less than this value see numpy.ma.masked_less
greater_equal (scalar) – mask when values are greater than or equal to this value see numpy.ma.masked_greater
less_equal (scalar) – mask when values are less than or equal to this value see numpy.ma.masked_less
values (scalar) – mask when values are equal to this value within standard floating point see numpy.ma.masked_values
equal (scalar) – mask when values are exactly this value (i.e., integers) see numpy.ma.masked_equal
invalid (boolean) – mask when values are invalid, see numpy.ma.masked_invalid
mask (array-like) – alias for where
dims (iterable of strings) – only apply “mask” or “where” to variables with these dimensions no effet on other masks
fill_value (scalar) – value to use as the fill_value for new arrays
coords (boolean) – if True, apply masks to coordinate variables. Default, False
verbose (int) – level of verbosity for function, mostly for debugging
- Returns
outf – instance with masked variables
- Return type
See also
numpy.ma()
all masks are passing throught to numpy.ma.masked_…
Notes
mask options are not mutually exclusive. the order is where, greater, greater_equal, less, less_equal, values, equal, invalid
-
plot
(varkey, plottype='longitude-latitude', ax_kw=None, plot_kw=None, cbar_kw=None, map_kw=None, dimreduction='mean')[source]¶ - Parameters
varkey (string) – the variable to plot
plottype (string) – longitude-latitude, latitude-pressure, longitude-pressure, vertical-profile, time-longitude, time-latitude, time-pressure default, longitude-latitude
ax_kw (dictionary) – keywords for the axes to be created
plot_kw (dictionary) – keywords for the plot (plot, scatter, or pcolormesh) to be created
cbar_kw (dictionary) – keywords for the colorbar
map_kw (dictionary) – keywords for the getMap routine, which is only used with plottype=’longitude-latitude’
dimreduction (string or function) – dimensions not being used in the plot are removed using applyAlongDimensions(dimkey=dimreduction) where each dimenions
-
removeSingleton
(dimkey=None)[source]¶ Return a netcdflike object with dimensions sliced
- Parameters
dimkey (string) – key of dimension to be evaluated for removal; if None, evaluate all. only singleton dimensions will be removed.
- Returns
outf – instance with dimensions removed
- Return type
-
renameDimension
(oldkey, newkey, inplace=False)[source]¶ Rename dimension (oldkey) in dimensions and in all variables
- Parameters
oldkey (string) – dimension to be renamed
newkey (string) – new dame for dimension
inplace (boolean) – create the new variable in this netcdf file (default False)
- Returns
outf – instance with renamed variable (this file if inplace = True)
- Return type
-
renameDimensions
(inplace=False, **newkeys)[source]¶ Rename dimension (oldkey) in dimensions and in all variables
- Parameters
**newkeys (dictionary) – where key is the oldkey and value is the newkey
inplace (boolean) – create the new variable in this netcdf file (default False)
- Returns
outf – instance with renamed variable (this file if inplace = True)
- Return type
-
renameVariable
(oldkey, newkey, inplace=False, copyall=True)[source]¶ Rename variable (oldkey)
- Parameters
oldkey (string) – variable to be renamed
newkey (string) – new dame for variable
inplace (boolean) – create the new variable in this netcdf file (default False)
copyall (boolean) – if not inplace, should all variables be copied to new file
- Returns
outf – instance with renamed variable (this file if inplace = True)
- Return type
-
renameVariables
(inplace=False, copyall=True, **newkeys)[source]¶ Rename variables for each oldkey: newkey dictionary item
- Parameters
**newkeys (dictionary) – where key is the oldkey and value is the newkey
inplace (boolean) – create the new variable in this netcdf file (default False)
copyall (boolean) – if not inplace, should all variables be copied to new file
- Returns
outf – instance with renamed variable (this file if inplace = True)
- Return type
-
reorderDimensions
(oldorder, neworder, inplace=False)[source]¶ Evaluate expr and return a PseudoNetCDFFile object with resutl
- Parameters
oldorder (iterable of strings) – dimension names in existing order
neworder (iterable of strings) – dimension names in new order
- Returns
outf – instance with dimensions reordered in variables
- Return type
-
save
(*args, **kwds)[source]¶ Provides access to pncwrite for self
- Parameters
Help pncwrite (see) –
- Returns
- Return type
see Help pncwrite
-
setCoords
(keys, missing='ignore')[source]¶ Set a variable as a coordinate variable
- Parameters
keys (iterable of strings) – keys for coord variables
missing (string) – action if missing ‘ignore’, ‘skip’ or ‘error’ ignore - add in case used later skip - do not add error - raise an error
- Returns
- Return type
None
Notes
Coordinate variables are excluded from math
-
set_dest
(path, **options)[source]¶ Sets the path where a new file is created on some action
- Parameters
path (str) – path for new file
**options (keywords for constructor) – options for new file creation
- Returns
- Return type
None
-
set_varopt
(**options)[source]¶ Set options to be used when creating any Variable
- Parameters
**options (options for createVariable) – optional keywords to be supplied when creating new variables in destination file
- Returns
- Return type
None
-
setncatts
(attdict)[source]¶ Set ncattrs from attdict keys and values
- Parameters
attdict (dictionary) – key/value pairs of properties
- Returns
- Return type
None
-
slice
(newdims='POINTS', verbose=0, **dimslices)¶ Return a netcdflike object with dimensions sliced
- Parameters
newdims (iterable of strings) – names for new dimensions. When more than one iterable applies to a variable slice, fancy indexing removes both dimensions and creates a new one of the iterable lengths
**dimslices (dictionary) – key value pairs where the key is a dimension and the value is a valid slice object (slices, ints or iterables) if iterables are provided, all iterables must be the same size and shape. If the arrays are not 1D, newdims must have ndim names
- Returns
outf – instance with variables and dimensions sliced
- Return type
-
sliceDimensions
(newdims='POINTS', verbose=0, **dimslices)[source]¶ Return a netcdflike object with dimensions sliced
- Parameters
newdims (iterable of strings) – names for new dimensions. When more than one iterable applies to a variable slice, fancy indexing removes both dimensions and creates a new one of the iterable lengths
**dimslices (dictionary) – key value pairs where the key is a dimension and the value is a valid slice object (slices, ints or iterables) if iterables are provided, all iterables must be the same size and shape. If the arrays are not 1D, newdims must have ndim names
- Returns
outf – instance with variables and dimensions sliced
- Return type
-
stack
(other, stackdim)[source]¶ Concatenates all variables on stackdim
- Parameters
other (instance or list of PseudoNetCDFFiles) – files to add to this file along stackdim
stackdim (str) – dimension name
- Returns
outf – instance with stacked variables and dimension equal to new length
- Return type
-
subset
(varkeys, inplace=False, exclude=False, keepcoords=True)¶ Return a PseudoNetCDFFile with only varkeys
- Parameters
varkeys (iterable of strings) – keys to keep
inplace (boolean) – if true (default false), then remove other variable from this file
exclude (boolean) – if True (default False), then remove just these variables
keepcoords (boolean) – if True (default True), keep coordinate variables
- Returns
outf – instance with variables
- Return type
-
subsetVariables
(varkeys, inplace=False, exclude=False, keepcoords=True)[source]¶ Return a PseudoNetCDFFile with only varkeys
- Parameters
varkeys (iterable of strings) – keys to keep
inplace (boolean) – if true (default false), then remove other variable from this file
exclude (boolean) – if True (default False), then remove just these variables
keepcoords (boolean) – if True (default True), keep coordinate variables
- Returns
outf – instance with variables
- Return type
-
sync
()¶ Does nothing. Implemented for continuity with Scientific.IO.NetCDF
-
time2idx
(time, dim='time', timekey=None, **kwds)[source]¶ Convert datetime objects to dimension indices
- Parameters
time (array-like) – array of datetime.datetime objects
dim (str) – dimension name for val2idx
timekey (str) – time variable key. None defaults to dim
kwds (mappable) – see val2idx
- Returns
idx – time index (0-based)
- Return type
array-like
-
time2t
(time, ttype='nearest', index=True)[source]¶ - Parameters
time (array of datetime.datetime objects) –
interp ('nearest', 'bounds', 'bounds_close') –
index (return index) –
- Returns
t
- Return type
fractional time or if index, integers for indexing
-
val2idx
(dim, val, method='nearest', bounds='warn', left=None, right=None, clean='mask')[source]¶ Convert coordinate values to indices
- Parameters
dim (str) – name of dimensions, which must have a coordinate variable
val (array-like) – value in coordinate space
method (str) –
- nearest, bounds, exact - each calculates the index differently
nearest : uses interp with coord values and rounds
bounds : uses interp between bounding values and truncates
- exactreturns indices for exact coord values with other
indices masked (clean keyword has no effect)
bounds (str) – ignore, error, warn if i,j are out of domain
left (scalar) – see np.interp
right (scalar) – see np.interp
clean ({'none', 'mask'}) –
none - return values regardless of bounds; mask - mask invalid values (use with left/right=np.nan);
has no affect with method exact
- Returns
i – indices (0-based) for variables
- Return type
array-like
-
-
class
PseudoNetCDF.
PseudoNetCDFMaskedVariable
(parent, name, typecode='f', dimensions=(), **kwds)[source]¶ Creates a variable using the dimensions as defined in the parent object
- parent: PseudoNetCDFFile
an object with a dimensions variable
- name: string
name for variable
- typecode: string or numpy.dtype
numpy style typecode
- dimensions: tuple of strings
dimension names to be used from parent
- **kwds: dictionary
keywords to be added as properties to the variable. The keyword ‘values’ is a special case that will be used as the starting values of the array
-
class
PseudoNetCDF.
PseudoNetCDFVariable
(parent, name, typecode, dimensions, **kwds)[source]¶ PseudoNetCDFVariable presents the Scientific.IO.NetCDF.NetCDFVariable interface, but unlike that type, provides a contructor for variables that could be used without adding it to the parent file
Creates a variable using the dimensions as defined in the parent object
- Parameters
parent (PseudoNetCDFFile) – an object with a dimensions variable
name (string) – name for variable
typecode (string or numpy.dtype) – numpy style typecode
dimensions (tuple of strings) – dimension names to be used from parent
**kwds (keywords) – Dictionary of keywords to be added as properties to the variable. The keyword ‘values’ is a special case that will be used as the starting values of the array
-
ncattrs
()[source]¶ - Returns
ncattrs – attributes that have been user defined
- Return type
tuple of strings
-
PseudoNetCDF.
PseudoNetCDFVariableConvertUnit
(var, outunit)[source]¶ Convert the unit of var and update the associated IOAPI metadata
-
class
PseudoNetCDF.
PseudoNetCDFVariables
(func, keys)[source]¶ PseudoNetCDFVariables provides a special implementation of the default dictionary that provides efficient access to variables of a PseudoNetCDFFile. PseudoNetCDFFiles may have large variables that should only be loaded if accessed. PseudoNetCDFVariables allows a user to specify a function that can create variables on demand.
- func: function
must take a key and provides a PseudoNetCDFVariable
- keys: iterable of strings
keys that the dictionary should act as if it has
-
PseudoNetCDF.
anyfile
(*args, **kwds)¶ Open any PNC supported format using args and kwds, which are format specific. format is not passed to the reader
- Parameters
*args – arguments for opening file
**kwds – keywords for reader (see format)
format (string) – name of reader (not passed to reader), default auto-detect see Format Options for formats
addcf (boolean) – to add CF conventions (not passed to reader; default: False)
diskless (boolean) – to add CF conventions (not passed to reader; default: False)
help (boolean) – without format, returns help of pncopen and with format keyword, returns help of that class. See the __init__ interface for help with keywords that are not in the class __doc__.
- Returns
pfile
- Return type
PseudoNetCDF
Notes
- Format Options:
add your own by subclassing PseudoNetCDFFile
for a full list, use pncopen(help=True)
netcdf
nc
ncf
WrapPNC
cloud_rain
camxfiles.cloud_rain.Memmap.cloud_rain
add_derived
MetaNetCDF.add_derived
time_avg_new_unit
MetaNetCDF.time_avg_new_unit
window
MetaNetCDF.window
newresolution
MetaNetCDF.newresolution
MetaNetCDF
MetaNetCDF.MetaNetCDF
cloud_rain_center_time
camxfiles.cloud_rain.Transforms.cloud_rain_center_time
cloud_rain_plus
camxfiles.cloud_rain.Transforms.cloud_rain_plus
cloud_rain_center_time_plus
camxfiles.cloud_rain.Transforms.cloud_rain_center_time_plus
height_pressure
camxfiles.height_pressure.Memmap.height_pressure
camxfiles.height_pressure.Read.height_pressure
height_pressure_plus
camxfiles.height_pressure.Transforms.height_pressure_plus
height_pressure_center_time_plus
camxfiles.height_pressure.Transforms.height_pressure_center_time_plus
height_pressure_center_time
camxfiles.height_pressure.Transforms.height_pressure_center_time
one3d
camxfiles.one3d.Memmap.one3d
camxfiles.one3d.Read.one3d
humidity
camxfiles.humidity.Memmap.humidity
camxfiles.humidity.Read.humidity
humidity_center_time
camxfiles.humidity.Transforms.humidity_center_time
ipr
camxfiles.ipr.Memmap.ipr
camxfiles.ipr.Read.ipr
irr
camxfiles.irr.Memmap.irr
camxfiles.irr.Read.irr
landuse
camxfiles.landuse.Memmap.landuse
point_source
camxfiles.point_source.Memmap.point_source
camxfiles.point_source.Read.point_source
temperature
camxfiles.temperature.Memmap.temperature
camxfiles.temperature.Read.temperature
temperature_center_time
camxfiles.temperature.Transforms.temperature_center_time
jtable
cmaqfiles.jtable
ioapi_base
cmaqfiles.ioapi_base
ioapi
cmaqfiles.ioapi
icon_profile
cmaqfiles.profile.icon_profile
bcon_profile
cmaqfiles.profile.bcon_profile
griddesc
cmaqfiles.griddesc
cmaqomidat
cmaqfiles.cmaqomidat
uamiv
camxfiles.uamiv.Memmap.uamiv
camxfiles.uamiv.Read.uamiv
osat
camxfiles.uamiv.Transforms.osat
vertical_diffusivity
camxfiles.vertical_diffusivity.Memmap.vertical_diffusivity
camxfiles.vertical_diffusivity.Read.vertical_diffusivity
vertical_diffusivity_center_time
camxfiles.vertical_diffusivity.Transforms.vertical_diffusivity_center_time
wind
camxfiles.wind.Memmap.wind
camxfiles.wind.Read.wind
wind_center_time_cell
camxfiles.wind.Transforms.wind_center_time_cell
lateral_boundary
camxfiles.lateral_boundary.Memmap.lateral_boundary
finst
camxfiles.finst.Memmap.finst
_diag_group
geoschemfiles._diag_group
bpch_base
geoschemfiles.bpch_base
bpch1
geoschemfiles.bpch1
gcnc_base
geoschemfiles.gcnc_base
gcnc
geoschemfiles.gcnc
bpch2
geoschemfiles.bpch2
bpch
geoschemfiles.bpch
geos
geoschemfiles.geos
flightlogs
geoschemfiles.flightlogs
ffi1001
icarttfiles.ffi1001.ffi1001
reader
aermodfiles.reader
ceilometerl2
ceilometerfiles.ceilometerl2
aqsraw
epafiles.aqsraw
arlpackedbit
noaafiles.arlpackedbit
l100
noaafiles.l100
arlpardump
noaafiles.arlpardump
arlconcdump
noaafiles.arlconcdump
arltrajdump
noaafiles.arltrajdump
csv
textfiles.csv
tomsl3
toms.level3.tomsl3
woudcsonde
woudcfiles.woudcsonde
-
PseudoNetCDF.
get_dimension_length
(pfile, key)[source]¶ Return the length of a dimension (key) from pfile
-
PseudoNetCDF.
get_ncf_object
(path_or_object, mode, format='NETCDF4_CLASSIC')[source]¶ Return an open NetCDF or PseudoNetCDF from an object or path
-
PseudoNetCDF.
getreader
(*args, **kwds)[source]¶ - Parameters
*args – arguments for opening file
**kwds – keywords for file opener and optional format
format (string) – name of reader (optional)
- Returns
reader
- Return type
class
-
PseudoNetCDF.
interpvars
(f, weights, dimension, loginterp=[])[source]¶ f - PseudoNetCDFFile weights - weights for new dimensions from old dimension dim(new, old) dimension - which dimensions will be reduced loginterp - iterable of keys to interp on log scale
-
PseudoNetCDF.
pnc
(*args, **kwds)[source]¶ Arguments - see PNC :returns: file(s) - single file or, if more than 1 file is returned a list of files
-
PseudoNetCDF.
pncbo
(op, ifile1, ifile2, coordkeys=None, verbose=0)[source]¶ Perform binary operation (op) on all variables in ifile1 and ifile2. The returned file (rfile) contains the result
rfile = ifile1 <op> ifile2
op can be any valid operator (e.g., +, -, /, , *, &, ||)
-
PseudoNetCDF.
pncexpr
(expr, ifile, verbose=0)[source]¶ Evaluate an arbitrary expression in the context of ifile.variables and add the result to the file with appropriate units.
-
PseudoNetCDF.
pncmfopen
(*args, stackdim=None, **kwds)[source]¶ Open any PNC supported format using pncopen on all files passed as teh first argument of pncmfopen. See pncopen
- Parameters
args (arguments) – args[0] must be a list of paths, other arguments are format specific
stackdim (str) – dimension upon which to stack files
kwds (dict) – see pncopen for more details
- Returns
pfile
- Return type
PseudoNetCDF
-
PseudoNetCDF.
pncopen
(*args, **kwds)[source]¶ Open any PNC supported format using args and kwds, which are format specific. format is not passed to the reader
- Parameters
*args – arguments for opening file
**kwds – keywords for reader (see format)
format (string) – name of reader (not passed to reader), default auto-detect see Format Options for formats
addcf (boolean) – to add CF conventions (not passed to reader; default: False)
diskless (boolean) – to add CF conventions (not passed to reader; default: False)
help (boolean) – without format, returns help of pncopen and with format keyword, returns help of that class. See the __init__ interface for help with keywords that are not in the class __doc__.
- Returns
pfile
- Return type
PseudoNetCDF
Notes
- Format Options:
add your own by subclassing PseudoNetCDFFile
for a full list, use pncopen(help=True)
netcdf
nc
ncf
WrapPNC
cloud_rain
camxfiles.cloud_rain.Memmap.cloud_rain
add_derived
MetaNetCDF.add_derived
time_avg_new_unit
MetaNetCDF.time_avg_new_unit
window
MetaNetCDF.window
newresolution
MetaNetCDF.newresolution
MetaNetCDF
MetaNetCDF.MetaNetCDF
cloud_rain_center_time
camxfiles.cloud_rain.Transforms.cloud_rain_center_time
cloud_rain_plus
camxfiles.cloud_rain.Transforms.cloud_rain_plus
cloud_rain_center_time_plus
camxfiles.cloud_rain.Transforms.cloud_rain_center_time_plus
height_pressure
camxfiles.height_pressure.Memmap.height_pressure
camxfiles.height_pressure.Read.height_pressure
height_pressure_plus
camxfiles.height_pressure.Transforms.height_pressure_plus
height_pressure_center_time_plus
camxfiles.height_pressure.Transforms.height_pressure_center_time_plus
height_pressure_center_time
camxfiles.height_pressure.Transforms.height_pressure_center_time
one3d
camxfiles.one3d.Memmap.one3d
camxfiles.one3d.Read.one3d
humidity
camxfiles.humidity.Memmap.humidity
camxfiles.humidity.Read.humidity
humidity_center_time
camxfiles.humidity.Transforms.humidity_center_time
ipr
camxfiles.ipr.Memmap.ipr
camxfiles.ipr.Read.ipr
irr
camxfiles.irr.Memmap.irr
camxfiles.irr.Read.irr
landuse
camxfiles.landuse.Memmap.landuse
point_source
camxfiles.point_source.Memmap.point_source
camxfiles.point_source.Read.point_source
temperature
camxfiles.temperature.Memmap.temperature
camxfiles.temperature.Read.temperature
temperature_center_time
camxfiles.temperature.Transforms.temperature_center_time
jtable
cmaqfiles.jtable
ioapi_base
cmaqfiles.ioapi_base
ioapi
cmaqfiles.ioapi
icon_profile
cmaqfiles.profile.icon_profile
bcon_profile
cmaqfiles.profile.bcon_profile
griddesc
cmaqfiles.griddesc
cmaqomidat
cmaqfiles.cmaqomidat
uamiv
camxfiles.uamiv.Memmap.uamiv
camxfiles.uamiv.Read.uamiv
osat
camxfiles.uamiv.Transforms.osat
vertical_diffusivity
camxfiles.vertical_diffusivity.Memmap.vertical_diffusivity
camxfiles.vertical_diffusivity.Read.vertical_diffusivity
vertical_diffusivity_center_time
camxfiles.vertical_diffusivity.Transforms.vertical_diffusivity_center_time
wind
camxfiles.wind.Memmap.wind
camxfiles.wind.Read.wind
wind_center_time_cell
camxfiles.wind.Transforms.wind_center_time_cell
lateral_boundary
camxfiles.lateral_boundary.Memmap.lateral_boundary
finst
camxfiles.finst.Memmap.finst
_diag_group
geoschemfiles._diag_group
bpch_base
geoschemfiles.bpch_base
bpch1
geoschemfiles.bpch1
gcnc_base
geoschemfiles.gcnc_base
gcnc
geoschemfiles.gcnc
bpch2
geoschemfiles.bpch2
bpch
geoschemfiles.bpch
geos
geoschemfiles.geos
flightlogs
geoschemfiles.flightlogs
ffi1001
icarttfiles.ffi1001.ffi1001
reader
aermodfiles.reader
ceilometerl2
ceilometerfiles.ceilometerl2
aqsraw
epafiles.aqsraw
arlpackedbit
noaafiles.arlpackedbit
l100
noaafiles.l100
arlpardump
noaafiles.arlpardump
arlconcdump
noaafiles.arlconcdump
arltrajdump
noaafiles.arltrajdump
csv
textfiles.csv
tomsl3
toms.level3.tomsl3
woudcsonde
woudcfiles.woudcsonde
-
PseudoNetCDF.
pncwrite
(*args, **kwds)[source]¶ See PseudoNetCDF.pncgen.pncgen
*args : iterable **kwds : keywords
keywords for pncgen
- helpboolean
without format, returns help of pncopen and with format keyword, returns help of the function that writes that format.
-
PseudoNetCDF.
reduce_dim
(f, reducedef, fuzzydim=True, metakeys=['time', 'layer', 'level', 'latitude', 'longitude', 'time_bounds', 'latitude_bounds', 'longitude_bounds', 'ROW', 'COL', 'LAY', 'TFLAG', 'ETFLAG'])[source]¶ variable dimensions can be reduced using
reduce_dim(file ‘dim,function,weight’)
e.g., reduce_dim(layer,mean,weight).
Weighting is not fully functional.
-
PseudoNetCDF.
slice_dim
(f, slicedef, fuzzydim=True)[source]¶ variables have dimensions (e.g., time, layer, lat, lon), which can be subset using:
slice_dim(f, ‘dim,start,stop,stride’)
e.g., slice_dim(f, ‘layer,0,47,5’) would sample every fifth layer starting at 0