cambecc / earth

a project to visualize global weather conditions
http://earth.nullschool.net
MIT License
5.99k stars 1.17k forks source link

extract subregion - latitude is rending upside-down #123

Closed hbriga closed 3 years ago

hbriga commented 3 years ago

Hi everyone. I am trying to load wind data for the USA sub-region into earth and the result is not quite good. Extracted grib2 file from NOOA site, grib2json and load it. The original grib file is rending ok with other sw like xygrib. But on earth, latitude is rending the wrong way. Any idea of what I am doing wrong? Please see below print-screen from earth, xygrib, parameters at NOOA and original grib file with txt extension (rename it to grib2). Thanks for helping. Hélcio

1  wind-USA-gfs-earth 2  wind-USA-gfs-xygrib 3  extraction parameters 4. gfs.t00z.pgrb2.1p00.f000-GRIB_file.txt

cambecc commented 3 years ago

That looks like the lat coord needs to be mirrored along 25° N. Lon looks correct!

hbriga commented 3 years ago

Thank you Cameron. You are saying that it needs some preparation in the grib file before converting it to json, is that right?

cambecc commented 3 years ago

I'm not sure where things are going wrong, but it sure looks like the renderer thinks the data starts at 25°N and grows southward when it actually grows northward. If you open the json file and flip the sign of the "dy" field, it will probably work!

hbriga commented 3 years ago

yep, it worked indeed. thank you man. I am working with local Brazilian gribs, which covers only the region. So, this issue first appears there. Now i can move forward. I will close the issue here. Once again, thank you for your help.