cambecc / grib2json

converts GRIB2 files to JSON
MIT License
356 stars 154 forks source link

Json file #10

Closed anthony1975 closed 9 years ago

anthony1975 commented 9 years ago

Hello,

First, thanks a lot for your great job ( earth project is amazing :) ...) I need to know how i have to read the data array ? For example,

    "data":[
        -2.12,
        -2.27,
        -2.41,
        ...
    ]

-2.12 refers to which latitude/longitude ? -2.41 ?

Actually, i extract U and V components in order to find the speed and direction of wind ... So, i'd like to get the both data on the same point.

Best regards,

Anthony

cambecc commented 9 years ago

Hi! The data is in row-major order where longitude is organized in rows of 1° and latitude as columns of 1°. Longitude is ascending but latitude is descending, so "-2.12" is for +90° lat, 0° lon. The U and V components are encoded in separate records, so you'll need to combine them yourself. Your example above is probably just the U component.

anthony1975 commented 9 years ago

So if "-2.12" is for +90° lat, 0° lon, Then "-2.27" is for +90° lat, 1° lon ? It's stil correct ?

cambecc commented 9 years ago

Exactly.