2

I have a grib file that covers a specific area of the globe (i.e. does not cover the whole world). I need to shift the latitude and longitude in it to a different area. It contains historical weather data.

I am having difficulty finding where a grib file contains it's georeference data, and how to manipulate this - I need to effectively shift every point on it 2 degrees south and 119 degrees east.

Can anyone point me in the direction of what tool I might use to do this (I'm running a mac, and have grads which I'm not confident with, panoply (which appears to view only) and wgrib.

Thanks!

James Davies
  • 114
  • 1
  • 2
  • 10
  • This is still vexing me. It looks as though wgrib can manipulate the data, but having experimented with various flags, I currently can't even _extract_ the lat long, let alone modify it. – James Davies Mar 31 '16 at 08:01
  • It takes a while to understand GRIB. Generally, you won't find the lat/long coordinates stored in the messages. They're extrapolated from metadata in the message. Since all GRIB are grids, the math is usually simple. How you do this depends on the type of GRIB message you have. – 0x1mason Apr 08 '16 at 02:52
  • Thanks @ox1mason. So I need something to extract and modify the metadata? And grib_set should do this? More tinkering time! – James Davies Apr 09 '16 at 13:10
  • Use grib_dump to view the metadata. Start with that and identify the type of grid you're dealing with. Then use grib_set to set the fields. Everything is well documented here: https://software.ecmwf.int/wiki/plugins/servlet/mobile#content/view/7374658 The team is quite friendly and helpful, though it may take a week or so before they respond to a ticket. – 0x1mason Apr 09 '16 at 14:19

1 Answers1

1

Try grib_api/grib-tools, specifically grib_set. They should be available via homebrew. https://software.ecmwf.int/wiki/plugins/servlet/mobile#content/view/7374719

0x1mason
  • 757
  • 8
  • 20