-
Notifications
You must be signed in to change notification settings - Fork 28
Missing Element with Grib 2 files #13
Comments
@silv2015 Thanks for trying the library! I will look into this and see if I can reproduce the issue. I just released a new version, though I have no reason to think it will solve your problem. |
This works for me using v0.6.0: using(GribFile file = new GribFile(@".\TestData\Pacific.wind.7days.grb"))
{
var vComp = file.Where(m => m.Name.Contains("V V-component of wind m s**-1")).First();
foreach (var val in vComp.GeoSpatialValues)
{
Console.WriteLine("Lat: {0} Lon: {1} Val: {2}", val.Latitude, val.Longitude, val.Value);
}
} Here's the file I used. |
If that ^ doesn't work for you, can you explain what you mean by "doesn't work"? Are you getting an exception? If so, what does the exception say? |
Hi 0x1mason! Thanks for the answer, I downloaded your file and will give it a try I will have another try with my file and send you what I mean by 'doesn't work' it does not give me any exception, it's just kind of skip it. Thanks again |
Here I have the result... If I load your file, yes it works: But If I load my file (.grb2) here what I have: I should have something for the V component of winds But like I said, if I take any .grb (not .grb2), it works Could it be related to Grib2 file? |
You could be right, though I thought the file I used was GRIB 2, despite Can you see the v-component messages in GDAL, degrib, etc? I'm sure you've On Wed, Oct 28, 2015 at 2:57 PM, Martin Brousseau notifications@github.com
|
Hi 0x1mason! I can see the component with GDAL no problem, here is an output I copy from a test:
|
Wow. Weird. As a sanity check, I downloaded a GRIB2 file from NOAA and could see the
Probably best if you email me: etmillin@gmail.com On Thu, Oct 29, 2015 at 8:43 AM, Martin Brousseau notifications@github.com
|
I have one more guess: the problem could be your v-comp messages use multiple fields, which isn't enabled by default. Try this: using (GribFile file = new GribFile(somePath))
{
file.Context.EnableMultipleFieldMessages = true;
// do stuff
} I haven't test this feature yet. Will do once I get appropriate test data. I also may have found some data at the CISL site, but trying to find some that aren't 200+ GB. Also, I just noticed there's a bug in the getter for |
Similar issue here: https://code.zmaw.de/boards/1/topics/2835 |
Good Morning 0x1mason! I just arrived at the office, thanks for the suggestion! I will try it today and if I still cannot load it, I will ask how we can arrange so that you can have the file I'm using |
YES!!! This was it! I added and now I can see the v component... Man I need to review the info I have on the Grib 2 format! Thanks a lot!!! |
Woot! Glad it worked.
|
Will add note to Usage section about this. Thanks again for trying the library. Let me know if you have further issues. |
Hi!
First I want to tell you that this project looks very promising! Good Work!
In our project, we are already use GDAL and it's C# wrapper but we are looking for another library to load our grib 1 and 2 files.
I have a Grib 2 files (GFS.grb2) in which I have 4 elements that we call Channels:
Temperature
U component of Winds
V component of winds
Total Precipitation
I can read all channels except V component of winds.
It does work for all my Grib 1 files.
I cannot attach any files, but if you need more info (except I cannot send you the grib file!) please let me know!
If we can load all our Grib files with your library, we can make the switch and it will simplify a lot our work here! :)
The text was updated successfully, but these errors were encountered: