How to filter data for OMI SO2

Hi Sander,

I’m trying to grid L2 OMI SO2 data which is supported by Harp. I can do it fine, but I need to incorporate the following data filters recommended by the data source:
Solar zenith angle < 60
Cloud Radiance Fraction < 0.3
OMI row number 4-54, 0-based
Additionally if you can calculate the air mass factor (from scattering weight and GEOS5 layer weight), you can have an additional filter: air mass factor > 0.3

Currently my code looks like this and I don’t know how to do the last two filters. Could you help me:

product = harp.import_product(r"/Users/varsharao/Downloads/May1_2020_SO2/*.he5", operations=‘solar_azimuth_angle<60;cloud_fraction<0.3;keep(latitude_bounds,longitude_bounds,SO2_column_number_density);bin_spatial(1801,-90,0.1,3601,-180,0.1);derive(SO2_column_number_density [DU])’, post_operations=“bin();squash(time, (latitude_bounds,longitude_bounds));derive(latitude {latitude});derive(longitude {longitude});exclude(latitude_bounds,longitude_bounds,latitude_bounds_weight,longitude_bounds_weight,count,weight)”)

Performing these additional filters as part of harp is currently not possible. We would have to update the SO2 ingestion in HARP to include these other variables.

An alternative approach is to read the OMI data yourself and construct a harp product in Python (similar to the example I provided in the other topic). You can then use harp.execute_operations to perform any operation (including filtering) based on the variables you have included in your harp product.

Note that you are currently filtering on the azimuth angle. This should be the zenith angle.