# Exporting a variable from a S5P dataset as georeferenced tif (or netcdf) file

**URL:** https://forum.atmospherictoolbox.org/t/exporting-a-variable-from-a-s5p-dataset-as-georeferenced-tif-or-netcdf-file/813
**Category:** HARP
**Tags:** sentinel-5p, python
**Created:** [July 30, 2024, 9:05pm UTC](https://forum.atmospherictoolbox.org/t/exporting-a-variable-from-a-s5p-dataset-as-georeferenced-tif-or-netcdf-file/813 "2024-07-30T21:05:18Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![ilungagustave](https://forum.atmospherictoolbox.org/letter_avatar_proxy/v4/letter/i/9fc348/32.png) [@ilungagustave](https://forum.atmospherictoolbox.org/u/ilungagustave)
#### Post date: [July 30, 2024, 9:05pm UTC](https://forum.atmospherictoolbox.org/t/exporting-a-variable-from-a-s5p-dataset-as-georeferenced-tif-or-netcdf-file/813/1 "2024-07-30T21:05:18Z")

</div>

Hi. I am discovering the harp library for python. I have the following questions.

I have a sentinel 5P O3 dataset. I managed to import it using the _harp.import\_product(file\_in)_ function.  
What I am seeking to achieve is to save the variable “tropospheric\_O3\_column\_number\_density” ideally as a georeferenced tif file (or a georeferenced netcdf file) that can be easily manipulated in QGIS for instance.  
I am stuck and any assistance is appreciated.

---

<div class="post-metadata">

### Author: ![sander.niemeijer](https://forum.atmospherictoolbox.org/user_avatar/forum.atmospherictoolbox.org/sander.niemeijer/32/5_2.png) [@sander.niemeijer](https://forum.atmospherictoolbox.org/u/sander.niemeijer)
#### Post date: [July 31, 2024, 7:25am UTC](https://forum.atmospherictoolbox.org/t/exporting-a-variable-from-a-s5p-dataset-as-georeferenced-tif-or-netcdf-file/813/2 "2024-07-31T07:25:57Z")

</div>

The best approach is likely to convert the data to L3 first. [This use case example](https://atmospherictoolbox.org/media/usecases/Usecase_4_S5P_NO2_LosAngeles_port.html) shows you how. That use case also shows you how to export the result to netcdf again.

Another option would be to download pre-generated L3 products directly from the [S5P-PAL Data Portal](https://data-portal.s5p-pal.com).

You should be able to use these L3 netcdf files directly in qgis.

---

<div class="post-metadata">

### Author: ![ilungagustave](https://forum.atmospherictoolbox.org/letter_avatar_proxy/v4/letter/i/9fc348/32.png) [@ilungagustave](https://forum.atmospherictoolbox.org/u/ilungagustave)
#### Post date: [July 31, 2024, 6:58pm UTC](https://forum.atmospherictoolbox.org/t/exporting-a-variable-from-a-s5p-dataset-as-georeferenced-tif-or-netcdf-file/813/3 "2024-07-31T18:58:07Z")

</div>

Thanks for pointing me to these resources. I really appreciate.

I followed the instructions on the use case. Everything seems to be running well. However, when I tried to export the product, I received the following error. Any ideas what might be the issue?

 ![image](https://forum.atmospherictoolbox.org/uploads/default/original/1X/2b857eb737e9ad77dbce26182e4e7d6e32d6adb2.png)

---

<div class="post-metadata">

### Author: ![sander.niemeijer](https://forum.atmospherictoolbox.org/user_avatar/forum.atmospherictoolbox.org/sander.niemeijer/32/5_2.png) [@sander.niemeijer](https://forum.atmospherictoolbox.org/u/sander.niemeijer)
#### Post date: [August 1, 2024, 7:31am UTC](https://forum.atmospherictoolbox.org/t/exporting-a-variable-from-a-s5p-dataset-as-georeferenced-tif-or-netcdf-file/813/4 "2024-08-01T07:31:59Z")

</div>

This was a numpy v2.0 incompatibility of HARP. We just released a new HARP version that fixes this.  
If you recreate your conda environment you should get HARP 1.23 which should no longer have this issue.

---

<div class="post-metadata">

### Author: ![ilungagustave](https://forum.atmospherictoolbox.org/letter_avatar_proxy/v4/letter/i/9fc348/32.png) [@ilungagustave](https://forum.atmospherictoolbox.org/u/ilungagustave)
#### Post date: [August 3, 2024, 6:07am UTC](https://forum.atmospherictoolbox.org/t/exporting-a-variable-from-a-s5p-dataset-as-georeferenced-tif-or-netcdf-file/813/5 "2024-08-03T06:07:50Z")

</div>

Thanks very much. Everything works perfectly.

NO2 et O3 measurements from S5P are for the tropospheric columns and expressed in mol/m2. Do you perhaps know a method to convert them to ground-level NO2 and O3 measurements expressed in mg/m3 (that I could compare to local air quality station data)? Thanks for your help

---

<div class="post-metadata">

### Author: ![sander.niemeijer](https://forum.atmospherictoolbox.org/user_avatar/forum.atmospherictoolbox.org/sander.niemeijer/32/5_2.png) [@sander.niemeijer](https://forum.atmospherictoolbox.org/u/sander.niemeijer)
#### Post date: [August 5, 2024, 7:54am UTC](https://forum.atmospherictoolbox.org/t/exporting-a-variable-from-a-s5p-dataset-as-georeferenced-tif-or-netcdf-file/813/6 "2024-08-05T07:54:04Z")

</div>

This question is similar to [this one](https://forum.atmospherictoolbox.org/t/derive-ppb-ppm-of-tropospheric-no2/). Unfortunately, satellites such as S5P are not really sensitive for concentrations at the surface. See also the response [here](https://forum.atmospherictoolbox.org/t/map-sentinel-5p-ch4-so2-and-co-data-visan/45/22).
