[gradsusr] Negative Longitude of -360 in xdef of ctl file

Marco Biordi - PODOS3D marcobiordi at podos3d.sm
Fri Aug 14 10:06:26 EDT 2020


Hi Raphael,
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.
This causes troubles in GrADS.
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.
You can do it easily with a CDO <https://code.mpimet.mpg.de/projects/cdo/> command.
Bash example:

 > fileIn=bam_0_360.grib2
 > fileOut=bam_0_359.82.grib2
 > cdo -f grb2 sellonlatbox,0,359.82,-89.91,89.91 $fileIn $fileOut

Marco


Il 13/08/2020 16:57, Raphael Ranieri ha scritto:
> Hello Clay,
> Thank you for the answer.
>
> Actually if I subtract 360 from the long I will get -360 longitude as well
>
> Opening the file and asking to print the max and min longitude, I checked that 
> it is from 0 to 360.0000000000111
> See:
>
>
> If I print point by point values with respective Lat and Long I also get 
> longitude of 360 in the end:
>
>
>
> I thought it could be a custom projection or something like that, but in ctl 
> it is not specifying anything.
>
> I sent a message to the institute also, but didn't get an answer.
>
> I'm very confused.
>
> If anyone have any other hint I appreciate a lot.
>
> Regards,
>
> Raphael Ranieri
> --------------------------------------------------------------------------------
> *De:* gradsusr <gradsusr-bounces at gradsusr.org> em nome de Raphael Ranieri 
> <raphaelcr93 at hotmail.com>
> *Enviado:* terça-feira, 11 de agosto de 2020 18:07
> *Para:* gradsusr at gradsusr.org <gradsusr at gradsusr.org>
> *Assunto:* [gradsusr] Negative Longitude of -360 in xdef of ctl file
> Hello All,
>
> I'm trying to use some files of a Brazillian institute of meteorology and I'm 
> facing a problem with the longitude values.
>
> They used grads to create a ctl file that can be accessed in this FTP from the 
> institution:
> http://ftp.cptec.inpe.br/modelos/tempo/BAM/TQ0666L064/recortes/regioes/2020/07/29/00/BAM_CO_2020072900.ctl
>
>
>
> 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:
> http://cola.gmu.edu/grads/gadoc/descriptorfile.html#XDEF
>
>
> 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.
>
> We are not using Grads to open the file, we are using pygrib ... to use it in 
> a python program.
>
> Since this ctl file is generated by grads we tought you guys could help.
>
> Do you know why the longitude is starting at -360?
>
> Thanks in advance!
>
> Raphael Ranieri
>
>
> _______________________________________________
> gradsusr mailing list
> gradsusr at gradsusr.org
> http://gradsusr.org/mailman/listinfo/gradsusr

-- 
/*Marco Biordi*/
——————————————————————————
podos3d <http://www.podos3d.sm>
Dati Geografici | Cartografia Digitale | G.I.S. | Modellistica Ambientale | 
Meteorologia
Indirizzo Sede: viale Antonio Onofri 16 - 47890 S. Marino Città - Repubblica S. 
Marino
Codice Operatore Economico: 20035
Tel / FAX: (+378) 0549 995487 | Email: marcobiordi at podos3d.sm 
<mailto:marcobiordi at podos3d.sm> | Web: podos3d.sm <http://www.podos3d.sm>
——————————————————————————
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://gradsusr.org/pipermail/gradsusr/attachments/20200814/b637e5e6/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Outlook-n4crhngx.png
Type: image/png
Size: 28842 bytes
Desc: not available
URL: <http://gradsusr.org/pipermail/gradsusr/attachments/20200814/b637e5e6/attachment-0004.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Outlook-ciyzrroj.png
Type: image/png
Size: 113107 bytes
Desc: not available
URL: <http://gradsusr.org/pipermail/gradsusr/attachments/20200814/b637e5e6/attachment-0005.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Captura de Tela 2020-07-29 a?s 8.38.13 PM.png
Type: image/png
Size: 180037 bytes
Desc: not available
URL: <http://gradsusr.org/pipermail/gradsusr/attachments/20200814/b637e5e6/attachment-0006.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: logo_h25px.png
Type: image/png
Size: 3302 bytes
Desc: not available
URL: <http://gradsusr.org/pipermail/gradsusr/attachments/20200814/b637e5e6/attachment-0007.png>


More information about the gradsusr mailing list