spaemis.inventory

Loading emissions inventories

EmissionsInventory

class EmissionsInventory(data, border_mask, year)[source]

Bases: object

An emissions inventory is a set of bottom up

classmethod load_from_directory(data_directory, year, **kwargs)[source]

Load an emissions inventory from a directory

Return type:

typing.Self

Grid

class Grid[source]

Bases: object

Configuration for a regular lat/lon mesh

property lats: list[float]

Latitudes of the grid

property lons: list[float]

Longitudes of the grid

VictoriaGrid

class VictoriaGrid[source]

Bases: Grid

Information about the grid used in Victoria

AustraliaGrid

class AustraliaGrid[source]

Bases: Grid

Information about the grid used in Australia

lat/lons represent the center of the cell

VictoriaEPAInventory

class VictoriaEPAInventory(data, border_mask, year)[source]

Bases: EmissionsInventory

Victorian EPA data

CSV files of 1D datapoints. Each grid is slightly different so some post-processing is required to get all the variables and sectors on to the same grid.

classmethod load_from_directory(data_directory, year, file_suffix='_tif_to_csv3.csv', grid=None, **kwargs)[source]

Load Victorian EPA inventory data

Parameters:
  • data_directory (str) – Folder containing CSV input files

  • grid (Grid | None) – Object containing information about the target grid

Returns:

Self – Loaded data

AustraliaInventory

class AustraliaInventory(data, border_mask, year)[source]

Bases: EmissionsInventory

Australian data

CSV files of 1D datapoints. Each grid is slightly different so some post-processing is required to get all the variables and sectors on to the same grid.

classmethod load_from_directory(data_directory, year, file_suffix='.nc', **kwargs)[source]

Load Australian EDGAR data

Parameters:
  • data_directory (str) – Folder containing CSV input files

  • grid – Object containing information about the target grid

Returns:

typing.SelfLoaded data

TestInventory

class TestInventory(data, border_mask, year)[source]

Bases: EmissionsInventory

Test inventory using decimated Vic inventory data

classmethod load_from_directory(data_directory, year, **kwargs)[source]

Load test inventory data

For testing we use a decimated version of the vic inventory generated using scripts/downsample_inventory.py

Parameters:
  • data_directory (str) – Folder containing CSV input files

  • grid – Object containing information about the target grid

Returns:

typing.SelfLoaded data

has_dimensions

has_dimensions(dimensions)[source]

Check if a xarray Dataset or DataArray has the expected dimensions

Parameters:

dimensions (str | list[str]) – Dimensions to checks

Raises:

ValueError – If any of the requested dimensions are not present in the data array

Return type:

ValidatorType[T]

write_inventory_csvs

write_inventory_csvs(ds, output_dir)[source]

Serialize a Dataset to CSV files with the same format as the input inventory data

Each sector is written into a different file. The CSV file contains rows of data for each datapoint on a lat, lon grid. Each variable will be written as a separate column.

The ordering of the datapoints are lat-major (i.e. iterate over latitude and then longitude)

Parameters:
  • ds (xarray.core.dataset.Dataset) –

    Data to output

    This dataset should be similar to the format from EmissionsInventory.data. in that each data variable contains a sector, lat and lon dimension.

  • output_dir (str) – Output directory for the

Return type:

None