Converting ASC to netcdf
Added by ivanhoe Tebaldeschi almost 4 years ago
Hi,
I need to convert this input ASC file to a netcdf.
I tried using the command
cdo -f nc input,grid2.txt Tmed.nc < Tmed20020101.asc
But it gives me a worning :
cdo input: Enter all 1148 elements of timestep 1! cdo input (Abort): Too few input elements (1145 of 1148)!
Are there any problems in the grid maybe?
Can someone help me in getting the correct netcdf output?
many thanks.
Tmed20020101.asc (313 KB) Tmed20020101.asc | ASC input | ||
grid2.txt (283 Bytes) grid2.txt | grid |
Replies (2)
RE: Converting ASC to netcdf - Added by Ralf Mueller almost 4 years ago
Dear knight Ivanhoe!
From what I understood, there are two issues
- you gridfile
grid2.txt
is not correct because xsize and ysize do not match NCOLS and NROWS in the data file - you text data is not given in the right format, it must contain all datapoints of a single timestep in a single row
I changed both files accordingly (uploaded as '_01' versions of your uploads) and used the following command:
cdo -f nc -input,grid2_01.txt < Tmed20020101.asc_01 out.nc
What I left unchanged is the exact lonlat-locations of you grid (xfirst,yfirst,xinc,yinc)
happy hunting and long live the queen!
Ralf
grid2_01.txt (288 Bytes) grid2_01.txt | |||
Tmed20020101.asc_01 (313 KB) Tmed20020101.asc_01 |
RE: Converting ASC to netcdf - Added by ivanhoe Tebaldeschi almost 4 years ago
Dear Ralf,
Even if I would really love to be a proud knight, the name is the only thing that links me with him.
Thank you very very much.
Ivan