EO Training

AIR QUALITY MONITORING WITH S5-P

Categories: Atmosphere,

AIR QUALITY MONITORING WITH S5-P

Introduction Print

Air pollution is a major environmental health problem that affects people in developed and developing countries alike. With millions of people dying prematurely every year as a direct result of poor air quality, it has never been more important to monitor the air we breathe.

Pollutants enter the air from a range of sources, although they are mainly a result of motor vehicle and industrial combustion processes. Governments and decision-makers rely heavily on satellite data and computer models to show how pollution accumulates and how it is carried in the air so that they can develop appropriate mitigation strategies.

A few years ago, the European Union (EU) started an ambitious program, Copernicus, which includes the launch of a new family of earth observation satellites known as Sentinels. Sentinel-5p provides timely data on a multitude of trace gases (CO, NO2, SO2, O3, aerosols…) with a great accuracy and spatial resolution. It also provides measurement continuity with precedent and ongoing atmospheric spatial missions (OMI, IASI and SCHIAMACHY).

Note: This exercise was developed by the Serco EO Training Team within the framework of the RUS contract. The final outcome of this tutorial has not been validated and the information contained in this tutorial does not purport to constitute professional advice.

Data used
  • 13 Sentinel-5p images acquired on May 17th 2019 (Exercise on global visualization and merging of the Aerosol Index)
  • 17 Sentinel-5p images acquired between 02-21 November 2018 over California (Exercise on Monitoring fire using Aerosol Index)
  • 14 Sentinel-5p images acquired on 24th January 2019 (Exercise on daily Tropospheric vertical NO2 column)
  • 434 Sentinel-5p images acquired between 01-31 January 2019 (Exercise on monthly Tropospheric vertical NO2 column)
Software used

Internet browser, Atmospheric Toolbox, QGIS

Reference folder structure

Folder structure referenced in the exercise is as follows:

  • /ATMO01_AirQuality_Global
    • /Original – should contain your downloaded input products
      • /NO2
      • /Fire_California
    • /Processing – Contains all intermediate and final results of the processing organized in subfolders
      • /L3_GriddedProducts
      • /Fire_California
      • /NO2
        • /NO2_GlobalAverage
        • /Global

Data download – ESA SciHUB

Before starting the exercise, make sure you are registered in the Copernicus Open Access Hub so that you can access the free data provided by the Sentinel satellites.
Go to https://scihub.copernicus.eu/

Go to S-5P Pre-Ops. If you do not have an account, sign up in the upper right corner, fill in the details and click register. (see NOTE 1)

NOTE 1: Currently, Sentinel-5p products are still only accessible through the Sentinel-5p Pre-Operations Data Hub. To download S-5p products, log in using s5pguest as username and password. In the near future, products will be moved to the regular Copernicus Open Access Hub where you will be requested to log in with your own credentials.

Since we are targeting the production of global maps, we do not need to define a specific study area in our search. Open the search menu by clicking to the left part of the search bar (the three lines) and specify the parameters below. Press the search icon after that.
Sensing period: From 2019/05/17 to 2019/05/17
Check Mission: Sentinel-5p
Product type: L2__AER_AI
Processing level: L2 Timeliness: Offline

In this case the search returns 13 results (see NOTE 2). Download all the products (see NOTE 3), create a folder…/ATMO01_AirQuality_Global/Original/ and move the files to it.

NOTE 2: Sentinel-5p counts 14 orbits per day. Due to the starting (d) and end acquisition time (d+1) during the last orbit, when looking for all the products of a day the result may output 13 products instead of 14. To complete the global coverage, you may need to increase by one day the sensing time to find the last product.

NOTE 3: Sentinel-5p products are delivered as netCDF files. The Network Common Data Form, or netCDF, is an interface to a library of data access functions for storing and retrieving data in the form of arrays. An array is an n-dimensional (where n is 0, 1, 2, …) rectangular structure containing items which all have the same data type (e.g., 8-bit character, 32-bit integer). A scalar (simple single value) is a 0-dimensional array. a large amount of free software as well as commercial or licensed packages is available at the UniData website.

VISAN – open and explore data

In this exercise we will use the Atmospheric Toolbox to analyze the Sentinel-5p data and run our analysis. This toolbox project aims to provide scientists with tools for ingesting, processing, and analyzing atmospheric remote sensing data.
It consists of several components, with the main components being CODA, HARP, and VISAN. These components are made available by means of several software packages.

  • CODA: allows direct reading access to product data, supporting a very wide range of products. All product file data is accessible via the CODA C library. On top of this, there are several interfaces available to directly ingest product data using e.g. Fortran, IDL, MATLAB, and Python.
  • HARP: toolset for ingesting, processing and inter-comparing satellite or model data against correlative data. The toolset provides a set of command line tools, a library of analysis functions, and direct import/export interfaces for Python, IDL, and MATLAB. By appropriately chaining calls to the HARP command line tools one can preprocess satellite and correlative data such that the two datasets that need to be compared end up having the same temporal/spatial grid, same data format/structure, and same physical unit.
  • VISAN: cross-platform visualization and analysis application for atmospheric data. The application uses the Python language as the means through which you provide commands to the application. The Python interfaces for CODA and HARP are included so you can directly ingest product data from within VISAN (HARP interfaces will be added once the HARP Python interface becomes available). Finally, VISAN provides some very powerful visualization functionality for 2D and world plots.

The primary instruments supported by the Atmospheric Toolbox are Tropomi (Sentinel-5P), GOME-2 and IASI (MetOp), OMI, TES and MLS (Aura), GOMOS, MIPAS, and SCIAMACHY (ENVISAT), and GOME (ERS-2). More information on the BEAT project can be found at http://www.stcorp.nl/beat/
In the desktop, double click on the VISAN icon to open it. The command line interface will appear together with the help window (if it is the first time you use VISAN, read the help window and close it afterwards).

In the File menu, click on Browse Product, navigate to the …/Original folder and open the first Sentinel-5p product: S5P_OFFL_L2__AER_AI_20190517T005850_20190517T024020_08238_01_010301_20190523T002750.nc

Once opened, VISAN gives you the option to navigate the Sentinel-5p product (PRODUCT folder) and access metadata (METADATA folder) information. The PRODUCT folder contains data of interest as 2D arrays (Aerosol index, error estimates, quality index…). The SUPPORT_DATA subfolder contains additional and auxiliary data (geolocation flags, lat/lon bounds, satellite position, etc.). Within the PRODUCT folder, select the aerosol_index_340_380 file.

Click on the 2D Grid to visualize the 2D array. For each variable, it is possible to check the whole product (all rows/columns), a specific row/column and its attributes (Attributes tab).

Next, click on the 2D Plot. Set the x-axis coordinates to 0; 614; 0 to visualize a 2D plot.

After visualizing the data as an array and 2D graph, we will create a 3D visualization of the product. Close the browse product window on the main VISAN page and go to File Harp Import. This menu will create the Python command to perform an import on a product. This menu will create the Python command to perform an import on a product.
In the Path option, navigate to the …/Original folder and select the same product as before:
(Sixth from the top – S5P_OFFL_L2__AER_AI_20190517T092621_20190517T110751_08243_01_010301_20190523T085237.nc)
The Operations option gives the possibility to provide a single string where individual operations are separated by a semi colon (i.e. ‘latitude>-55[degree_north];bin()’). For this exercise, leave the Operations option empty (See NOTE 4).

NOTE 4: HARP provides a simple expression syntax with which one can specify operations that need to be performed on a product. A list of operations is always provided as a single string where individual operations are separated by a semi-colon (;). Each operation can be either a comparison filter, a membership test filter, or a function call. Strings used in operations should be quoted with double quotes. More information at: http://stcorp.github.io/harp/doc/html/operations.html.

The Ingestion option gives the option to ingest different variables from the Sentinel-5p product to the HARP converted product (i.e. which aerosol index to keep in the ingested product). For this exercise, leave the Ingestion option empty (See NOTE 5).

NOTE 5: HARP can ingest data from various types of products. HARP will try to automatically determine the product type of each file that you pass to the ingest function. An error will be raised if the product type of a file cannot be determined. For each ingestion, HARP will return a single HARP product. Each variable in a HARP product represents a specific quantity (e.g. O3 number density, cloud fraction, altitude, longitude, latitude, time, et cetera). You can customize which variables you want to include using the include() and exclude() operations that can be passed to the ingest function. More information at: http://stcorp.github.io/harp/doc/html/ingestions/.

Next, in the Variable name option, write S5p_AER to name the imported product. Finally, click Import. The python command used can be seen in the main VISAN window.

Once the product has been imported, we can use specific code to manipulate and visualize the data. In the VISAN window write the following command and press ENTER. (See NOTE 6).

NOTE 6: Much of VISAN’s functionality is provided by Python and the Numpy package, which are both part of VISAN. For an overview of the functions provided please look at the Python and Numpy documentation. More information at http://www.stcorp.nl/beat/doc/visan/reference.html.

wplot(S5p_AER)

To move on the VISAN World Plot window, maintain the left button of your mouse and move it in the appropriate direction. To zoom in/out, maintain the right button of the mouse and move it to the top/bottom of the window. Invalid data is present in the poles.

You can change the display settings (color table, color bar, projection, etc.). For that, go to View Properties in the plot window and change the parameters according to your preference. When changing a parameter, press the ENTER key of your keyboard to validate the change.

Level 3 Aerosol Index gridded product

With the objective to create a world map of the aerosol index, we first need to process the Sentinel-5p Level 2 products to keep a single grid per orbit (level 3 – L3). The conversion is done combining several operators in a single call. The sub-chapters below give more information on each step.

HARP bin_spatial operation

The HARP bin_spatial() tool maps all time samples onto a regular spatial lat/lon grid for all variables in a product. It follows a specific sequence of parameters shown below:

The choice of the spatial resolution (lat/lon_edge_step) and the boundaries (lat/lon_edge_offset, lat/lon_edge_length) can be chosen by the user. Please note that a higher spatial resolution and a larger area of interest increase the processing time (See NOTE 7).

HARP derive operation

When spatially binning a product with bin_spatial(), only the lat/lon_bounds of the grid cells will be saved in the output product. To write the lat/lon center coordinates of the spatial grid in the output we use the derive operation.

HARP Comparison filter operation

This operator filters a dimension for all variables in the product such that items for which the value of the provided variable does not match the expression get excluded.

HARP Convert Command line tool

Once the concept of the steps we will combine is clear, we will use the command line tool to combine all of them and apply it to our product. The tool allows to define a list of operations (in our case, bin_spatial() ; derive() ; comparison) to apply to each product using the -a parameter, to define ingestion options using the -o parameter and to define the output format using the -f parameter (the default NETCDF format will be used in this exercise). (see NOTE 8)

NOTE 8: Before proceeding to the next step, you should create a new folder Processing containing a folder L3_GriddedProducts, where all newly generated products will be saved. The path should be: …/ATMO01_AirQuality_Global/Processing/L3_GriddedProducts

To run the command, go to the following path where all the input Sentinel-5p level 2 UV Aerosol Index products are stored. Right click anywhere on the folder and select Open Terminal Here.
Path:…/ATMO01_AirQuality_Global/Original/

Copy/Paste the following command in the Terminal window and press Enter to run it. The output directory where the result will be saved has been set to the following path: …/ATMO01_AirQuality_Global/Processing/L3_GriddedProducts/ (Replace paths in code appropriately to your system)

harpconvert -a 'latitude > -55 [degree_north]; latitude < 80 [degree_north]; bin_spatial(271,-55,0.5,721,-180,0.5); derive(latitude {latitude}); derive(longitude {longitude})' .../ATMO01_AirQuality_Global/Original/S5P_OFFL_L2__AER_AI_20190517T092621_20190517T110751_08243_01_010301_20190523T085237.nc .../ATMO01_AirQuality_Global/Processing/L3_GriddedProducts/Converted_Product.nc

Once run, go to File Harp import in the main VISAN window to import the output product and visualize it. In the file path, navigate to the output path specify before and select the output product.

Leave the operations and ingestion options as default and change the variable name to AER_L3. Next, click Import.

As before, once the product has been imported, we can use specific code to manipulate and visualize the data. In the VISAN window write the following command and press enter (See NOTE 9).

NOTE 9: Go to View Properties to change the display settings such as the color bar name, min/max values, color palette, etc…

wplot(AER_L3.latitude.data,AER_L3.longitude.data,AER_L3.absorbing_aerosol_index.data)

Daily averaged Aerosol Index product

Sentinel-5p Offline products are delivered as single file orbits. To create a world map using the all the products available within a day, they all need to be processed as explained before and merged. Once each Sentinel-5p product is processed to keep a single grid per orbit, we will concatenate all the output files to create a World Map.
For this we will use the HARPMERGE operator, which combines multiple products from files or directory by appending them across the time dimension and storing the result into a single output file. When running HARPMERGE, we will include to code to:

  • Define a list of operations to apply to each product before it is appended (-a): same processing as HARPCONVERT done in the previous chapter
  • Define a list of operations to apply to the merged product (-ap): operation to properly export the merged product. The bin() operation will average each of the lat/lon grid cells over time so that we have {1,lat,lon} elements. The squash(time, (latitude, longitude)) will remove the time=1 dimension created by the bin() operation from lat/lon variables to have proper georeferenced products for further use in other software (i.e. QGIS, Panoply…)
  • In addition, ingestion options (-o) and output format (-f) could be defined

Go to the following path where all the input Sentinel-5p level 2 UV Aerosol Index products are stored. Right click anywhere on the folder and select Open Terminal Here.
Path: …/ATMO01_AirQuality_Global/Original/

Copy/Paste the following command in the Terminal window and press Enter to run it. The code will create an average World Map for latitudes between [-55,80] for UV Aerosol Index on the 17/05/2019 for the 354/388 wavelength pair. The output directory where the result will be saved has been set to the following path:
Path: …/ATMO01_AirQuality_Global/Processing/L3_GriddedProducts/ (Replace paths in code appropriately to your system)

harpmerge -ap 'bin(); squash(time, (latitude,longitude))' -a 'latitude > -55 [degree_north]; latitude < 80 [degree_north]; bin_spatial(271,-55,0.5,721,-180,0.5); derive(longitude {longitude}); derive(latitude {latitude})' S5P_OFFL_L2__AER*.nc .../ATMO01_AirQuality_Global/Processing/L3_GriddedProducts/Global_AER_L3.nc

Once run, go to File Harp import in the main VISAN window to import the output product and visualize it. In the file path, navigate to the output path specify before and select the output product. Leave the operations and ingestion options as default and change the variable name to L3_Global. Next, click Import.

As before, once the product has been imported, we can use specific code to manipulate and visualize the data. In the VISAN window insert the following command and press enter.

wplot(L3_Global.latitude.data,L3_Global.longitude.data,L3_Global.absorbing_aerosol_index.data)

Single orbit products have been re-gridded and properly concatenated into a single averaged Aerosol Index product (See NOTE 9).

NOTE 9: Some spots over the ocean have high aerosol index values caused by the sun glint. Pixels affected by sun glint can be filtered out by applying a quality filter when executing the HARPMERGE command line tool (-absorbing_aerosol_index_validity > 80) (0: worst quality | 100: full quality).

Monitoring fire using Aerosol Index

Taking advantage of the Sentinel-5p temporal resolution, in this section we will explore the capabilities to monitor a fire event in California (U.S.A.) using the aerosol index level 2 product.
The 2018 wildfire season was the deadliest and most destructive wildfire season on record in California, with a total of 8,527 fires burning an area of 766,439 ha. In November 2018, strong winds aggravated conditions in another round of large, destructive fires that occurred across the state. This new batch of wildfires included the Woolsey Fire and the Camp Fire, becoming both California’s deadliest and most destructive wildfire on record.
To proceed to this new exercise, close the Terminal window.

Data download – ESA SciHUB

To download the data for this exercise go to the Sentinel-5p Pre-Operations Data Hub, log in as explained before and copy paste the following product names in the search bar. Then, click on search and download each product.

S5P_OFFL_L2__AER_AI_20181102T204153_20181102T222322_05469_01_010200_20181108T200727
S5P_OFFL_L2__AER_AI_20181103T202245_20181103T220415_05483_01_010200_20181109T194206
S5P_OFFL_L2__AER_AI_20181104T200338_20181104T214507_05497_01_010200_20181110T192244
S5P_OFFL_L2__AER_AI_20181105T194430_20181105T212600_05511_01_010200_20181111T190324
S5P_OFFL_L2__AER_AI_20181106T192523_20181106T210652_05525_01_010200_20181112T184406
S5P_OFFL_L2__AER_AI_20181107T204745_20181107T222915_05540_01_010200_20181113T201448
S5P_OFFL_L2__AER_AI_20181108T202838_20181108T221007_05554_01_010200_20181114T195528
S5P_OFFL_L2__AER_AI_20181109T200931_20181109T215100_05568_01_010200_20181115T193606
S5P_OFFL_L2__AER_AI_20181110T195023_20181110T213153_05582_01_010200_20181116T191647
S5P_OFFL_L2__AER_AI_20181111T193116_20181111T211246_05596_01_010200_20181117T185728
S5P_OFFL_L2__AER_AI_20181112T191210_20181112T205339_05610_01_010200_20181118T183807
S5P_OFFL_L2__AER_AI_20181114T201526_20181114T215655_05639_01_010200_20181120T193926
S5P_OFFL_L2__AER_AI_20181116T193712_20181116T211842_05667_01_010200_20181122T185737
S5P_OFFL_L2__AER_AI_20181117T191806_20181117T205936_05681_01_010200_20181123T184418
S5P_OFFL_L2__AER_AI_20181118T204029_20181118T222159_05696_01_010200_20181124T200555
S5P_OFFL_L2__AER_AI_20181120T200217_20181120T214347_05724_01_010200_20181126T192906
S5P_OFFL_L2__AER_AI_20181121T194311_20181121T212441_05738_01_010200_20181127T191033

Make sure to save all downloaded files to a new folder Fire_California that you will create in the Original folder. Create also a new folder Fire_California located in the Processing folder.

Data processing

In the file browser, navigate to the following path, right click anywhere in the folder and click on Open Terminal Here.
Path: …/ATMO01_AirQuality_Global/Original/Fire_California/

Copy/Paste the following command in the Terminal window and press Enter to run it. The output directory where the result will be saved has been set to the following path: …/ATMO01_AirQuality_Global/Processing/Fire_California/ (Replace paths in code appropriately to your system)

harpmerge -a 'latitude > 32 [degree_north]; latitude < 42 [degree_north]; longitude > -126 [degree_east]; longitude < -116 [degree_east]; absorbing_aerosol_index_validity>80; bin_spatial(101,32,0.1,101,-126,0.1); derive(longitude {longitude});derive(latitude {latitude})' S5P_OFFL_L2__AER*.nc .../ATMO01_AirQuality_Global/Processing/Fire_California/l3_AER_AI_20191102_20191121.nc

In this case, the -ap ‘bin(); squash(time, (latitude,longitude))’ command is not used as we want to keep the time dimension in the merged product to create an animated plot.
Next, go to File Harp import in the VISAN window to import the output product and visualize it. In the file path, navigate to the output path specify before and select the output product. Leave the operations and ingestion options as default and change the variable name to Fire. Next, click Import.

As before, once the product has been imported, we can use specific code to manipulate and visualize the data. In the VISAN window write the following command and press enter.

wplot(Fire)

To create the animated plot, in the plot window go to View Properties. In the Plot tab, change the title to: Camp fire (California 02-21 November 2018) UV Aerosol Index. Next, navigate to the Camp Fire location (California, U.S.A.) and zoom in using your mouse (you can also set the coordinates as shown in the screenshot).

In the Dataset Color Bar tab, change the following parameters:

  • Color bar tittle: Absorbing aerosol index (354/388 nm)
  • Number of labels: 5
  • Range Min: -5
  • Range Max: 5

In the Attributes tab you can visualize the timeframe of the product being displayed.

At the bottom of the VISAN world plot window, select the Loop option. Set the Speed to 1 and press Play. The plot displays the evolution of the generated aerosol plume.

Tropospheric vertical NO2 column

To explore the capabilities of Sentinel-5p to detect and monitor other air pollutants, we will create a daily averaged tropospheric vertical NO2 column using Sentinel-5p level 2 NO2 products. For that, close the current Terminal window.

Data download – ESA SciHUB

To download the data for this exercise go to the Sentinel-5p Pre-Operations Data Hub, log in as explained before and copy paste the following product names in the search bar. Then, click on search and download each product.

S5P_OFFL_L2__NO2____20190124T010650_20190124T024820_06635_01_010202_20190130T024317
S5P_OFFL_L2__NO2____20190124T024820_20190124T042951_06636_01_010202_20190130T043730
S5P_OFFL_L2__NO2____20190124T042951_20190124T061121_06637_01_010202_20190130T061522
S5P_OFFL_L2__NO2____20190124T061121_20190124T075251_06638_01_010202_20190130T080926
S5P_OFFL_L2__NO2____20190124T075251_20190124T093421_06639_01_010202_20190130T094112
S5P_OFFL_L2__NO2____20190124T093421_20190124T111551_06640_01_010202_20190130T113605
S5P_OFFL_L2__NO2____20190124T111551_20190124T125722_06641_01_010202_20190130T143915
S5P_OFFL_L2__NO2____20190124T125722_20190124T143852_06642_01_010202_20190130T151234
S5P_OFFL_L2__NO2____20190124T143852_20190124T162022_06643_01_010202_20190130T161125
S5P_OFFL_L2__NO2____20190124T162022_20190124T180152_06644_01_010202_20190130T182515
S5P_OFFL_L2__NO2____20190124T180152_20190124T194322_06645_01_010202_20190130T201724
S5P_OFFL_L2__NO2____20190124T194322_20190124T212452_06646_01_010202_20190130T214447
S5P_OFFL_L2__NO2____20190124T212452_20190124T230622_06647_01_010202_20190131T080338
S5P_OFFL_L2__NO2____20190124T230622_20190125T004753_06648_01_010202_20190131T004111

Make sure to save all downloaded files to a new folder NO2 that you will create in the Original folder. Create also a new folder NO2 located in the Processing folder.

Daily averaged tropospheric NO2 vertical column

In the file browser, navigate to the following path, right click anywhere in the folder and click on Open Terminal Here.
Path: …/ATMO01_AirQuality_Global/Original/N02/

Copy/Paste the following command in the Terminal window and press Enter to run it. The output directory where the result will be saved has been set to the following path: …/ATMO01_AirQuality_Global/Processing/NO2/ (Replace paths in code appropriately to your system)

harpmerge -ap 'bin(); squash(time, (latitude,longitude))' -a 'latitude > -55 [degree_north]; latitude < 60 [degree_north]; tropospheric_NO2_column_number_density_validity > 75; bin_spatial(231,-55,0.5,721,-180,0.5); derive(longitude {longitude});derive(latitude {latitude})' S5P_OFFL_L2__NO2*.nc .../ATMO01_AirQuality_Global/Processing/NO2/l3_NO2_20190124_quality_75.nc

The command builds a daily averaged world map for latitudes between [-55,60] of tropospheric vertical column of NO2 on 24/01/2019 with full quality data. The value of the tropospheric_NO2_column_number_density_validity is set to 75 as it is the recommended pixel filter to remove cloud/snow/ice covered scenes, errors and problematic retrieval.

Once run, go to File Harp import in the main VISAN window to import the output product and visualize it. In the file path, navigate to the output path specify before and select the output product. Leave the operations and ingestion options as default and change the variable name to NO2. Next, click Import.

As before, once the product has been imported, we can use specific code to manipulate and visualize the data. In the VISAN window write the following command and press enter.

wplot(NO2)

Single orbit products have been re-gridded and properly concatenated into a single averaged tropospheric vertical column of NO2 products. To improve the visualization, change the Min/Max values of the color bar to 0 and 0.000075 mol/m2 respectively.

Due to the air pollution present in urban areas, the world’s major cities are easily identifiable. Due to cloud coverage, large invalid areas are visible.

Monthly averaged tropospheric NO2 vertical column

In this last part, we will derive a monthly averaged tropospheric vertical NO2 column using Sentinel-5p level 2 NO2 products. For that, close the current Terminal window.

Data download – ESA SciHub

Download from the the Sentinel-5p Pre-Operations Data Hub all S5P_OFFL_L2__NO2 products for the month of January 2019, ensuring to create a dedicated folder for each date (eg. …/ATMO01_AirQuality_Global/Original/NO2/01012019 , …/ATMO01_AirQuality_Global/Original/NO2/01022019, ...).

Create a new folder NO2_GlobalAverage in the Processing/NO2 folder. Create also a new folder Global located in the Processing/NO2 folder.

Generate the daily averaged tropospheric NO2 vertical column for each date

For each NO2 product you have saved in the folder …/ATMO01_AirQuality_Global/Original/NO2/ {date} you should now generate the Daily averaged tropospheric NO2 vertical column, following the steps discussed previously: for instance to create the daily average of first January, in the file browser, navigate to the path …/ATMO01_AirQuality_Global/Original/N02/01012019, right click anywhere in the folder and click on Open Terminal Here. (see NOTE 10)

NOTE 10: If you have already generated in the previous step the daily average for 24 January, no need to repeat the processing for that date and you could simply copy l3_NO2_20190124_quality_75.nc from …/ATMO01_AirQuality_Global/Processing/NO2 to …/ATMO01_AirQuality_Global/Processing/NO2/NO2_GlobalAverage

Update the following command in the Terminal window changing each time the input data and path and press Enter to run it. The output directory where the result will be saved has been set to the following path: …/ATMO01_AirQuality_Global/Processing/NO2/NO2_GlobalAverage

(Replace paths in code appropriately to your system)

harpmerge -ap 'bin(); squash(time, (latitude,longitude))' -a 'latitude &gt; -55 [degree_north]; latitude &lt; 60 [degree_north]; tropospheric_NO2_column_number_density_validity &gt; 75; bin_spatial(231,-55,0.5,721,-180,0.5); derive(longitude {longitude});derive(latitude {latitude})' S5P_OFFL_L2__NO2*.nc .../ATMO01_AirQuality_Global/Processing/NO2/NO2_GlobalAverage/l3_NO2_20190101_quality_75.nc

Generate the monthy averaged tropospheric NO2 vertical column

After the creation of the daily averaged tropospheric NO2 column, close the current Terminal window. Open a file browser and navigate to the directory where all the products have been saved: …/ATMO01_AirQuality_Global/Processing/NO2/NO2_GlobalAverage/ Right click anywhere in the folder and click Open Terminal Here.

Copy/Paste the following command in the Terminal window and press Enter to run it. The output directory where the result will be saved has been set to the following path: …/ATMO01_AirQuality_Global/Processing/NO2/Global/ (Replace paths in code appropriately to your system)

harpmerge -ap 'bin(); squash(time, (latitude,longitude))' l3_201901*.nc .../ATMO01_AirQuality_Global/Processing/NO2/Global/l3_NO2_201901_quality_75.nc

The command builds a monthly averaged world map for latitudes between [-55,60] of tropospheric vertical column of NO2
Once run, go to File Harp import in the main VISAN window to import the output product and visualize it. In the file path, navigate to the output path specify before and select the output product. Leave the operations and ingestion options as default and change the variable name to NO2_month. Next, click Import.

As before, once the product has been imported, we can use specific code to manipulate and visualize the data. In the VISAN window write the following command and press enter.

wplot(NO2_month)

Daily averaged products have been properly concatenated into a single monthly averaged tropospheric vertical column of NO2 products. To improve the visualization, change the Min/Max values of the color bar to 0 and 0.000075 mol/m2 respectively.

Further reading and resources

Doing business with us

EO expertise at your service

We are used to prepare and release training materials, but also to work in partnership with the Earth Observation industry and we may complement your business case with training or consultancy services. Do not hesitate to get in touch with us to get an offer for a customized training event or EO consultancy services…