This archive contains answers to questions sent to Unidata support through mid-2025. Note that the archive is no longer being updated. We provide the archive for reference; many of the answers presented here remain technically correct, even if somewhat outdated. For the most up-to-date information on the use of NSF Unidata software and data services, please consult the Software Documentation first.
>To: address@hidden >From: "Kristen E. Malechuk" <address@hidden> >Subject: netCDF Question >Organization: . >Keywords: 199803101951.MAA16346 Hi Kristen, > I think I may be trying to ask a very simple question, that may require a > very difficult response. But anyway... > > I am doing some work for a research team that will be using the EPIC > program. What I need to know is how do we make the convesion of ASCII > data type to netCDF? We will be gathering data from the Seabird SBE-25 > and are using a IRIX computer system. > > I really do not know what other information to add. Is it possible also > to see a sample file on how data is set up? There are several possibilities: ncgen a utility that can read an ASCII description of a netCDF dataset in the form of CDL (this is the same form as the ncdump utility outputs from a binary netCDF file, see for example <http://www.unidata.ucar.edu/packages/netcdf/guidec/guidec-7.html#HEADING7-6>) ascii2nc a perl script that is part of the Unidata decoders package, available from <http://www.unidata.ucar.edu/packages/decoders/>. This requires that you first install the netcdf-perl package. Here's a description from the man page: Creates a netCDF file from the specified cdl file, reads ASCII data from stdin and writes the data to the netCDF file. ascii2nc assumes the input data is in the same order and type as the variables are in the cdl file. ... tbl2cdf Chuck Denham's program to convert a flat ASCII table to a netCDF file. The program scans a flat ASCII table for the name and most general data type of each column. It then creates and populates a netCDF file with the data. It's available in our user-contributed netCDF program collection, in <ftp://ftp.unidata.ucar.edu/pub/netcdf/contrib/tbl2cdf.c>. Also, a custom program should not be too hard, if you use "ncgen -c" or "ncgen -f" to generate the C or Fortran code needed to create a specified netCDF file from a CDL file that specifies the structure of your data. Just insert the statements needed to read the ASCII data in the generated program, and you may have what you need. There may be other possibilities as well. You can check the list of netCDF software available at <http://www.unidata.ucar.edu/packages/netcdf/software.html> for other possibilities. --Russ _____________________________________________________________________ Russ Rew UCAR Unidata Program address@hidden http://www.unidata.ucar.edu