iris-grib icon indicating copy to clipboard operation
iris-grib copied to clipboard

Incomplete hybrid levels should still produce 3-dim cube

Open marfel opened this issue 7 years ago • 7 comments

Hi, I have some apparently improperly defined hybrid level GRIB2 files here:

  # Hybrid level (grib2/tables/5/4.5.table)  
  typeOfFirstFixedSurface = 105;
  #-READ ONLY- unitsOfFirstFixedSurface = unknown;
  #-READ ONLY- nameOfFirstFixedSurface = Hybrid level;
  scaleFactorOfFirstFixedSurface = 0;
  scaledValueOfFirstFixedSurface = 1;
  # Missing (grib2/tables/5/4.5.table)  
  typeOfSecondFixedSurface = 255;
  #-READ ONLY- unitsOfSecondFixedSurface = unknown;
  #-READ ONLY- nameOfSecondFixedSurface = Missing;
  scaleFactorOfSecondFixedSurface = MISSING;
  scaledValueOfSecondFixedSurface = MISSING;

Obviously there is no way of correctly assigning pressure or anything to these surfaces, but it would still be very helpful if they could be parsed as a single cube with scaledValueOfFirstFixedSurface specifiying the third dimension coordinate. Instead they come out as individual 2-dim cubes:

 air_pressure / (Pa)                 (projection_y_coordinate: 429; projection_x_coordinate: 499)
     Dimension coordinates:
          projection_y_coordinate                           x                             -
          projection_x_coordinate                           -                             x
     Scalar coordinates:
          forecast_period: 1 hours
          forecast_reference_time: 2018-08-31 23:00:00
          time: 2018-09-01 00:00:00

Is there a workaround for this?

marfel avatar Oct 11 '18 15:10 marfel

Hi @marfel, we've just picked this up while doing some tidy-up. Sorry no-one ever got back to you, is this still an issue you would like solved?

trexfeathers avatar Sep 21 '22 09:09 trexfeathers

Wow, thank you! I didn't think anyone would be interested in this after such a long time ;) I'm actually not sure if we still use the data I was referring to (might have been the COSMO REA6 reanalysis), but in principle the issue is still valid. As a workaround, I have disabled the factories that were supposed to generate the pressure levels. IMHO such extra processing should be optional, also because of performance when reading lots of files. We have been working with a patched version of iris-grib for several years now, merging the main branch into it from time to time. If you want to have a look at it, maybe I should upload it as a branch? Perhaps you find some of the modifications useful.

marfel avatar Sep 21 '22 13:09 marfel

Thanks @marfel for the intriguing offer, we're just waiting for our Iris-GRIB lead to have some time to consider this. Ping @lbdreyer

trexfeathers avatar Sep 28 '22 09:09 trexfeathers

Hi @marfel, we'd love to take a look at your patched version. Although as you've guessed, the spare resource for Iris-GRIB is limited, so we might not end up incorporating to modifications any time soon.

If you discover future issues, we'd still love to hear from you in an issue or PR - rest assured there is someone listening!

Incidentally we have recently improved the performance of hybrid height factories adding to Cubes - SciTools/iris#4718.

trexfeathers avatar Oct 07 '22 13:10 trexfeathers

Thanks! Sorry I'm not very well versed in the way of github, but it seems I'm not allowed to push a new branch? Here is the output of

git format-patch origin/main -o /tmp/marfel

marfel.zip

Hope this helps?

marfel avatar Oct 17 '22 08:10 marfel

Thanks @marfel 🙂

... it seems I'm not allowed to push a new branch?

Yes, the typical work pattern in GitHub is users to have their own copies of a repo under their user name (these are normally forks, but in your case perhaps an independent copy). Is there any chance of you uploading your version of iris-grib to your own user space, then occasionally updating it? That would allow the smoothest collaboration.

trexfeathers avatar Oct 19 '22 08:10 trexfeathers

Good day,

I am a colleague of marfel, who asked me to create the fork and add his modification. You can find it here:

https://github.com/os-simopt/iris-grib

os-simopt avatar Jan 02 '23 09:01 os-simopt