ZyGrib does not like Norwegian grib files

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.
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.
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
ZFDennis
Posts: 3
Joined: 24 Aug 2017 23:50

ZyGrib does not like Norwegian grib files

Post by ZFDennis » 24 Aug 2017 23:57

Hi,

Until recently, I used grib files from the Norwegian weather office in ZyGrib. Something has changed somewhere (probably in Norway) and ZyGrib does not understand the files any more! They are, as far as I can see, valid Grib files as OpenCPN and WinGPS will consume them without any problem.

Link to the files:http://api.met.no/weatherapi/gribfiles/ ... nt=weather or generally, any grib file from this page:http://om.yr.no/verdata/grib/
ZyGrib says: not a GRIB file, unreadable or... (the message box is in Dutch, not very useful to post a screenshot here)

Can anyone tell me why the files won't work? They did work a year ago.

DomH
Site Admin
Posts: 303
Joined: 23 Jan 2009 09:03

Re: ZyGrib does not like Norwegian grib files

Post by DomH » 14 Sep 2017 23:08

ZFDennis wrote:Hi,

Until recently, I used grib files from the Norwegian weather office in ZyGrib. Something has changed somewhere (probably in Norway) and ZyGrib does not understand the files any more! They are, as far as I can see, valid Grib files as OpenCPN and WinGPS will consume them without any problem.

Link to the files:http://api.met.no/weatherapi/gribfiles/ ... nt=weather or generally, any grib file from this page:http://om.yr.no/verdata/grib/
ZyGrib says: not a GRIB file, unreadable or... (the message box is in Dutch, not very useful to post a screenshot here)

Can anyone tell me why the files won't work? They did work a year ago.
Hello,

A grib file is a binary file (not completely standerdised) with an identification of the source at the top of the file.

There is also 2 formats GRIB1 and GRIB2. The norvegian files (source : http://om.yr.no/verdata/grib) are GRIB1.

In zyGrib, there is a test before opening the file on the identity, and if this ID is not recognised, the file is not open.

I cannot remember in wich source file of zygrib, the list is given, but if you find it, you can add the ID of the norvegian files and recompile and it will work.

May be the developper will add the info in a next version
Bonne journée ou bonne soirée (vous pouvez choisir)
Have a nice day or good night (you can choose)
Guten Morgen oder gute Nacht (Sie können wählen)

DomH

ZFDennis
Posts: 3
Joined: 24 Aug 2017 23:50

Re: ZyGrib does not like Norwegian grib files

Post by ZFDennis » 19 Sep 2017 23:56

Of course! How could I forget the old adage 'Use the source, Luke' ;)

Although my proficiency in C is not very great, I should be able to identify where and why this file is rejected. If I can find the right place, I should be able to provide a correction. Nice reply, I will start my development environment right away.

ZFDennis
Posts: 3
Joined: 24 Aug 2017 23:50

Re: ZyGrib does not like Norwegian grib files

Post by ZFDennis » 25 Sep 2017 00:24

Code: Select all

	else if (   
			    (idCenter==88 && idModel==255 && idGrid==255)
			 || (idCenter==88 && idModel==230 && idGrid==255)
			 || (idCenter==88 && idModel==200 && idGrid==255)
			 || (idCenter==88 && idModel==67 && idGrid==255)
	) {
		dataCenterModel = NORWAY_METNO;
	}
in GribRecord.cpp line 103 should have a new condition:

Code: Select all

..
			 || (idCenter==88 && idModel==127 && idGrid==255)
Don't know if the files will work after this addition, but at least they won't be rejected because of a new model.

Post Reply

Who is online

Users browsing this forum: Bing [Bot] and 1 guest