I have a GrADS formatted (Raw Binary) file with a control file as follows:
dset data.bin
undef -999.
options template
title Example data
xdef 720 linear 0.25 0.50
ydef 360 linear -89.75 0.50
tdef 1 linear 00Z01JAN1990 1yr
zdef 1 linear 1 1
vars 1
dat 0 99 Estimated data
ENDVARS
Does anyone have an idea of how to convert or reformat it into a common 2D raster file format using R or Python?
The expected output is a 2D map (which is usually as a raster file or 2D array) something like this map: Example of output
You can use CDO (Climate Data Operator) to do this by one line of code like
But CDO installation in Windows is bit tricky. You can install Ubuntu subsystem within Windows and then install CDO within Ubuntu. After that install CDO in Ubuntu subsystem following the steps provided here https://zoomadmin.com/HowToInstall/UbuntuPackage/cdo. Then open the terminal in the directory where the .ctl file is there, then execute the above code.