openairclim.write_output
Writes output: results netCDF file and diagnositics files
- openairclim.write_output.query_checksum_table(spec, resp, inv)[source]
 Look up in checksum table, if for the particular spec/resp/inv combination pre-calculated data exists
- openairclim.write_output.update_checksum_table(spec, resp, inv, cache_file)[source]
 - Add a row to the existing checksum table with hashes of resp and inv,
 and path to cache_file
- openairclim.write_output.update_output_dict(output_dict, ac, result_type, val_arr_dict)[source]
 Update output_dict for a given aircraft with a new result type.
- Parameters:
 output_dict (dict) – The main output dictionary to update. Format: {ac: {var: np.ndarray}}
ac (str) – Aircraft identifier from config file
result_type (str) – Prefix for variable names, e.g. “RF”
val_arr_dict (dict) – Dictionary of {species: np.ndarray} results. Each array shold be 1D and represent a time series.
- Returns:
 Modifies output_dict in-place.
- Return type:
 None
- openairclim.write_output.write_climate_metrics(config: dict, metrics_dict: dict, mode: str = 'w') Dataset[source]
 Writes climate metrics to netCDF file.
- openairclim.write_output.write_concentrations(config, resp_dict, conc_dict)[source]
 Output of concentration changes, Convert dictionary of time series numpy arrays into dictionary of xarray Datasets, write to netCDF files, one per species
- Parameters:
 - Returns:
 Dictionary of concentration changes (time, lat, plev), keys are species
- Return type:
 
- openairclim.write_output.write_output_dict_to_netcdf(config, output_dict, mode='w')[source]
 Convert nested output dictionary into xarray Dataset and write to netCDF file.
- Parameters:
 config (dict) – Configuration from config file
output_dict (dict) – Nested output dictionary. Levels are {ac: {var: np.ndarray}}, where ac is the aircraft identifier, var is a variable, e.g. “RF_CO2” and np.ndarray is of length time (as defined in config)
mode (str, optional) – Options: “a” (append) and “w” (write).
- Returns:
 OpenAirClim results
- Return type:
 xr.Dataset