# S5P CH4 | Column ppb to column number density mol/m2 conversion

**URL:** https://forum.atmospherictoolbox.org/t/s5p-ch4-column-ppb-to-column-number-density-mol-m2-conversion/109
**Category:** HARP
**Tags:** idl
**Created:** [April 16, 2020, 9:55am UTC](https://forum.atmospherictoolbox.org/t/s5p-ch4-column-ppb-to-column-number-density-mol-m2-conversion/109 "2020-04-16T09:55:24Z")
**Posts on this page:** 9
**Page:** 1

<div class="post-metadata">

### Author: ![mariliza](https://forum.atmospherictoolbox.org/letter_avatar_proxy/v4/letter/m/c77e96/32.png) [@mariliza](https://forum.atmospherictoolbox.org/u/mariliza)
#### Post date: [April 16, 2020, 9:55am UTC](https://forum.atmospherictoolbox.org/t/s5p-ch4-column-ppb-to-column-number-density-mol-m2-conversion/109/1 "2020-04-16T09:55:25Z")

</div>

Dear Sander,

This question refers to S5P CH4 data. I went through the [Map Sentinel 5p CH4, SO2 and CO Data (Visan)](https://forum.atmospherictoolbox.org/t/map-sentinel-5p-ch4-so2-and-co-data-visan/45) post but couldn’t find what I was looking for.

The CH4 file contains the CH4\_column\_volume\_mixing\_ratio\_dry\_air in ppb. Can this be transformed into a CH4\_column\_number density in mol/m2? I tried the operation, using derive, but it didn’t work and something tells me that harp is expecting to read CH4\_column\_volume\_mixing\_ratio and not CH4\_column\_volume\_mixing\_ratio\_dry\_air.

Can I use the dry\_air\_column\_number\_density to convert? I’ll just have to sum it first, since this is a profile, right?

And then it is simple multiplication, as per equation 1 from  
[http://stcorp.github.io/harp/doc/html/algorithms/derivations/column\_volume\_mixing\_ratio.html](http://stcorp.github.io/harp/doc/html/algorithms/derivations/column_volume_mixing_ratio.html)

Or maybe not?

Many thanks!

MariLiza

---

<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: [April 16, 2020, 10:48am UTC](https://forum.atmospherictoolbox.org/t/s5p-ch4-column-ppb-to-column-number-density-mol-m2-conversion/109/2 "2020-04-16T10:48:59Z")

</div>

This is an omission in HARP.

Note that the Algorithms documentation of HARP shows you how variables can be derived from inputs (it works only one-way). We did have algorithms that can derive [column vmr from column number density](http://stcorp.github.io/harp/doc/html/algorithms/derivations/column_volume_mixing_ratio.html) but we didn’t have ones that produced [column nd from column vmr](http://stcorp.github.io/harp/doc/html/algorithms/derivations/column_number_density.html).

We just committed a change that introduces these missing conversions (and these will be included in the next official HARP release). The online documentation already shows these new derivations.

What is also useful to know is that running `harpdump --list-derivations` on a product will show you which variables HARP is able to generate based on the content of the product itself (and how it will do this).  
If you expect that some variable should be able to be derived, but isn’t in the list, then please raise a request on this forum and we will see whether we can have this added.

---

<div class="post-metadata">

### Author: ![mariliza](https://forum.atmospherictoolbox.org/letter_avatar_proxy/v4/letter/m/c77e96/32.png) [@mariliza](https://forum.atmospherictoolbox.org/u/mariliza)
#### Post date: [February 16, 2022, 12:13pm UTC](https://forum.atmospherictoolbox.org/t/s5p-ch4-column-ppb-to-column-number-density-mol-m2-conversion/109/3 "2022-02-16T12:13:52Z")

</div>

> [@mariliza](#):
>
> CH4\_column\_number density in mol/m2

Dear Sander,

I am updating my old IDL ingestion routines for S5P CH4. I note that now the derivation for CH4\_column\_number\_density from CH4\_volume\_mixing\_ratio\_dry\_air is included in harp 1.14, which is excellent.

CH4\_column\_number\_density {time} [molec/m2] (double) from  
CH4\_volume\_mixing\_ratio\_dry\_air {time} [ppv] (double)  
dry\_air\_column\_number\_density {time} [molec/m2] (double)

However, in the S5P CH4 files, the dry\_air\_column\_number\_density has an extra dimension, the altitude, and is naturally delivered in mol/m2.

**dry\_air\_column\_number\_density** float {_time_, _vertical_} [mol/m2] column number density profile of dry air

For this reason, I tried to first derive the dry\_air\_column\_number\_density in [molec/m2].

IDL responds with an error.

product2 = harp\_import(file,‘CH4\_column\_volume\_mixing\_ratio\_dry\_air\_validity\>50;derive(dry\_air\_column\_number\_density[molec/m2]);derive(CH4\_column\_number\_density[molec/m2]);keep(CH4\_colu  
mn\_volume\_mixing\_ratio\_dry\_air,dry\_air\_column\_number\_density)’)

% HARP-IDL ERROR -310: “variable ‘CH4\_column\_number\_density’ does not exist”

Any ideas on how to overcome this issue?  
🙂

Actually, now that I notice the dry\_air\_column\_number\_density still has vertical dimensions, i.e., is a profile. I am guessing that I can integrate. in which case, I can apply eq 2 from  
[column volume mixing ratio derivations — HARP 1.14 documentation (stcorp.github.io)](http://stcorp.github.io/harp/doc/html/algorithms/derivations/column_volume_mixing_ratio.html)  
outside of harp.

All ideas welcome!  
MariLiza

---

<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: [February 17, 2022, 9:23am UTC](https://forum.atmospherictoolbox.org/t/s5p-ch4-column-ppb-to-column-number-density-mol-m2-conversion/109/4 "2022-02-17T09:23:26Z")

</div>

See also the [documentation on the derive operation](http://stcorp.github.io/harp/doc/html/operations.html). You will need to add the dimensions that you want in order for HARP to calculate the variable from other inputs. When you use `derive(CH4_column_number_density {time,vertical} [molec/m2])` you will get a partial column density profile and if you use `derive(CH4_column_number_density {time} [molec/m2])` you will get total (=integrated) columns. So there is no need to do integration yourself.

---

<div class="post-metadata">

### Author: ![mariliza](https://forum.atmospherictoolbox.org/letter_avatar_proxy/v4/letter/m/c77e96/32.png) [@mariliza](https://forum.atmospherictoolbox.org/u/mariliza)
#### Post date: [February 20, 2022, 7:25pm UTC](https://forum.atmospherictoolbox.org/t/s5p-ch4-column-ppb-to-column-number-density-mol-m2-conversion/109/5 "2022-02-20T19:25:36Z")

</div>

Absolutely! This did the trick! Many thanks @sander.niemeijer !  
MariLiza

---

<div class="post-metadata">

### Author: ![dbp](https://forum.atmospherictoolbox.org/letter_avatar_proxy/v4/letter/d/43a26b/32.png) [@dbp](https://forum.atmospherictoolbox.org/u/dbp)
#### Post date: [July 21, 2022, 6:07pm UTC](https://forum.atmospherictoolbox.org/t/s5p-ch4-column-ppb-to-column-number-density-mol-m2-conversion/109/6 "2022-07-21T18:07:17Z")

</div>

Dear Mariliza, Sander,

I found this post by chance and it happens that I find very useful to transform CH4 ppbv from L2 S5P data into CH4 mol/m2. Reading your answers, I need the dry\_air\_column\_number\_density, but this variable is not provided in the CH4 L2 files, as far as I could check. Is that correct?

I’m new using S5P L2 data and also new in the HARP package.

Thank you in advance for your help,  
Best

---

<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 22, 2022, 8:04am UTC](https://forum.atmospherictoolbox.org/t/s5p-ch4-column-ppb-to-column-number-density-mol-m2-conversion/109/7 "2022-07-22T08:04:15Z")

</div>

The dry air column is available and HARP already ingests it. You can find the mapping for the L2 CH4 product in [the documentation](http://stcorp.github.io/harp/doc/html/ingestions/S5P_L2_CH4.html).  
You can immediately get the column number density by using e.g. `product = harp.import_product("S5P_OFFL_L2 __CH4____ 20181128T122504_20181128T140634_05833_01_010202_20181205T132750.nc", "derive(CH4_column_number_density {time} [mol/m2])")`

---

<div class="post-metadata">

### Author: ![dbp](https://forum.atmospherictoolbox.org/letter_avatar_proxy/v4/letter/d/43a26b/32.png) [@dbp](https://forum.atmospherictoolbox.org/u/dbp)
#### Post date: [July 22, 2022, 11:16am UTC](https://forum.atmospherictoolbox.org/t/s5p-ch4-column-ppb-to-column-number-density-mol-m2-conversion/109/8 "2022-07-22T11:16:39Z")

</div>

> [@sander.niemeijer](#):
>
> “derive(CH4\_column\_number\_density {time} [mol/m2])”

It is quite straightforward. Thank you. Although the output has different arrangement for dimensions. It seems that “time” dimension “absorbs” scanline/ground\_pixel dimensions. Is this something than can be handled with HARP by any chance? preserve input dataset dimensions, I mean.

Thank you very much for your help,  
Best,

---

<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 22, 2022, 1:51pm UTC](https://forum.atmospherictoolbox.org/t/s5p-ch4-column-ppb-to-column-number-density-mol-m2-conversion/109/9 "2022-07-22T13:51:29Z")

</div>

When you perform per-pixel filtering (which you should if you apply the recommended quality filtering) then you won’t have a grid anymore. You can however still figure out the position of each pixel in the satellite viewing grid based on the datetime\_start and scan\_subindex variable values. All pixels with the same datetime\_start are in the same row, and all pixels with the same scan\_subindex are in the same column.
