<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    <p>Lovish,</p>
    <p>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.  <br>
    </p>
    <p>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.</p>
    <p>Jim<br>
    </p>
    <br>
    <div class="moz-cite-prefix">On 7/12/17 4:40 PM, Lovish Aggarwal
      wrote:<br>
    </div>
    <blockquote type="cite"
cite="mid:CABj_cVeibMqTJybFpH2cGxiCxnbnBiZJ8_Z9Z4PC6vz-kLFufA@mail.gmail.com">
      <div dir="ltr">
        <div>Am sorry but I still am unable to find mistake in my grd
          file.</div>
        <div>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!</div>
        <div>Thanks in advance!</div>
        <div>Please reply asap.</div>
        <div>Also attached are the ctl file and screenshot of output on
          grads and command line.</div>
      </div>
      <div class="gmail_extra"><br>
        <div class="gmail_quote">On Thu, Jul 13, 2017 at 8:03 AM, Lovish
          Aggarwal <span dir="ltr">&lt;<a
              href="mailto:guptaluv.8098@gmail.com" target="_blank"
              moz-do-not-send="true">guptaluv.8098@gmail.com</a>&gt;</span>
          wrote:<br>
          <blockquote class="gmail_quote" style="margin:0 0 0
            .8ex;border-left:1px #ccc solid;padding-left:1ex">
            <div dir="ltr">
              <div>Am sorry but I still am unable to find mistake in my
                grd file.</div>
              <div>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!</div>
              <div>Thanks in advance!</div>
              <div>Please reply asap.</div>
            </div>
            <div class="HOEnZb">
              <div class="h5">
                <div class="gmail_extra"><br>
                  <div class="gmail_quote">On Thu, Jul 13, 2017 at 2:58
                    AM, Jennifer M Adams <span dir="ltr">&lt;<a
                        href="mailto:jadams21@gmu.edu" target="_blank"
                        moz-do-not-send="true">jadams21@gmu.edu</a>&gt;</span>
                    wrote:<br>
                    <blockquote class="gmail_quote" style="margin:0 0 0
                      .8ex;border-left:1px #ccc solid;padding-left:1ex">Sounds
                      like your .dat file is really ascii, if it has
                      columns with lat, lon, and wind speed data.<br>
                      <br>
                      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:<br>
                      <a
                        href="http://cola.gmu.edu/grads/gadoc/aboutgriddeddata.html#structure"
                        target="_blank" rel="noreferrer"
                        moz-do-not-send="true">http://cola.gmu.edu/grads/gado<wbr>c/aboutgriddeddata.html#struct<wbr>ure</a><br>
                      <br>
                      “… 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).”<br>
                      <br>
                      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: <a
                        href="http://cola.gmu.edu/grads/gadoc/ascii.html"
                        target="_blank" rel="noreferrer"
                        moz-do-not-send="true">http://cola.gmu.edu/grads/gado<wbr>c/ascii.html</a>
                      — the section on “Input ASCII data” has an example
                      showing how to deal with ASCII data using GrADS
                      scripts.<br>
                      <span class="m_7094465726979005515HOEnZb"><font
                          color="#888888">—Jennifer<br>
                        </font></span>
                      <div class="m_7094465726979005515HOEnZb">
                        <div class="m_7094465726979005515h5"><br>
                          <br>
                          <br>
                          <br>
                          <br>
                          &gt; On Jul 12, 2017, at 4:23 PM, Lovish
                          Aggarwal &lt;<a
                            href="mailto:guptaluv.8098@gmail.com"
                            target="_blank" moz-do-not-send="true">guptaluv.8098@gmail.com</a>&gt;
                          wrote:<br>
                          &gt;<br>
                          &gt; This won't work as my dat file contains
                          three columns containing lat long and wind
                          speed. And grads is unable to read it.<br>
                          &gt; 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.<br>
                          &gt; Thanks!<br>
                          &gt;<br>
                          &gt; On Jul 12, 2017 5:54 PM, "Jennifer M
                          Adams" &lt;<a href="mailto:jadams21@gmu.edu"
                            target="_blank" moz-do-not-send="true">jadams21@gmu.edu</a>&gt;
                          wrote:<br>
                          &gt; This doc page should provide the
                          information you need: <a
                            href="http://cola.gmu.edu/grads/gadoc/aboutgriddeddata.html"
                            target="_blank" rel="noreferrer"
                            moz-do-not-send="true">http://cola.gmu.edu/grads/gado<wbr>c/aboutgriddeddata.html</a><br>
                          &gt;<br>
                          &gt; 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.<br>
                          &gt; —Jennifer<br>
                          &gt;<br>
                          &gt;<br>
                          &gt; &gt; On Jul 12, 2017, at 5:15 AM, Lovish
                          Aggarwal &lt;<a
                            href="mailto:guptaluv.8098@gmail.com"
                            target="_blank" moz-do-not-send="true">guptaluv.8098@gmail.com</a>&gt;
                          wrote:<br>
                          &gt; &gt;<br>
                          &gt; &gt; I need to know the exact format of
                          .grd file grads takes as input.<br>
                          &gt; &gt; 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.<br>
                          &gt; &gt; So I want to know the exact format
                          of grd file so that I can make it through my
                          java code.<br>
                          &gt; &gt; Thank you!<br>
                          &gt; &gt; It's kind of urgent please reply
                          asap.<br>
                          &gt; &gt; ______________________________<wbr>_________________<br>
                          &gt; &gt; gradsusr mailing list<br>
                          &gt; &gt; <a
                            href="mailto:gradsusr@gradsusr.org"
                            target="_blank" moz-do-not-send="true">gradsusr@gradsusr.org</a><br>
                          &gt; &gt; <a
                            href="http://gradsusr.org/mailman/listinfo/gradsusr"
                            target="_blank" rel="noreferrer"
                            moz-do-not-send="true">http://gradsusr.org/mailman/li<wbr>stinfo/gradsusr</a><br>
                          &gt;<br>
                          &gt; --<br>
                          &gt; Jennifer Miletta Adams<br>
                          &gt; Center for Ocean-Land-Atmosphere Studies
                          (COLA)<br>
                          &gt; George Mason University<br>
                          &gt;<br>
                          &gt;<br>
                          &gt;<br>
                          &gt;<br>
                          &gt; ______________________________<wbr>_________________<br>
                          &gt; gradsusr mailing list<br>
                          &gt; <a href="mailto:gradsusr@gradsusr.org"
                            target="_blank" moz-do-not-send="true">gradsusr@gradsusr.org</a><br>
                          &gt; <a
                            href="http://gradsusr.org/mailman/listinfo/gradsusr"
                            target="_blank" rel="noreferrer"
                            moz-do-not-send="true">http://gradsusr.org/mailman/li<wbr>stinfo/gradsusr</a><br>
                          &gt; ______________________________<wbr>_________________<br>
                          &gt; gradsusr mailing list<br>
                          &gt; <a href="mailto:gradsusr@gradsusr.org"
                            target="_blank" moz-do-not-send="true">gradsusr@gradsusr.org</a><br>
                          &gt; <a
                            href="http://gradsusr.org/mailman/listinfo/gradsusr"
                            target="_blank" rel="noreferrer"
                            moz-do-not-send="true">http://gradsusr.org/mailman/li<wbr>stinfo/gradsusr</a><br>
                          <br>
                          --<br>
                          Jennifer Miletta Adams<br>
                          Center for Ocean-Land-Atmosphere Studies
                          (COLA)<br>
                          George Mason University<br>
                          <br>
                          <br>
                          <br>
                          <br>
                          ______________________________<wbr>_________________<br>
                          gradsusr mailing list<br>
                          <a href="mailto:gradsusr@gradsusr.org"
                            target="_blank" moz-do-not-send="true">gradsusr@gradsusr.org</a><br>
                          <a
                            href="http://gradsusr.org/mailman/listinfo/gradsusr"
                            target="_blank" rel="noreferrer"
                            moz-do-not-send="true">http://gradsusr.org/mailman/li<wbr>stinfo/gradsusr</a><br>
                        </div>
                      </div>
                    </blockquote>
                  </div>
                  <br>
                </div>
              </div>
            </div>
          </blockquote>
        </div>
        <br>
      </div>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
      <pre wrap="">_______________________________________________
gradsusr mailing list
<a class="moz-txt-link-abbreviated" href="mailto:gradsusr@gradsusr.org">gradsusr@gradsusr.org</a>
<a class="moz-txt-link-freetext" href="http://gradsusr.org/mailman/listinfo/gradsusr">http://gradsusr.org/mailman/listinfo/gradsusr</a>
</pre>
    </blockquote>
    <br>
  </body>
</html>