Creating a L3 AIRS product

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

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 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).

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 :

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.:

and

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

Many thanks,
MariLiza

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

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