I have a scheduled process that merges the daily global observations for several different Sentinel-5 data products (CH4, NO2, etc). In our process we use bin_spatial to merge the daily observations of each product to write out an intermediate global HDF5 file for each product. Our bin_spatial operation is defined as “bin_spatial(3601,-90,0.05,7201,-180,.05)”. These daily files when viewed, are completely inverted (upside down to the human eye) - is there a way to write out the file ‘right side up’ so to speak? We use the H5 file to then create a global geotiff with GDAL. With the inverted H5 file we have to go through some theatrics with GDAL to orient the final geotiff correctly - which we would rather not do. Thanks for any info you can share.
If what you are viewing is the wrong way up, then this is more likely due to the viewer application that you are using. In the HDF5 file each cell should have the appropriate associated latitude and longitude axis value associated with it.
You are using the derive(latitude {latitude});derive(longitude {longitude})
step in the HARP operations as also described in this use case? Otherwise, that could result in applications not correctly interpreting the axis.
If you then call gdal_translate
with -a_srs EPSG:4326 -a_ullr -180 90 180 -90
you should end up with a proper image. It did for us.
But we have been fighting with gdal ourselves to get it to do the right thing as well. One important update we made in HARP 1.20.2 is explicitly set the fill value in hdf5 harp products to NaN, otherwise gdal would happily interpret those NaN values as ‘valid’ values.