How to read NOAA GRIB files directly?

Image Ici on parle français ou anglais, comme on veut, comme on peut.
Image Here we speak french or english, as we want, as we can.

Moderator: jza

Forum rules
Image Ici on parle français ou anglais, comme on veut, comme on peut, mais on n'oublie jamais que l'on discute entre humains.
Il ne faut surtout pas oublier les mots magiques: bonjour, salut, merci, etc.
Les messages impolis sont rejetés et restent sans réponse.
Il faut souvent être patient, car il y a plein d'autres activités encore plus passionantes dans notre vie.

Image Here we speak french or english, as we want, as we can, but we never forget that we discuss between humans.
Do not forget the magic words: hello, hi, thank you, etc.
Rude messages are rejected and remain unanswered.
It is often necessary to be patient because there are many other activities even more exciting in our life.
Post Reply
alavarre
Posts: 8
Joined: 06 Oct 2013 22:23

How to read NOAA GRIB files directly?

Post by alavarre » 06 Oct 2013 22:40

Bon Soir. :-) Je parle un peux de Français...

I have also sent this to NOAA. I don't know whether it is a problem with zyGrib or NOAA or me or a combination of all.

But we shall figure it out.

After several days of climbing the the learning curve on GRIB formats and downloading I am left with a fundamental problem:

zyGrib seems only to be able to read files provided by third parties, not files provided by

http://www.cpc.ncep.noaa.gov

It can read its own downloads from https://www.zygrib.org and those from saildocs.org in both .grb and compressed .grb.bz2 formats, but not any that I have figured out how to download from NOAA.

Extensive googling has not resolved this, so if you have any insights, please share.

Details below.

I'll be glad to share a rather complete script (except that the executable line isn't working... :-(

Easy when you know how, I"m sure, but not easy now.

Thanks in advance.

Best regards, Andy

=====

http://www.cpc.ncep.noaa.gov/products/w ... _grib.html

zyGrib needs GRIB1 formatted files, not GRIB2.

http://www.hpc.ncep.noaa.gov/grib/hpcgrib.shtml

says it does these:

ftp://ftp.hpc.ncep.noaa.gov/grib/

But zyGrib cannot read the files.

=====

Next we try GRIB2 files:

http://tinyurl.com/pmzql44

lets you set the parameters and area for download for one time only.

You have to repeat this for each time you wish, at three hour intervals, easily scripted

URL=
http://nomads.ncep.noaa.gov/cgi-bin/fil ... 6%2Fmaster

Going there directly results in a permissions violation.

Downloading a file from the website results in

gfs.t06z.mastergrb2f99

but zyGrib can't read that either. Tacking on a .grb suffix doesn't help.

=====

Next we try the straight stick approach using:

http://www.cpc.ncep.noaa.gov/products/w ... _grib.html

get_inv.pl http://nomad3.ncep.noaa.gov/pub/gfs/rot ... rbf180.inv| egrep '(:PRMSL:|:TMP:|:WDIR:|:WIND:|:APCP:|:HTSGW:)'|get_grib.pl http://nomad3.ncep.noaa.gov/pub/gfs/rot ... z.pgrbf180 /home/andy/.zygrib/grib/131005_test.grb

This succeeds in downloading a binary file but again zygrib can't read it.

Yes we have all the prerequisites (.pl files, perl, cURL, etc. They all seem to execute correctly, it's just that zyGrib cannnot read the result.

jza
Site Admin
Posts: 601
Joined: 19 Jan 2009 00:22

Re: How to read NOAA GRIB files directly?

Post by jza » 07 Oct 2013 14:53

Hi,

zyGrib is not The universal grib viewer. :roll:
It knows how to display a subset of available data, not all data, and also a subset of available grid models.
There are thousands of possible combinations.
For these reasons it offers its own data server, to be sure of finding known data in a known configuration.
A+
Jacques

alavarre
Posts: 8
Joined: 06 Oct 2013 22:23

Re: How to read NOAA GRIB files directly?

Post by alavarre » 07 Oct 2013 15:17

Jacques, bon soir.

Thank you for the clarification.

I have discovered: a number of things that are not obvious to the newcomer, at least think I have, posted here more for the benefit of googlers than for the cogniscenti :) :

• zyGrib uses only GRIB1 format

• NOAA (Wesley) confirms in an email that NOAA has discontinued GRIB1, providing only GRIB2

http://www.nco.ncep.noaa.gov/pmb/codes/GRIB2/ provides software for building a variety of tools for handling GRIBs of both varieties, but it is not a simple toy

http://strc.comet.ucar.edu/software/gmaster/ offers GribMaster, again a set of tools allegedly simple, except for the "thousands of combinations." But again, not simple.

I only wanted these because the server was down this weekend for a while, so I figured that if I could find an alternative source then I could still use the program to display the data. If that was a one-off anomaly then I need not spend the time reinventing the wheel.

Plus, it would be cool to be able to script the downloads... I've built a nice script for user input for a download, but the executable line still escapes me.

So knowing the command that zyGrib uses to download data would be most helpful, but moreso would be to understand how it performs the GRIB2→GRIB1 conversion, Which it must be doing, since NOAA only provides GRIB2?

At any rate, I now have lots of options to watching television (which I no longer do anyhow... :-)

Cheers, Andy

ulysse
Posts: 1
Joined: 19 Oct 2013 19:37

Re: How to read NOAA GRIB files directly?

Post by ulysse » 24 Oct 2013 18:31

Bonjour Jacques,

J'ai effectivement regardé tes sources de zyGrib...les fichiers sont uploadés depuis le serveur zyGrib.
J'ai essayé de traiter les fichiers grib1 ou grib2 mais sans succès. Notamment, je suis sous W7 et les outils tels que la combinaison de get_gfs.pl et wgrib2 ne me permet pas d'obtenir les données que je souhaite extraire à savoir la vitesse du vent (WIND) et la direction du vent (GRD). En effet, il semble y avoir un gap entre la version Windows et Linux (pas testé).

Jacques, pourrais tu m'éclairer sur le batch que tu as développé pour obtenir les fichiers grib ?

Mon objectif est de réaliser un routeur et dans un premier temps, il s'agirait d'obtenir depuis une latitude et une longitude un cap et une vitesse de vent.

Peux-tu m'aider ?

Par avance, merci

Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests