gfdlvitals.util.average module
Utiliites for use in averaging routines
- class gfdlvitals.util.average.RichVariable(varname, grid_file, data_file, fyear, outdir, label, geolat, geolon, cell_area=None, area_types=None, cell_depth=None, cell_frac=None, soil_area=None, soil_frac=None, average_dt=None)
Bases:
objectMetadata-rich variable class
- Parameters:
varname (str) – Variable name
grid_file (io.BufferedReader or list of io.BufferedReader) – Grid-spec tiles
data_file (io.BufferedReader or list of io.BufferedReader) – Data tiles
fyear (str) – Year that is being processed
outdir (str) – Output path directory
label (str) – DB file name
geolat (np.ma.masked_array) – Array of latitudes
geolon (np.ma.masked_array) – Array of longitudes
cell_area (np.ma.masked_array, optional) – Array of cell areas
area_types (dict, optional) – [description], by default None
cell_depth (np.ma.masked_array, optional) – [description], by default None
cell_frac (np.ma.masked_array, optional) – [description], by default None
soil_area (np.ma.masked_array, optional) – [description], by default None
soil_frac (np.ma.masked_array, optional) – [description], by default None
average_dt (np.ma.masked_array) – Array of time averaging period
- gfdlvitals.util.average.generic_cubesphere_driver(fyear, tar, modules, average, grid_spec='grid_spec')
Generic cubesphere data driver
- Parameters:
fyear (str) – Year to process (YYYYMMDD)
tar (tarfile object) – In-memory pointer to history tarfile
modules (dict) – Dictionary of history nc streams (keys) and output db name (values)
- gfdlvitals.util.average.process_var(variable, averager=None)
Function called by multiprocessing thread to process a variable
- Parameters:
variable (RichVariable object) – Input variable to process