Re: [netcdfgroup] ASCII to NetCDF

It's possible to do this pretty cleanly in NCL (http://ncl.ucar.edu). NCL is a scripting language that will read and write NetCDF very nicely. I've done exactly this operation, and even recently.

gerry

On 08/01/2011 05:45 PM, Sean Arms wrote:
Greetings!

I'm currently working on a program to do such a thing. Basically you would
need to define the layout of your file (like you've done below) in a
point-and-click way, and then run the converter by pointing it to the top
directory of where you ASCII files live. This code, however, is very much
alpha.

When you do make the netCDF files, I would suggest that you make sure to
try and follow CF conventions. Note that your data would likely be
classified as a  "Trajectory of Profiles." To see what you would need to
do to make your netCDF files CF compliant, check out Section A9.6 in the
following document:

http://www.unidata.ucar.edu/staff/caron/public/CFch9-may10.pdf

I have not implemented the Trajectory of Profiles convention in my
converter yet (again, it's a very rough alpha), but it may be the next
thing I try to add.

Cheers!

Sean


Hello,

I have been googleing to find a solution to convert a couple hundreds of
ASCII files to Netcdf however, the solutions I found don't really fit into
my data set. So, I wanted to ask in here.

My ASCII files come from a GWC (generic water column) data. I paste the
header and first two lines of the data below;

/# -----------------------------------------------------
# Source Files Information
# Index Filename
#  0    I:\raw\234.all
# -----------------------------------------------------
# Field Definitions
#  0    Sample File ID (see above)
#  1    Sample Position X
#  2    Sample Position Y
#  3    Sample Position Z
#  4    Sample Value (Amplitude)
#  5    Sample Time
#  6    Sample Range
#  7    Ship Position X
#  8    Ship Position Y
#  9    Ship Heading (degs)
# 10    Ship Pitch (degs)
# 11    Ship Roll (degs)
# 12    Transducer Depth (m)
# 13    Sound Speed (m/s)
# 14    Ping Number X
# 15    Ping Time X
# 16    Sample Number X
# 17    Beam Number X
# 18    Beam Azimuth X
# 19    Beam Elevation X
#0           1           2        3        4       5      6           7
8      9     10     11     12      13    14             15   16  17     18
19
   0   684028.44  4576014.50    -3.76  -127.00  0.0004   0.32   684020.44
4576016.44 238.36   3.25  -0.21   3.28  1504.3 00002  1223471556.46    1  99
0.00  13.98
   0   684028.50  4576014.50    -3.86  -127.00  0.0006   0.49   684020.44
4576016.44 238.36   3.25  -0.21   3.28  1504.3 00002  1223471556.46    2  99
0.00  13.98/

Any suggestions to convert this to netcdf? I installed ferret but couldn't
manage to write the suitable code.

Thanks!

--
View this message in context: 
http://netcdf-group.1586084.n2.nabble.com/ASCII-to-NetCDF-tp6637076p6637076.html
Sent from the NetCDF Group mailing list archive at Nabble.com.

_______________________________________________
netcdfgroup mailing list
netcdfgroup@xxxxxxxxxxxxxxxx
For list information or to unsubscribe,  visit: 
http://www.unidata.ucar.edu/mailing_lists/



_______________________________________________
netcdfgroup mailing list
netcdfgroup@xxxxxxxxxxxxxxxx
For list information or to unsubscribe,  visit: 
http://www.unidata.ucar.edu/mailing_lists/

--
Gerry Creager -- gerry.creager@xxxxxxxx
Texas Mesonet -- AATLT, Texas A&M University
Cell: 979.229.5301 Office: 979.458.4020 FAX: 979.862.3983
Office: 1700 Research Parkway Ste 160, TAMU, College Station, TX 77843



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