Due to the current gap in continued funding from the U.S. National Science Foundation (NSF), the NSF Unidata Program Center has temporarily paused most operations. See NSF Unidata Pause in Most Operations for details.

Re: [netcdfgroup] ASCII to NetCDF (spazm)

On the web you can find the source code for a program called tbl2cdf.
I find this program useful for putting columnar data in netCDF format.
Here's an example of how I use it to skip the header and then
put three columns of ice core data into a file

fl_stb='icr_JRI_dst_lac_1831_1992'
fl_src="${HOME}/icr/${fl_stb}.txt"
fl_tmp="/tmp/${fl_stb}.txt"
fl_hdr="/tmp/${fl_stb}.hdr"
fl_nc="${DATA}/icr/${fl_stb}.nc"
cat > ${fl_hdr} << EOF
time:f cnc_dst_ngxg:f cnc_lac_ngxg:f
EOF
tail --lines=+2 ${fl_src} > ${fl_tmp}
tbl2cdf -h ${fl_hdr} ${fl_tmp} ${fl_nc}

hope this helps,
charlie



  • 2011 messages navigation, sorted by:
    1. Thread
    2. Subject
    3. Author
    4. Date
    5. ↑ Table Of Contents
  • Search the netcdfgroup archives: