Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

How do I swap (reverse) the scanning order? for example changing north-to-south changed to south-to-north

Step-by-step guide

...

  1. Ensure that the grid geometry of your GRIB message specifies both the latitudes: 

    latitudeOfFirstGridPointInDegrees and latitudeOfLastGridPointInDegrees

  2. Check what scanning modes you have in your input file:

    Code Block
    % grib_ls -p jScansPositively,iScansPositively input.grib


  3. Use the grib_set command to swap the scanning order for the latitudes:

    Code Block
    % grib_set -s swapScanningY=1  input.grib  output.grib

    This changes the order in which the data is stored in the GRIB message

There is also the key "swapScanningX" to do the same task for longitudes (east-to-west changed to west-to-east).Note: This only works

Here is a way of visualising the different scanning orders:

Image Added

Image Added

Info
The swapScanningX/Y keys only work for regular lat/lon grids and regular Gaussian grids. It is not to be used for reduced grids, Lambert, Polar stereographic, Mercator etc

...


Info
Check the resultant output GRIB file to ensure the data is shown correctly e.g., by plotting it

...

Content by Label
showLabelsfalse
max5
spacesUDOC
showSpacefalse
sortmodified
reversetrue
typepage
excludeCurrenttrue
cqllabel = "kb-how-to-article" and label = "grib" and type = "page" and space = "UDOC"
labelskb-how-to-article

...