# About Monthly average of OMI NO2

**URL:** https://forum.atmospherictoolbox.org/t/about-monthly-average-of-omi-no2/569
**Category:** HARP
**Created:** [October 18, 2022, 11:02am UTC](https://forum.atmospherictoolbox.org/t/about-monthly-average-of-omi-no2/569 "2022-10-18T11:02:31Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![Crow901](https://forum.atmospherictoolbox.org/user_avatar/forum.atmospherictoolbox.org/crow901/32/251_2.png) [@Crow901](https://forum.atmospherictoolbox.org/u/Crow901)
#### Post date: [October 18, 2022, 11:02am UTC](https://forum.atmospherictoolbox.org/t/about-monthly-average-of-omi-no2/569/1 "2022-10-18T11:02:31Z")

</div>

Hi!  
I’m Jorge and i want to merge, regrid and average all the NO2 retrievals of october 2004 around the city i live. The problem is when i make it I get a 3d array when i should get 2d array. This is the code I made with jupyter:

filename\_omi = r"OMNO2\_2004\_Oct\OMI-Aura\_L2-OMNO2\_2004m10\*.he5"

These are my operations:  
operations\_omi = “;”.join([  
“validity !& 1”,  
“tropospheric\_NO2\_column\_number\_density\>0”,  
“bin\_spatial(7,37.10,0.025,9,-3.75,0.025)”,  
“derive(tropospheric\_NO2\_column\_number\_density [Pmolec/cm2])”,  
“keep(latitude\_bounds,longitude\_bounds,tropospheric\_NO2\_column\_number\_density)”,  
“derive (latitude{latitude})”,  
“derive (longitude{longitude})”,  
“”

and my reduced\_operations

reduced\_operations = “squash(time, (latitude, longitude, latitude\_bounds, longitude\_bounds))” ; “bin()”

omi\_NO2 = harp.import\_product(filename\_omi,operations\_omi,reduce\_operations = reduced\_operations)

and i get this array when I prompt : omi\_NO2.tropospheric\_NO2\_column\_number\_density  
dimension = {time=29, latitude=6, longitude=8}

Thank you very much  
Jorge

---

<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: [October 18, 2022, 11:17am UTC](https://forum.atmospherictoolbox.org/t/about-monthly-average-of-omi-no2/569/2 "2022-10-18T11:17:00Z")

</div>

> [@Crow901](#):
>
> reduced\_operations = “squash(time, (latitude, longitude, latitude\_bounds, longitude\_bounds))” ; “bin()”

This is wrong. You probably meant: `reduced_operations = "squash(time, (latitude, longitude, latitude_bounds, longitude_bounds));bin()"` (i.e. the `;` should be within the double quoted part)

---

<div class="post-metadata">

### Author: ![Crow901](https://forum.atmospherictoolbox.org/user_avatar/forum.atmospherictoolbox.org/crow901/32/251_2.png) [@Crow901](https://forum.atmospherictoolbox.org/u/Crow901)
#### Post date: [October 18, 2022, 12:22pm UTC](https://forum.atmospherictoolbox.org/t/about-monthly-average-of-omi-no2/569/3 "2022-10-18T12:22:50Z")

</div>

Hello,  
I see thank you very much for that. I did not realize about the ; out of the quoted part.  
But there is another error when i run the harp.import\_product part with the right reduced\_operations  
I get:  
"products don’t both have variable ‘count’ ". I’m working with OMI products  
Do I have to do something before the harp.import?

Thanks again  
Jorge

---

<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: [October 24, 2022, 3:34pm UTC](https://forum.atmospherictoolbox.org/t/about-monthly-average-of-omi-no2/569/4 "2022-10-24T15:34:00Z")

</div>

In your `keep()` operation you should also keep all count and weight variables. Those should only be thrown away at the end if you don’t need them anymore (i.e. have the more restricted `keep()` inside the `post_operations` argument).
