openmethane / openmethane-prior

Method to calculate a gridded, prior emissions estimate for methane across Australia
Apache License 2.0
4 stars 0 forks source link

OpenMethane prior emissions estimate

Method to calculate a gridded, prior emissions estimate for methane across Australia.

This repository is matched with downloadable input data so that it will run out of the box.

Initialise

Copy the .env.example file to .env and customise the paths as you need.

In order to download the GFAS emissions data, credentials for the Copernicus Atmospheric Data Store (ADS) API are required. Instructions for registering for the ADS API and setting up the credentials are provided at in ADS Docs.

After creating an account and obtaining the credentials, you must also accept the general license conditions for the data in order to download the data. You can check whether the license terms have been accepted by visiting the GFAS Dataset while logged in. The "Terms of Use" section at the bottom of the page shows the license and whether it has been accepted

Note: the ADS API is different from the CDS (Climate Data Store) API even though they are both parts of the Copernicus program and share the same credentials file.

Installation

To get started, you will need to make sure that poetry is installed. The Open Methane prior can be installed from source into a virtual environment with:

make virtual-environment

Input Data

To download all the required input files, run:

poetry run python scripts/omDownloadInputs.py

This will download input files that match the data in .env.example, so you have a working set to get started with

Domain Info

To generate the domain information needed for grid resolution etc run

poetry run python scripts/omCreateDomainInfo.py

The current version is set up for CMAQ and uses three files from the WRF and CMAQ setup process. Replace these with your own version for a different CMAQ domain. For another model, look at the structure of the domainXr variable in omCreateDomainInfo.py

Run

All layers

To calculate emissions for all layers, run omPrior.py with a start and end date:

poetry run python scripts/omPrior.py 2022-07-01 2022-07-02

This takes a while to process (~10 minutes) with the vast majority of that time spent on the layers in omAgLulucfWasteEmis.py.

To skip re-projecting raster layers (you only need to do this once for every time you change the raster input files), add the --skip-reproject option.

Single layers

You can run and re-run individual layers one-by-one. Just run each file on it's own (GFAS and Wetlands require a start and end date as below):

poetry run python scripts/omWetlandEmis.py 2022-07-01 2022-07-02

Outputs

Outputs can be found in the outputs folder. The emissions layers will be written as variables to a copy of the input domain file, with an OCH4_ prefix for the methane layer variable names. The sum of all layers will be sotred in the OCH4_TOTAL layer.

The name of the layered output file will be om-prior-output.nc.

The intermediates folder will contain any re-projected raster data, and any files downloaded or generated in the process.

Layers

Many sectors are taken from data sets used in by Saunois et al (2020) (doi:10.5194/essd-12-1561-2020)