1

I have a .dat file https://www.dropbox.com/s/8dbjg0i6l7a4sb6/CRUST10-xyz-complete.dat?dl=0 that I need to convert to either .grd or .nc, so that I can visualize the data in GMT(Generic Mapping Tool). I tried to do this using cdo using following command:

cdo -f nc import_binary  CRUST10-xyz-complete.dat CRUST10-xyz-complete.nc

but got following error:

Open Error:  Unknown keyword in description file
  --> The invalid description file record is: 
  --> 0.5,89.5,4.19,0,2,0.7,0,0.73,1.62,5.01,14.25,10.06,7.36,2.7,1.5,3.81,2,3.5,0,5,6.5,7.1,8.07,5.5865805168986,6.7596467391304,2.3888888888889
  The data file was not opened. 

cdo import_binary (Abort): Open failed!

Can anyone please guide?

ClimateUnboxed
  • 7,106
  • 3
  • 41
  • 86
Shah5105
  • 57
  • 2
  • 8

2 Answers2

1

First make .ctl file then apply:-

cdo -f nc import_binary  CRUST10-xyz-complete.ctl CRUST10-xyz-complete.nc

Here is the example link for to make .ctl file. http://cola.gmu.edu/grads/gadoc/descriptorfile.html

It will definitely work for you. Thanks!

Rohit Sharma
  • 23
  • 1
  • 10
0

Without the data itself, it is hard to see what went wrong. In any case, just look at the following message from cdo forum: https://code.mpimet.mpg.de/boards/1/topics/3631

which you could use as an example of how to convert ASCII data to netCDF using cdo's.

msi_gerva
  • 2,021
  • 3
  • 22
  • 28
  • Question edited. Follow the dropbox link to view the .dat file – Shah5105 Dec 02 '18 at 20:15
  • https://meta.stackexchange.com/questions/8231/are-answers-that-just-contain-links-elsewhere-really-good-answers – Bart Dec 03 '18 at 08:34
  • @Bart, I cannot take credit of others work or just duplicate, when there is a really good example available with Python scripts etc. at cdo webpage... Sometimes it is better to think twice before making an action. – msi_gerva Dec 03 '18 at 10:47
  • I partially understand, but believe that copying the relevant part (of course, mentioning the source) is not a problem. Tomorrow (or next week, month, year, ..) that weblink will be dead, and your answer is no longer an answer :-) – Bart Dec 03 '18 at 10:55