openairclim.calc_response

Calculates responses for each species and scenario

openairclim.calc_response.calc_resp(spec: str, inv, weights) ndarray[source]

Calculate response from response surfaces, emission inventories and pre-computed weighting parameters.

Parameters:
Raises:

KeyError – if species not valid

Returns:

Response array

Return type:

np.ndarray

openairclim.calc_response.calc_resp_all(config, resp_dict, inv_dict)[source]

Loop calc_response function over elements in response dictionary

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

  • resp_dict (dict) – Dictionary of response xarray Datasets, keys are species

  • inv_dict (dict) – Dictionary of inventory xarray Datasets, keys are years

Returns:

Dictionary of dictionary of numpy arrays of computed responses,

keys are species and inventory years

Return type:

dict

openairclim.calc_response.calc_resp_sub(species_sub, output_dict, ac)[source]

Calculates responses for specified sub-species. The calculation of sub-species responses depends on the results of main species which must be calculated and written to output beforehand.

Parameters:

species_sub (list[str]) – List of sub-species names, such as ‘PMO’

Returns:

Dictionary with computed responses, keys are sub-species

Return type:

dict

Raises:

KeyError – If no method defined for the sub-species