[gradsusr] Read binary files written from R

Kiswendsida Hyacinthe Guigma K.Guigma at sussex.ac.uk
Tue Apr 10 07:48:39 EDT 2018


Hi everyone!
I have some meteorological data that I processed using R and I would like to plot them in Grads. Then, I wrote binary files from R and I took time to check that they are well written in the right order. I also wrote a control file. GrADS is able to read the file but it gives so bad values. When I try to display them for example, I get my data range and it is completely different from what I have in R. Actually my data in R span from -0.005 to 0.05 while in Grads I get -5e+37 to 3e+38 !!!
This is my control file code:

DSET    /home/k/kg/kg312/eof.dat
TITLE   EMPIRICAL ORTHOGONAL FUNCTIONS
UNDEF   -99999
XDEF 61 LINEAR -20.5 1
YDEF 12 LINEAR 5.5 1
ZDEF 1 LINEAR 1 1
TDEF 1 LINEAR 16FEB2018 1DY
VARS 1
EOF1 1 99 EOF1
ENDVARS

I thought the problem could be due to a byte swapping. Then I included successively all of the OPTIONS related to that: byteswapped, little_endian and big_endian but none of them solved my problem. 
Both my R and Grads are run on the same machine on Apollo HPC. I used Grads Version 2.1.0 and  Version 2.0.1.oga.1. The R version is R3.4.0 . 

Any help is appreciated!

GUIGMA


More information about the gradsusr mailing list