Skip to content
This repository has been archived by the owner on Sep 1, 2022. It is now read-only.

GRIB1 without Grid Definition NullPointer #39

Closed
camowen opened this issue Dec 12, 2013 · 6 comments
Closed

GRIB1 without Grid Definition NullPointer #39

camowen opened this issue Dec 12, 2013 · 6 comments

Comments

@camowen
Copy link

camowen commented Dec 12, 2013

In grib/src/main/java/ucar/grib/grib1/Grib1Data.java, "gdsv" doesn't get set if the GRIB file does not contain a Grid Definition Section, so will throw a NullPointerException further down:

(on line 136:)
new Grib1BinaryDataSection(raf, decimalScale, bms, gdsv.getScanMode(), gdsv.getNx(), gdsv.getNy() );

This could potentially be solved by using the alternate Grib1BinaryDataSection constructor when gdsv is null

@JohnLCaron
Copy link
Collaborator

Hi Cameron:

ucar.grib.* is deprecated and has been removed in 4.4. All versions of 4.3+ use ucar.nc2.grib.*

However, Im not sure that your case is being handled correctly in later versions.

Do you have a sample file with a missing GDS ?

John

@camowen
Copy link
Author

camowen commented Dec 12, 2013

Hi John

I've uploaded a small example GRIB1 file that doesn't specify GDS here:
http:https://homepages.ecs.vuw.ac.nz/~owencame/GRIB/HRDB85_KWBC.grb

@JohnLCaron
Copy link
Collaborator

Seems to be working in 4.3. Apparently we have a number of predefined NCEP grids, and #24 is one of them.

@JohnLCaron
Copy link
Collaborator

OTOH, doesnt particularly look correct. let me know what you think, or send me a picture of what it should look like.

@camowen
Copy link
Author

camowen commented Dec 13, 2013

Converting to use ucar.nc2.grib.* now, so perhaps that will resolve the issue, but I could submit a fix for the deprecated code if you'd like?

@JohnLCaron
Copy link
Collaborator

if youd like, we will incorporate; as i said, its been removed in 4.4

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants