Find maximum NO2 consentration in monthly analysis

Hello! I’m doing a monthly mean analysis about NO2 with python and HARP. I’m wondering how i can compute, e.g for 31 products for January 2024, the product that has the maximum average consentration and plot it. Any ideas?

Thank you very much!

If you want a global average, you can rebin the data to a grid that is just 1x1 (i.e. a single cell).
If you do that per grid, you can create a time series of these global averages like so:

product = harp.import_product("s5p-grid*.nc", "rebin(latitude,latitude_bounds [degree_north],2,-90,180);rebin(longitude,longitude_bounds [degree_east],2,-180,360);squash(latitude, tropospheric_NO2_column_number_density);squash(longitude, tropospheric_NO2_column_number_density)")
print(product.tropospheric_NO2_column_number_density.data)

You can then find the index of the maximum value from that array and use that index to retrieve the corresponding daily grid.

Thank you for your response and your time!

I’m a little bit confused about the case i want to do the process in a specific region. The region I’m interested in is Cyprus. I’m doing first the validity filter, bin_spatial and then the method you suggested.
I suppose it is not the right way as something goes wrong and also returns NaN values.
The operations im using are the following:

operations = “;”.join([
“tropospheric_NO2_column_number_density_validity>75”,
“keep(latitude_bounds,longitude_bounds,tropospheric_NO2_column_number_density)”,
“bin_spatial(101, 34, 0.02, 201, 31, 0.02)”,
“rebin(latitude,latitude_bounds [degree_north],2,34.56,35.70);rebin(longitude,longitude_bounds [degree_east],2, 32.27,34.59)”,
“squash(latitude, tropospheric_NO2_column_number_density)”,
“squash(longitude, tropospheric_NO2_column_number_density)”,
])

The idea is to first generate the daily grid files (based on the 14 a 15 orbits per day). And then call harp again on those daily grid files with the steps I provided.