[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: 960826: cdf&hdf



>To: address@hidden
>From: "Michael O'Neil" <address@hidden>
>Subject: cdf&hdf
>Organization: University of California, Santa Cruz
>Keywords: 199608262254.AA21396

Hi Mike,

>   Hello there.  I'm working on a project that uses hdf for most of our 
> files, but we are getting certain files that are in netCDF format.  I 
> wrote the hdf support people about using our hdf software to read netCDF 
> files, but so far I've only been told about something called ncdump and 
> ncgen, which I haven't been able to find any infromation about.  What I 
> was wondering is if there is any documentation or anything that can help 
> me read in the data from the file.  I'm a little worried becuase it is a 
> 50 meg file, has tons of header information, and when I ran an SDS test 
> on it, it told me that the file had 199 datasets in it, which I don't 
> think is correct.

When you say the files are in netCDF format, I'm not sure whether you
mean Unidata's netCDF format (based on XDR, first four bytes of the file
43 44 46 01 in hexadecimal, or 'C', 'D', 'F', ^A) or whether you mean
HDF format but created with the HDF netCDF interface (first four bytes
0e 03 13 01 in hexadecimal, or ^N, ^C, ^S, ^A).

In the first case, you could use our netCDF software, which includes a
utility program named "ncdump" that reads a binary XDR-based netCDF file
and displays its structure and optionally contents in ASCII.  ncdump is
built as part of the installation of netCDF.  You can find out how to
get the freely-available source and view the on-line User's Guide at the
URL:

   http://www.unidata.ucar.edu/packages/netcdf/

In the second case, you will need to consult the HDF documentation to
find out more about the support in the HDF library for reading and
writing data using the netCDF interface.  As far as I know, the HDF
library can read files in either format, but can only write files in the
HDF format.

I'm surprised the HDF support people didn't know about ncdump, since it
was my understanding that HDF included a version of ncdump linked with
the HDF library for browsing the structure of netCDF files.

Just for your information, ncgen is a program that does the opposite of
ncdump, converting text files that represent the structure and data of a
netCDF file into a binary netCDF file, or into a C or Fortran program
for creating the netCDF file.

_____________________________________________________________________

Russ Rew                                         UCAR Unidata Program
address@hidden                     http://www.unidata.ucar.edu