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.
>From: address@hidden (Rob -Not from Bloom County- Binkley, EIT) >Organization: NASA Dryden FRC >Keywords: 199406180327.AA22869 netCDF Rob, >I have installed the netCDF package OK. I also printed out the user's guide >2.3. Are there any simple example programs around? Something simple to get >started ... The simplest way to get started is to use the ncgen and ncdump routines that are a part of the netCDF package. ncgen can be used to create the skeleton of a C or Fortran routine for data that you would like to store (i.e. it would create a source file with all of the pretinent calls to the netCDF interface library). I suggest that you read the section concerning ncgen in the User's Guide for more specific explanation. >I am recording a lot of sensor data from an aircraft. The data looks like: > A frame of 8000 parameters (mixed floats, ints, shorts, and logicals). >Each frame has frame received time associated with it. OK. >I have looked at the user's guide. I believe I want to define "records" to >be written to the netCDF file. Do I define this using a collection of >"vectors"? Time would be the UNLIMITED dimension... You could accomplish your objective in a number of ways. The slowest would be to write each variable to the file for the current "record" (here I am assuming that time would be your record/unlimited dimension). The fastest, and least netCDF-like would be to write vectors of floats, vectors of ints, etc. for each record. The problem with this is that the generality of the netCDF (i.e. the ability to save meaningful meta data with the data itself) is lost (or, at least, made very difficult). The whole purpose of the netCDF is to have a self-describing data form that generic software can use (by generic, I mean software that is NOT written with specific knowledge of the data in the file). This notion automatically makes a tradeoff between speed and generality. It may be the case that your need to write a huge number of parameters to a file in real time would preclude you from using the netCDF. To me this doesn't mean that the netCDF might not be the best form for data that you will want to access regularly later, but, rather, that it might not be the best form for "ingesting" the data. >I believe I'm missing a concept here...variables and dimensions. This notion is the common one concerning multi-dimensional data objects. The one constraint in the netCDF is the ability to have only one unlimited dimension. Tom Yoksas