<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html;
      charset=windows-1258">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    <p><font size="-1">Hi Raphael,<br>
        in the BAM grid the column of nodes having longitude 0 degree is
        duplicated, so that you find also a column of nodes having
        longitude 360 degree.<br>
        This causes troubles in GrADS.<br>
        You can solve it by pre-processing your grib so that you remove
        the redundant nodes having longitude 360 degree, before to open
        the file in GrADS.<br>
        You can do it easily with a <a
          href="https://code.mpimet.mpg.de/projects/cdo/">CDO</a>
        command.<br>
        Bash example:</font><br>
      <tt><br>
      </tt><tt>> fileIn=bam_0_360.grib2</tt><br>
      <tt>> fileOut=bam_0_359.82.grib</tt><tt>2<br>
      </tt><tt>> cdo -f grb2 sellonlatbox,0,359.82,-89.91,89.91
        $fileIn $fileOut</tt><br>
      <font size="-1"><br>
        Marco</font></p>
    <br>
    <div class="moz-cite-prefix">Il 13/08/2020 16:57, Raphael Ranieri ha
      scritto:<br>
    </div>
    <blockquote type="cite"
cite="mid:BYAPR07MB6856944FED849711928461ADB7430@BYAPR07MB6856.namprd07.prod.outlook.com">
      <meta http-equiv="Content-Type" content="text/html;
        charset=windows-1258">
      <style type="text/css" style="display:none;"> P {margin-top:0;margin-bottom:0;} </style>
      <div style="font-family: Calibri, Helvetica, sans-serif;
        font-size: 12pt; color: rgb(0, 0, 0);">
        Hello Clay,</div>
      <div style="font-family: Calibri, Helvetica, sans-serif;
        font-size: 12pt; color: rgb(0, 0, 0);">
        Thank you for the answer.</div>
      <div style="font-family: Calibri, Helvetica, sans-serif;
        font-size: 12pt; color: rgb(0, 0, 0);">
        <br>
      </div>
      <div style="font-family: Calibri, Helvetica, sans-serif;
        font-size: 12pt; color: rgb(0, 0, 0);">
        Actually if I subtract 360 from the long I will get -360
        longitude as well<br>
        <br>
        Opening the file and asking to print the max and min longitude,
        I checked that it is from 0 to 360.0000000000111</div>
      <div style="font-family: Calibri, Helvetica, sans-serif;
        font-size: 12pt; color: rgb(0, 0, 0);">
        See:</div>
      <div style="font-family: Calibri, Helvetica, sans-serif;
        font-size: 12pt; color: rgb(0, 0, 0);">
        <img size="33238" contenttype="image/png" unselectable="on"
          tabindex="-1" style="color: rgb(0, 0, 0); font-family:
          Calibri, Helvetica, sans-serif; font-size: 12pt; max-width:
          100%; user-select: none;" data-outlook-trace="F:1|T:1"
          src="cid:part2.11896D57.2E661A72@podos3d.sm" class=""><br>
      </div>
      <div style="font-family: Calibri, Helvetica, sans-serif;
        font-size: 12pt; color: rgb(0, 0, 0);">
        <br>
      </div>
      <div style="font-family: Calibri, Helvetica, sans-serif;
        font-size: 12pt; color: rgb(0, 0, 0);">
        If I print point by point values with respective Lat and Long I
        also get longitude of 360 in the end:</div>
      <div style="font-family: Calibri, Helvetica, sans-serif;
        font-size: 12pt; color: rgb(0, 0, 0);">
        <br>
      </div>
      <div style="font-family: Calibri, Helvetica, sans-serif;
        font-size: 12pt; color: rgb(0, 0, 0);">
        <img size="114749" contenttype="image/png" unselectable="on"
          tabindex="-1" style="max-width: 100%; user-select: none;"
          data-outlook-trace="F:1|T:1"
          src="cid:part3.367C145A.4511706F@podos3d.sm" class=""><br>
      </div>
      <div style="font-family: Calibri, Helvetica, sans-serif;
        font-size: 12pt; color: rgb(0, 0, 0);">
        <br>
      </div>
      <div style="font-family: Calibri, Helvetica, sans-serif;
        font-size: 12pt; color: rgb(0, 0, 0);">
        I thought it could be a custom projection or something like
        that, but in ctl it is not specifying anything.</div>
      <div style="font-family: Calibri, Helvetica, sans-serif;
        font-size: 12pt; color: rgb(0, 0, 0);">
        <br>
      </div>
      <div style="font-family: Calibri, Helvetica, sans-serif;
        font-size: 12pt; color: rgb(0, 0, 0);">
        I sent a message to the institute also, but didn't get an
        answer.</div>
      <div style="font-family: Calibri, Helvetica, sans-serif;
        font-size: 12pt; color: rgb(0, 0, 0);">
        <br>
      </div>
      <div style="font-family: Calibri, Helvetica, sans-serif;
        font-size: 12pt; color: rgb(0, 0, 0);">
        I'm very confused.</div>
      <div style="font-family: Calibri, Helvetica, sans-serif;
        font-size: 12pt; color: rgb(0, 0, 0);">
        <br>
      </div>
      <div style="font-family: Calibri, Helvetica, sans-serif;
        font-size: 12pt; color: rgb(0, 0, 0);">
        If anyone have any other hint I appreciate a lot.</div>
      <div style="font-family: Calibri, Helvetica, sans-serif;
        font-size: 12pt; color: rgb(0, 0, 0);">
        <br>
      </div>
      <div style="font-family: Calibri, Helvetica, sans-serif;
        font-size: 12pt; color: rgb(0, 0, 0);">
        Regards,</div>
      <div style="font-family: Calibri, Helvetica, sans-serif;
        font-size: 12pt; color: rgb(0, 0, 0);">
        <br>
      </div>
      <div style="font-family: Calibri, Helvetica, sans-serif;
        font-size: 12pt; color: rgb(0, 0, 0);">
        Raphael Ranieri</div>
      <hr style="display:inline-block;width:98%" tabindex="-1">
      <div id="divRplyFwdMsg" dir="ltr"><font style="font-size:11pt"
          color="#000000" face="Calibri, sans-serif"><b>De:</b> gradsusr
          <a class="moz-txt-link-rfc2396E" href="mailto:gradsusr-bounces@gradsusr.org"><gradsusr-bounces@gradsusr.org></a> em nome de Raphael
          Ranieri <a class="moz-txt-link-rfc2396E" href="mailto:raphaelcr93@hotmail.com"><raphaelcr93@hotmail.com></a><br>
          <b>Enviado:</b> terça-feira, 11 de agosto de 2020 18:07<br>
          <b>Para:</b> <a class="moz-txt-link-abbreviated" href="mailto:gradsusr@gradsusr.org">gradsusr@gradsusr.org</a>
          <a class="moz-txt-link-rfc2396E" href="mailto:gradsusr@gradsusr.org"><gradsusr@gradsusr.org></a><br>
          <b>Assunto:</b> [gradsusr] Negative Longitude of -360 in xdef
          of ctl file</font>
        <div> </div>
      </div>
      <style type="text/css" style="display:none">
<!--
p
        {margin-top:0;
        margin-bottom:0}
-->
</style>
      <div dir="ltr">
        <div style="font-family:Calibri,Helvetica,sans-serif;
          font-size:12pt; color:rgb(0,0,0)">
        </div>
        Hello All,
        <div><br>
        </div>
        <div>I'm trying to use some files of a Brazillian institute of
          meteorology and I'm facing a problem with the longitude
          values.</div>
        <div><br>
        </div>
        <div>They used grads to create a ctl file that can be accessed
          in this FTP from the institution:</div>
        <div><a class="moz-txt-link-freetext" href="http://ftp.cptec.inpe.br/modelos/tempo/BAM/TQ0666L064/recortes/regioes/2020/07/29/00/BAM_CO_2020072900.ctl">http://ftp.cptec.inpe.br/modelos/tempo/BAM/TQ0666L064/recortes/regioes/2020/07/29/00/BAM_CO_2020072900.ctl</a></div>
        <div><br>
        </div>
        <div><img size="180037" tabindex="-1" style="max-width:100%"
            data-outlook-trace="F:2|T:2"
            src="cid:part4.32183FE2.12F109AE@podos3d.sm" class=""><br>
        </div>
        <div><br>
        </div>
        <div>Here we can see that they are using a linear mapping for
          xdef with a 0.18 step starting from a longitude of -360
          degrees according to GrADs docs:</div>
        <div><a class="moz-txt-link-freetext" href="http://cola.gmu.edu/grads/gadoc/descriptorfile.html#XDEF">http://cola.gmu.edu/grads/gadoc/descriptorfile.html#XDEF</a></div>
        <div><br>
        </div>
        <div><br>
        </div>
        <div>Since in our case we need the actual longitude and latitude
          of a point, when we try to read this file we receive
          longitudes of 360 for example, which do not correspond to any
          existing longitude.</div>
        <div><br>
        </div>
        <div>We are not using Grads to open the file, we are using
          pygrib ... to use it in a python program.</div>
        <div><br>
        </div>
        <div>Since this ctl file is generated by grads we tought you
          guys could help.</div>
        <div><br>
        </div>
        <div>Do you know why the longitude is starting at -360?</div>
        <div><br>
        </div>
        <div>Thanks in advance!</div>
        <div><br>
        </div>
        <div>Raphael Ranieri</div>
        <div>
          <div class="x_ii x_gt" style="font-size:0.875rem; margin:8px
            0px 0px">
            <div class="x_a3s x_aXjCH" style="overflow:hidden;
              font:small /1.5 Arial,Helvetica,sans-serif">
              <div dir="ltr">
              </div>
            </div>
          </div>
        </div>
      </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>
    <div class="moz-signature">-- <br>
      <i><b><small><font color="#000000" face="TrebuchetMS">Marco Biordi</font></small></b></i><br>
      <font color="#006600">——————————————————————————</font><br>
      <a href="http://www.podos3d.sm"><img title="PODOS3D di Marco
          Biordi" alt="podos3d"
          src="cid:part5.63C685FC.ED6C7559@podos3d.sm" align="middle"
          height="25" border="0"></a><br>
      <small><small><font color="#000099">Dati Geografici</font> | <font
            color="#000099">Cartografia Digitale</font> | <font
            color="#000099">G.I.S.</font> | <font color="#006600">Modellistica
            Ambientale</font> | <font color="#006600">Meteorologia</font><br>
          <font color="#666666">Indirizzo Sede: viale Antonio Onofri 16
            - 47890 S. Marino Città - Repubblica S. Marino<br>
            Codice Operatore Economico: 20035<br>
            Tel / FAX: (+378) 0549 995487 | Email: <a
              href="mailto:marcobiordi@podos3d.sm">marcobiordi@podos3d.sm</a>
            | Web: <a href="http://www.podos3d.sm">podos3d.sm</a></font></small></small><br>
      <font color="#006600">——————————————————————————</font></div>
  </body>
</html>