Shah5105
Shah5105

Reputation: 57

Converting from .dat to netcdf(.nc)

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?

Upvotes: 1

Views: 2593

Answers (2)

Rohit Sharma
Rohit Sharma

Reputation: 23

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!

Upvotes: 1

msi_gerva
msi_gerva

Reputation: 2078

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.

Upvotes: 0

Related Questions