openairclim.core.construct_conc
Constructs concentrations.
- openairclim.core.construct_conc.calc_inv_sums(spec: str, inv_dict: dict, target_units: str = 'kg') tuple[ndarray, ndarray][source]
Calculates the emission sums for a given species and set of inventories.
Sums are converted to target_units using each inventory’s own declared units.
- Parameters:
- Returns:
Inventory years and inventory sums for given species, in target_units
- Return type:
- openairclim.core.construct_conc.check_inv_values(inv: Dataset, year: str, spec: str) None[source]
Checks values in given inventory for a specific species.
- Parameters:
inv (xarray.Dataset) – Emission inventory dataset for a specific year.
year (str) – Year of the inventory.
spec (str) – Species name.
- Raises:
ValueError – If there are any negative emissions for the given species in the inventory.
- openairclim.core.construct_conc.get_emissions(inv_dict: dict, species: str | list[str]) tuple[ndarray, dict][source]
Get total emissions in Tg for each inventory and given species.
- Parameters:
- Raises:
TypeError – if species argument has wrong type
- Returns:
Inventory years and dictionary with arrays of emissions in Tg, keys are spec
- Return type:
- openairclim.core.construct_conc.interp_bg_conc(config: dict, spec: str) dict[source]
Interpolates background concentrations for a given species.
Uses time_range, a background file, and scenario set in config.
TODO: Take into account various conc units in background file.
- Parameters:
- Returns:
Dictionary with
numpy.ndarrayof interpolated concentrations, key is species- Return type: