openairclim.utils.create_artificial_inventories

Create emission inventories with random values

class openairclim.utils.create_artificial_inventories.ArtificialInventory(year, ac_lst=None, lon_range=[0.0, 360.0], lat_range=[-90.0, 90.0], plev_range=[200.0, 1000.0], scaling=1.0, size=10000)[source]

Bases: object

Class for generating artificial emission inventories.

convert_df_to_xr()[source]

Convert the pandas dataframe to an xarray dataset.

Returns:

The xarray dataset with the emission inventory data.

Return type:

xarray.Dataset

create(distribution: str = 'uniform') Dataset[source]

Create an emission inventory with the specified distribution.

Parameters:

distribution (str, optional) – The distribution to use for creating the emission inventory. Can be either “uniform” or “normal”. Defaults to “uniform”.

Returns:

The emission inventory as an xarray dataset.

Return type:

xr.Dataset

create_normal_dist()[source]

Create an inventory with a normal distribution.

create_uniform_dist()[source]

Create an emission inventory with a uniform distribution.

mean_dict = {'CO2': 1346749.125, 'H2O': 540429.125, 'NOx': 6783.677734375, 'distance': 87872.8671875, 'fuel': 432343.28125, 'lat': 27.598291397094727, 'lon': 163.00254821777344, 'plev': 438.63165283203125}
stat_size = 606169
class openairclim.utils.create_artificial_inventories.ArtificialInventoryDict(year_arr, delta=0.03, ac_lst=None)[source]

Bases: object

Class for generating artificial emission inventories.

Parameters:
  • year_arr (list) – List of inventory years.

  • delta (float, optional) – Linear increase rate of emissions. Defaults to DELTA.

  • ac_lst (list, optional) – List of aircraft identifiers (strings). Defaults to None (ac coordinate not generated).

year_arr

List of inventory years.

Type:

list

year_0

First year in the list.

Type:

int

delta

Linear increase rate of emissions.

Type:

float

inv_dict

Dictionary of xarray datasets, where the keys are the inventory years and the values are the datasets for that year.

Type:

dict

create(evolution='increment')[source]

Create an emission inventory with the specified evolution.

Parameters:

evolution (str, optional) – Evolution method. Can be either “increment” or “uniform”. Defaults to “increment”.

Returns:

None

Return type:

None

create_linear_increase()[source]

Create an inventory with a linear increase in emissions.

Returns:

None

Return type:

None

openairclim.utils.create_artificial_inventories.convert_xr_dict_to_nc(inv_dict: dict, prefix: str = 'rnd_inv', out_path: str = '.')[source]

Convert a dictionary of xarray datasets to netCDF files and write to out_path. Create out_path if not existing.

Parameters:
  • inv_dict (dict) – Dictionary of xarray datasets, where the keys are the inventory years and the values are the datasets for that year.

  • prefix (str, optional) – Prefix for the output netCDF files. Defaults to “rnd_inv”.

  • out_path (str, optional) – The path to the output directory. Defaults to OUT_PATH.

Returns:

None

Return type:

None

openairclim.utils.create_artificial_inventories.main()[source]

Parse command-line arguments and create artificial emission inventories.

openairclim.utils.create_artificial_inventories.plot_sample_emission_inventory(rnd_inv_dict)[source]

Plots a sample emission inventory from the provided dictionary of xarray datasets.

Parameters:

rnd_inv_dict (dict) – Dictionary of xarray datasets, where the keys are the inventory years and the values are the datasets for that year.

Returns:

None

Return type:

None