openairclim.construct_conc

Constructs concentrations

openairclim.construct_conc.calc_inv_sums(spec, inv_dict)[source]

Calculates the emission sums for a given species for a dictionary of emission inventories

Parameters:
  • spec (str) – Name of species

  • inv_dict (dict) – Dictionary of emission inventory xarrays, keys are inventory years

Returns:

Inventory years and inventory sums for given species

Return type:

np.ndarray, np.ndarray

openairclim.construct_conc.check_inv_values(inv, year, spec)[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.construct_conc.get_emissions(inv_dict, species)[source]

Get total emissions in Tg for each inventory and given species TODO Unit conversions for other units than kg

Parameters:
  • species (str) – String or list of strings, species names

  • inv_dict (dict) – Dictionary of emission inventory xarrays, keys are inventory years

Raises:

TypeError – if species argument has wrong type

Returns:

Inventory years and dictionary with arrays of emissions in Tg,

keys are spec

Return type:

np.ndarray, dict

openairclim.construct_conc.interp_bg_conc(config, spec)[source]

Interpolates background concentrations for given species within time_range, for a background file and scenario set in config TODO Take into account various conc units in background file

Parameters:
  • config (dict) – Configuration dictionary from config

  • spec (str) – Species name

Returns:

Dictionary with np.ndarray of interpolated concentrations,

key is species

Return type:

dict