[gradsusr] Data descriptor file

James T. Potemra jimp at hawaii.edu
Wed Jul 12 23:00:04 EDT 2017


Lovish,

Where to start?  Your ascii file appears to have 2642 pairs of lat/lon.  
As Jennifer wrote, this would imply a GrADS binary file of size 
2642*4=10568.  Your descriptor file on the other hand implies 23550 
pairs of lat/lon (150x157), and thus a GrADS binary file of size 
150*157*4=94200.  Your attached GrADS binary file matches neither of 
these; it's 151713 which is immediately suspicious as it's not an even 
multiple of 4.

In addition you are likely trying to regrid these data somehow 
(descriptor file has regular lat/lon's but the ascii file does not).  I 
suspect there are a few steps between test.dat and test.grd, but with 
just the files all one can say is the binary file is not correct, but of 
course you've already determined that.

Jim


On 7/12/17 4:40 PM, Lovish Aggarwal wrote:
> Am sorry but I still am unable to find mistake in my grd file.
> Both the ascii data file with lat long and wind speed  AND the grid 
> file produced by my java code are attached here, please I request you 
> to see and tell me where am I mistaken!
> Thanks in advance!
> Please reply asap.
> Also attached are the ctl file and screenshot of output on grads and 
> command line.
>
> On Thu, Jul 13, 2017 at 8:03 AM, Lovish Aggarwal 
> <guptaluv.8098 at gmail.com <mailto:guptaluv.8098 at gmail.com>> wrote:
>
>     Am sorry but I still am unable to find mistake in my grd file.
>     Both the ascii data file with lat long and wind speed  AND the
>     grid file produced by my java code are attached here, please I
>     request you to see and tell me where am I mistaken!
>     Thanks in advance!
>     Please reply asap.
>
>     On Thu, Jul 13, 2017 at 2:58 AM, Jennifer M Adams
>     <jadams21 at gmu.edu <mailto:jadams21 at gmu.edu>> wrote:
>
>         Sounds like your .dat file is really ascii, if it has columns
>         with lat, lon, and wind speed data.
>
>         The doc file I pointed to in my first reply does tell you
>         ‘exactly how your output grid file must be written’ — look
>         under the heading Structure of a Gridded Binary File:
>         http://cola.gmu.edu/grads/gadoc/aboutgriddeddata.html#structure
>         <http://cola.gmu.edu/grads/gadoc/aboutgriddeddata.html#structure>
>
>         “… Each building block is a horizonal grid of data varying in
>         the X and Y dimensions. The first dimension (X) always varies
>         from west to east; the second dimension (Y) varies from south
>         to north (by default).”
>
>         So, you muse write all longitudes at the southernmost
>         latitude. Then write out another row of data for all
>         longidutes and the next latitude, etc. You may find this page
>         useful: http://cola.gmu.edu/grads/gadoc/ascii.html
>         <http://cola.gmu.edu/grads/gadoc/ascii.html> — the section on
>         “Input ASCII data” has an example showing how to deal with
>         ASCII data using GrADS scripts.
>         —Jennifer
>
>
>
>
>
>         > On Jul 12, 2017, at 4:23 PM, Lovish Aggarwal
>         <guptaluv.8098 at gmail.com <mailto:guptaluv.8098 at gmail.com>> wrote:
>         >
>         > This won't work as my dat file contains three columns
>         containing lat long and wind speed. And grads is unable to
>         read it.
>         > The reason am trying to make a grid file from it using java!
>         Please help me up with how exactly my output grid file must be
>         written for it to be understood by grads.
>         > Thanks!
>         >
>         > On Jul 12, 2017 5:54 PM, "Jennifer M Adams"
>         <jadams21 at gmu.edu <mailto:jadams21 at gmu.edu>> wrote:
>         > This doc page should provide the information you need:
>         http://cola.gmu.edu/grads/gadoc/aboutgriddeddata.html
>         <http://cola.gmu.edu/grads/gadoc/aboutgriddeddata.html>
>         >
>         > Flat binary data files often have the .dat OR the .grd
>         extension, so converting may not be necessary. Depending on
>         what your error is, you can check the file's size, it should
>         be xsize*ysize*zsize*4 bytes.
>         > —Jennifer
>         >
>         >
>         > > On Jul 12, 2017, at 5:15 AM, Lovish Aggarwal
>         <guptaluv.8098 at gmail.com <mailto:guptaluv.8098 at gmail.com>> wrote:
>         > >
>         > > I need to know the exact format of .grd file grads takes
>         as input.
>         > > I have .dat file with xyz (lat lon windspeed) and am
>         converting this .dat file to .grd but there is a problem in
>         reading the grd file made.
>         > > So I want to know the exact format of grd file so that I
>         can make it through my java code.
>         > > Thank you!
>         > > It's kind of urgent please reply asap.
>         > > _______________________________________________
>         > > gradsusr mailing list
>         > > gradsusr at gradsusr.org <mailto:gradsusr at gradsusr.org>
>         > > http://gradsusr.org/mailman/listinfo/gradsusr
>         <http://gradsusr.org/mailman/listinfo/gradsusr>
>         >
>         > --
>         > Jennifer Miletta Adams
>         > Center for Ocean-Land-Atmosphere Studies (COLA)
>         > George Mason University
>         >
>         >
>         >
>         >
>         > _______________________________________________
>         > gradsusr mailing list
>         > gradsusr at gradsusr.org <mailto:gradsusr at gradsusr.org>
>         > http://gradsusr.org/mailman/listinfo/gradsusr
>         <http://gradsusr.org/mailman/listinfo/gradsusr>
>         > _______________________________________________
>         > gradsusr mailing list
>         > gradsusr at gradsusr.org <mailto:gradsusr at gradsusr.org>
>         > http://gradsusr.org/mailman/listinfo/gradsusr
>         <http://gradsusr.org/mailman/listinfo/gradsusr>
>
>         --
>         Jennifer Miletta Adams
>         Center for Ocean-Land-Atmosphere Studies (COLA)
>         George Mason University
>
>
>
>
>         _______________________________________________
>         gradsusr mailing list
>         gradsusr at gradsusr.org <mailto:gradsusr at gradsusr.org>
>         http://gradsusr.org/mailman/listinfo/gradsusr
>         <http://gradsusr.org/mailman/listinfo/gradsusr>
>
>
>
>
>
> _______________________________________________
> gradsusr mailing list
> gradsusr at gradsusr.org
> http://gradsusr.org/mailman/listinfo/gradsusr

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://gradsusr.org/pipermail/gradsusr/attachments/20170712/b853c57c/attachment.html 


More information about the gradsusr mailing list