Welcome to Documentation for Uptrop Software!

Uptrop is python software to convert satellite observations of total atmospheric column densities of air pollutants to vertical profiles in the global troposphere using the cloud-slicing technique.

The software was developed using total column densities of nitrogen dioxide (NO2) from the ESA Sentinel-5P TROPOMI instrument to derive NO2 mixing ratios in the global upper troposphere (8-12 km) at ~100 km spatial resolution. The software is now being updated to also retrieve NO2 and ozone (O3) mixing ratios in five vertical layers throughout the troposphere.

This brief documentation provides details of relevant references, data products, sample output, guidance on installing and using the software, and how to ask for help or report bugs, issues and suggested code updates.

Contents

Overview of Capabilities

Uptrop-Py is python coded software used to apply the so-called cloud-slicing technique to satellite observations of column densities of nitrogen dioxide (NO2) to retrieve vertical profiles of mixing ratios of NO2 throughout the troposphere on a global scale.

Code output includes data in NetCDF format, plots in postscript format, and metrics at the end of the log file. Sample plots and logfile metrics are in the Gallery.

So far the code has been applied to Sentinel-5P TROPOMI instrument obesrvations of total columns of NO2 using cloud information from two distinct TROPOMI cloud products to obtain NO2 concentrations in a single layer in the upper troposphere from 450 hPa (~8 km) to 180 hPa (~12 km).

The steps in the retrieval algorithm are detailed in the open access peer-reviewed Marais et al. (2021) paper published in Atmospheric Measurement Techniques.

The data generated for this paper are available for public download from the UCL Data Repository.

A static version of the software that was used in the above paper to generate the above data is hosted on Zenodo and available for public download and use as version 1.1.0.

Code Updates in Progress

A new and improved version of the software is under development. It includes many updates that are categorised below.

Data / Output

  • Change regression fit from reduced major axis to Theil, so that cloud-slicing regression fit is less impacted by non-uniformally distributed data leading to an overestimate in mixing ratios over remote locations.

  • No longer bias correct tropospheric columns of NO2, as this bias correction was due to application of the reduced major axis regression fit to non-uniformally distributed data.

Increased Flexibility

  • Adjust the code to be able to apply it to multiple pollutants. NOt just NO2. Currenlty under development is application to TROPOMI ozone to retrieve veritcal profiles of tropospheric ozone, a potent greenhouse gas.

  • Ability to obtain mixing ratios in all layers in the troposphere, with the flexibility for the user to specify the pressure range, limited to a range that is at least 100 hPa for the cloud-slicing routine to succeed.

  • Enable flexibility to select any start and end date, not just limited to processing data for a single season.

Structural Changes

  • Replace Basemap with Cartopy for generating sample plots.

  • Restructure code directories

  • Improve variable names in the Python code and in the output NetCDF data file

If you’re interested in using a version of the software currently under development, please reach out to the developers via the GitHub Issues page.

Code Structure

Core Code

Used for cloud-slicing satellite observations of total column densities of NO2:

./erc-uptrop/uptrop/cloud_slice_tropomi_no2.py

Module that reads in TROPOMI data, calls the cloud slicing routine, grids data, calculates seasonal means, outputs data and sample plots.

./erc-uptrop/uptrop/cloud_slice_no2.py

Routine that cloud-slices the TROPOMI NO2 data prepared in cloud_slice_tropomi_no2.py. Calculates NO2 concentration and associated error in pptv.

./erc-uptrop/uptrop/height_pressure_converter.py

Routine to convert cloud top height to cloud top pressure. Used for the TROPOMI CLOUD_OFFL product only.

./erc-uptrop/uptrop/boostrap.py

Routine that calculates the reduced major axis regression slope and intercept values and errors estimated with bootstrapping. Adapted into Python from the IDL GAMAP package.

./erc-uptrop/uptrop/gamap_colormap.py

The white-yellow-green-orange-red colorbar from the GCPy Python package.

./erc-uptrop/uptrop/constants.py

Constants and conversion factors used for cloud-slicing.

Additional Code

Used by Marais et al. (2021) to assess the TROPOMI NO2 columns and cloud products:

./erc-uptrop/uptrop/fresco_cld_error.py

Routine to compare two TROPOMI cloud products used to cloud-slice TROPOMI NO2.

./erc-uptrop/uptrop/read_pandora.py

Routine to read in ground-based Pandora total and tropospheric NO2 column data in the format provided by the Pandonia Global Network.

./erc-uptrop/uptrop/compare_tropomi_pandora.py

Routine to sample and compare coincident data from TROPOMI and Pandora total and tropospheric NO2 columns at high-altitude sites.

Installation

To download the latest stable version of the cloud-slicing uptrop-py code, type:

$ git clone https://github.com/eamarais/erc-uptrop.git

This command clones the source code to a folder called erc-uptrop

To download GEOS-Chem Classic source code into a folder named something other than erc-uptrop, supply the name of the folder at the end of the git clone command. For example:

$ git clone https://github.com/eamarais/erc-uptrop.git my-code-dir

This will download the source code into my-code-dir instead of erc-uptrop.

Once the git clone process starts, you should see output similar to this:

Cloning into 'erc-uptrop'...
remote: Enumerating objects: 1568, done.
remote: Counting objects: 100% (485/485), done.
remote: Compressing objects: 100% (277/277), done.
remote: Total 1568 (delta 322), reused 297 (delta 195), pack-reused 1083
Receiving objects: 100% (1568/1568), 1.25 MiB | 10.35 MiB/s, done.
Resolving deltas: 100% (1086/1086), done.

When the git clone process has finished, get a directory listing:

$ ls -CF erc-uptrop/*

and you will see output similar to this:

docs/  environment.yml  LICENSE  README.md  tests/  uptrop/

Navigate into the erc-uptrop folder and confirm that the code is in the main branch:

$ cd erc-uptrop/
$ git branch

You will see output similar to this:

* main

If you plan to modify the code, either to add new features or fix bugs, create a branch to store these changes.

To do so, type:

$ git branch feature/my-git-updates
$ git checkout feature/my-git-updates

Instead of feature/my-git-updates, you may choose a name that reflects the nature of your updates (e.g. feature/fix_bug, feature/add_compound etc.) If you now type:

$ git branch

You will see that we are checked out onto the branch that you just created.

* feature/my-git-updates
main

Usage

Instructions below assume python is being simulated from the command line using a conda virtual environment and python version 3.9.10.

Dependencies are listed in the environment.yml file that is downloaded with the source code. These include:

Numpy, NetCDF4, Dateutil, Matplotlib, Basemap

To cloud-slice TROPOMI NO2 to obtain seasonal mean NO2 mixing ratios for June-August 2019 at 180-320 hPa on a 1 degree x 1 degree global grid, enter the following at the command line:

$ python cloud_slice_tropomi_no2.py --trop_dir="path-to-tropomi-data/" --out_dir="path-to-output-directory/" --cloud_product="fresco-wide" --no2_prod="OFFL" --cloud_threshold="07" --grid_res="1x1" --year="2019" --pmax="180" --pmin="450" --season="jja" > log_file

All arguments are input as strings.

Default input arguments are:

--grid_res="1x1"
--cloud-product="fresco-wide"
--cloud-threshold="07"
--pmin="180"
--pmax="450"
--no2-prod="PAL"
--version="v1"

Resolution options are limited to, in degrees latitude by degrees longitude:

1x1, 2x2.5, 4x5

The TROPOMI satellite data being read in assumed to be stored in the format ./NO2_$no2_prod/$year/$month/, where year and month are extracted from the season input information.

Output directory assumes to have ./Data/ subdirectory to store NetCDF files and ./Images/ subdirectory to store plots.

The –cloud_threshold input argument should be “07”, “08”, “09”, “10” to limit use to optically thick clouds and associated contamination from the target compound below clouds.

Recommended cloud top pressure ranges to use include 180-320 hPa, 320-450 hPa, 450-600 hPa, 600-800 hPa, and 800-1000 hPa. The code also offers the flexibility for the user to decide on cloud top height ranges difference to those recommended, but the difference between –pmin and –pmax must exceed 100 hPa. If not, the code will stop with an error message.

Help and reporting issues

GitHub is used to ask for help and reporting issues or bugs.

To ask a question, report a bug, or make a suggestion, open a new issue. When you do, please include your name and institution and include all relevant information for replicating the bug or issue.