Atmospheric Toolbox

About the HARP category

Discussions about the HARP software: support, examples, development ideas, etc.

I want to export a NetCDF file to raster to use it on Qgis or Arcmap…

File: ( )

Id already installed Anaconda, Visan and HARP. (Windows64)

When i open the environment with pyton and put the “harpconvert -a bin_spatial” command but always have syntax error.

Help please!!

Note that bin_spatial is a function that requires arguments.
You will need to give the information on the target grid you want.

There is actually a whole sequence of operations that you might want to perform in order to efficiently convert the product to a file that can be used in qgis. This includes applying the quality filter, removing unneeded variables, etc.

An example convert for the file that you provided (i.e. the parameters to bin_spatial are tailored for this specific O3 file) is:

harpconvert -a 'tropospheric_NO2_column_number_density_validity>75;keep(latitude_bounds,longitude_bounds,tropospheric_NO2_column_number_density);bin_spatial(2400,-37,0.01,3300,-83,0.01);derive(tropospheric_NO2_column_number_density [Pmolec/cm2]);squash(time, (latitude_bounds,longitude_bounds));derive(latitude {latitude});derive(longitude {longitude});exclude(latitude_bounds,longitude_bounds,count,weight)'

If you use a different product then modify parameters to the bin_spatial function accordingly.

See also the other forum threads such as Map Sentinel 5p CH4, SO2 and CO Data (Visan) for more details.

Hello svniemeijer
Verry thank you for the explanation.
Now i can export S5P data with HARP.

I have another question: I want to export the same S5P NO2 Data with the WPLOT Visan configuration to handle on Qgis.

This configuration, same size:

Can u help me with this bin_spatial function please
Thank u for your explanation again.


I am not entirely sure what you mean. Do you mean a plot without the filtering and unit conversion?

In that case use:

harpconvert -a 'keep(latitude_bounds,longitude_bounds,tropospheric_NO2_column_number_density);bin_spatial(2400,-37,0.01,3300,-83,0.01);squash(time, (latitude_bounds,longitude_bounds));derive(latitude {latitude});derive(longitude {longitude});exclude(latitude_bounds,longitude_bounds,count,weight)'

Thank you a lot !


Hi I need obtain puntual information about sentinel 5p, and I’m used a similar code but I don’t be what are this numbers (2400,-37,0.01,3300,-83,0.01).
You can help my.

The meaning of the values are explained in the HARP documentation for the bin_spatial operation.
The parameters are: lat_edge_length, lat_edge_offset, lat_edge_step, lon_edge_length, lon_edge_offset, and lon_edge_step.


Thanks for your explaination. but, I am still confused about these parameters. I mean, for instance, the dataset I have named ‘’, I do not know how to obtain or calculate these six parameters?
who can give me a hand? Many many thanks!

What is the range and resolution that you want for your latitude/longitude grid?

Hi thanks for your reply, spatial resolution is 7000m*3500m, and latitude/longitude grid? I’m not sure, how about worldwide, sorry for this stupid question, I’m freshman for this sensor data. how about one degree?

If you want a worldwide 1x1 degree grid then you would use bin_spatial(181,-90,1,361,-180,1): latitude starts at -90 with 1 degree steps (ending up after (181 - 1) steps at 90) and longitude starts at -180 with 1 degree steps (ending up after (361 - 1) steps at 180).

Hi many thanks! it works. another question, how do you know, this variable ‘tropospheric_NO2_column_number_density’, I tried gdalinfo to obtain meta data of my data, but I can’t find a variable named ‘tropospheric_NO2_column_number_density’, so where could I find useful variable or what varialbe could I change to ?
I observed meta data of this ‘‘’’ use gdalinfo, matlab’s function ncinfo

I also browse document of S5P named ‘Sentinel-5P-L01B-metadata-specifications.pdf’, ‘Sentinel-5P-Level-2-Product-User-Manual-Nitrogen-Dioxide.pdf’, ‘Sentinel-5P-Nitrogen-Dioxide-Level-2-Product-Readme-File.pdf’

while, I can not find a variable named ‘tropospheric_NO2_column_number_density’, so why it is ‘‘tropospheric_NO2_column_number_density’’ here?

Kind regards,

HARP actually performs a conversion of the S5P data to make everything more harmonised (and so it becomes easier to compare against other atmospheric data instruments).

The full mapping of the conversion that HARP performs can be found in the documentation. For S5P NO2 it is the Mapping description section of this page.

1 Like