smoke_dust.core package
Subpackages
Submodules
smoke_dust.core.common module
Contains common functionality used across smoke/dust.
- create_descriptive_statistics(container: Dict[str, numpy.ma.MaskedArray], origin: Literal['src', 'dst_unmasked', 'dst_masked', 'derived'], path: Path) pandas.DataFrame
Create a standard set of descriptive statistics using pandas.
- Parameters:
container – A dictionary mapping names to masked arrays.
origin – A tag to indicate the data origin to add to the created dataframe.
path – Path to the netCDF file where the container data originated.
- Returns:
A dataframe containing descriptive statistics fields.
- create_sd_coordinate_variable(nc_ds: netCDF4.Dataset, sd_variable: SmokeDustVariable) None
Create a smoke/dust netCDF spatial coordinate variable.
- Parameters:
nc_ds – Dataset to update.
sd_variable – Contains variable metadata.
- create_sd_variable(nc_ds: netCDF4.Dataset, sd_variable: SmokeDustVariable, fill_first_time_index: bool = True) None
Create a smoke/dust netCDF variable.
- Parameters:
nc_ds – Dataset to update
sd_variable – Contains variable metadata
fill_first_time_index – If True, fill the first time index with provided fill_value_float
- create_template_emissions_file(nc_ds: netCDF4.Dataset, grid_shape: Tuple[int, int], is_dummy: bool = False)
Create a smoke/dust template netCDF emissions file.
- Parameters:
nc_ds – The target netCDF dataset object.
grid_shape – The grid shape to create.
is_dummy – Converted to a netCDF attribute to indicate if the created file is dummy emissions or will contain actual values.
- open_nc(path: Path, mode: Literal['r', 'w', 'a'] = 'r', clobber: bool = False, parallel: bool = True) netCDF4.Dataset
Open a netCDF file for various operations.
- Parameters:
path – Path to the target netCDF file.
mode – Mode to open the file in.
clobber – If True, overwrite an existing file.
parallel – If True, open the netCDF for parallel operations.
- Returns:
A netCDF dataset object.
smoke_dust.core.context module
smoke_dust.core.cycle module
smoke_dust.core.preprocessor module
smoke_dust.core.variable module
Variable definitions used by smoke/dust.
- class SmokeDustVariable(*args: Any, **kwargs: Any)
Bases:
BaseModelModel for a smoke/dust variable.
- class SmokeDustVariables(*args: Any, **kwargs: Any)
Bases:
BaseModelCanonical collection of smoke/dust variables.
- get(name: str) SmokeDustVariable
Get a smoke/dust variable from the collection.