# Creating a L3 AIRS product

**URL:** https://forum.atmospherictoolbox.org/t/creating-a-l3-airs-product/313
**Category:** HARP
**Tags:** python
**Created:** [April 26, 2021, 2:38pm UTC](https://forum.atmospherictoolbox.org/t/creating-a-l3-airs-product/313 "2021-04-26T14:38:00Z")
**Posts on this page:** 5
**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 26, 2021, 2:38pm UTC](https://forum.atmospherictoolbox.org/t/creating-a-l3-airs-product/313/1 "2021-04-26T14:38:00Z")

</div>

Greetings Sander,

I am trying to create a L3 gridded daily AIRS ozone profile product from ~20 L2 chunks per day over Europe.

I am using coda.fetch to read in the variables, e.g.  
latitude = coda.fetch(pf, ‘L2\_Standard\_atmospheric\_surface\_product/Geolocation\_Fields/Latitude’)

latitude is a in (GeoTrack=45, GeoXTrack=30) dimensions, so I collapse them onto a time dimension so that I can assign it to a harp.Variable, as follows:

product.latitude = harp.Variable(latitude.flatten(), [‘time’])

Per day I have a a list of ‘harp.Product()’ instances which I then wish to bin\_spatial and output into a netcdf file, as follows:

average = harp.execute\_operations(productlist,  
operations = ‘keep(latitude,longitude,tropopause\_temp, tropopause\_press, tropopause);  
bin\_spatial(120,30.0,0.25,180,-10.,0.25)’,  
post\_operations=“bin()”) #;\

The final ncdf is not geo-referenced, as you can well imagine, since there are no latitude/longitude dimensions there, latitude/longitude are not kept in the operations. The lat/lon\_bounds are output, of course. Is there a way to add the latitude/longitude dimension somehow in the post-operations? maybe I should not collapse the original geotrack dimensions onto “time”?

Sorry if this is a bit too confusing, I can add the whole python script is preferable.

Best wishes,  
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 26, 2021, 3:00pm UTC](https://forum.atmospherictoolbox.org/t/creating-a-l3-airs-product/313/2 "2021-04-26T15:00:21Z")

</div>

Do you mean ‘adding latitude/longitude axis variables’? Dimensions and axis variables are different things. You already should have dimensions named ‘latitude’ and ‘longitude’.

Have a look at e.g. [Monthly average tropospheric NO2 vertical column](https://forum.atmospherictoolbox.org/t/monthly-average-tropospheric-no2-vertical-column/141) for an example on how to derive lat/lon variables and squash them as part of the post-operation (although with recent HARP versions you are better of using the ‘-ar’ option / ‘reduce\_operations’ argument).

---

<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 26, 2021, 6:57pm UTC](https://forum.atmospherictoolbox.org/t/creating-a-l3-airs-product/313/3 "2021-04-26T18:57:21Z")

</div>

Thanks for the swift reply! I’m still using harp 1.11, waiting for the update.

I am using the python interface, i.e. the syntax is:

`harp.` `execute_operations` (_productlist_ , _operations=’’_ , _post\_operations=’’_ )

My product list contains 20 “chunks” of AIRS data all around Europe, they do not all cover the same regions.

Applying this:  
average = harp.execute\_operations(productlist,  
operations = ‘keep(latitude,longitude,tropopause\_temp, tropopause\_press, tropopause);  
bin\_spatial(120,30.0,0.25,180,-10.,0.25)’,   
post\_operations = ‘bin(); squash(time, (latitude,longitude));exclude(latitude\_bounds\_weight,longitude\_bounds\_weight,latitude\_weight,longitude\_weight,count)’)

Results in :

 ![tropopause_in_AIRS_ozone_profiles_2011.06.09](https://forum.atmospherictoolbox.org/uploads/default/original/1X/1ccbe97a6470921eee61d2de234d34fbc73b3e3b.jpeg)

and the arrays are only (45,30) in size, instead of (120,180) which is what I am asking for.

Whereas the 20 chucks are all over the place, for e.g.:

 ![tropopause in AIRS_ozone_profiles_2011.06.09_check_00005](https://forum.atmospherictoolbox.org/uploads/default/original/1X/7a4798b1fdd6bbf595b1da910c6c2576c2e9a319.png)

and

 ![tropopause in AIRS_ozone_profiles_2011.06.09_check_00014](https://forum.atmospherictoolbox.org/uploads/default/original/1X/bcba4ecc487f0a106086fc7b3dd9810aa4200823.png)

Should the bin\_spatial bin all 20 products in the product list simultaneously onto the same final grid?

Many thanks,  
MariLiza

---

<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 26, 2021, 7:35pm UTC](https://forum.atmospherictoolbox.org/t/creating-a-l3-airs-product/313/4 "2021-04-26T19:35:32Z")

</div>

Ok, I think I got it. My original latitude/longitude [and more…] where 2D arrays, once I collapsed them as a harp.product onto a {time} variable, it worked using:

average = harp.execute\_operations(productlist,  
operations = ‘bin\_spatial(120,30.0,0.25,180,-10.,0.25);derive(longitude{longitude});derive(latitude {latitude})’,  
post\_operations = ‘bin(); squash(time, (latitude,longitude));  
exclude(latitude\_bounds,longitude\_bounds,latitude\_bounds\_weight,longitude\_bounds\_weight,latitude\_weight,longitude\_weight,weight,count)’)

However, I have variables that have {time,vertical} as dimensions which also need gridding. I am getting an error:

Error: variable ‘‘ozone\_prof\_error’’ could not be exported (dimensions incorrect).

How can I bin those as well?

Thanks  
MariLiza

---

<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 27, 2021, 7:07pm UTC](https://forum.atmospherictoolbox.org/t/creating-a-l3-airs-product/313/5 "2021-04-27T19:07:14Z")

</div>

Hey Sander,  
Thanks for the patience.  
Problem solved, reshaping was not working as I thought it was.  
Profiles gridded as expected.  
Best wishes,  
MariLiza
