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

Re: IDL and NetCDF

From: "Claus Sølvsteen" <cls@fomfrv.dk>

> Is there anyone out there who knows about  using NetCDF in IDL
programming -
> or knows anybody who does?
> I have recently started using this, and my problems are not answered
> entirely from the IDL online manuals and the "basic" NetCDF homepage,
> www.unidata.ucar.edu/packages/netcdf
> For instance, I am in doubt about 1) how do I use (and when should I use)
> unlimited variables, 2) is it possible to use structures as variables, and
> 3) how do I most properly create my program so that it is easily seen
> variables belong together?

These are really netCDF questions rather than IDL questions, and you might
want to take them a netCDF newsgroup. (I think it's sci.data.formats. It's
ages since I looked at that. I wonder if it's still active?) You could also
look in the documentation, eg...


...from which you can extract (with some searching) information about netCDF

But, to have a stab at your questions:

1) Unlimited variables (there can only be one per netCDF file) are used to
represent dimensions, like time, whose size is not known in advance.

2) IDL structures can't be stored directly in netCDF variables, but you can
break the structure up into its constituent tags and store each of these as
a variable, unless the tag is itself a structure in which case you have to
break it up, unless ...

3) netCDF has no explicit mechanism for recording the fact that certain
variables belong with each other. But you can use naming conventions to make
that fact clear. E.g. if you have a structure called "velocity" with tags
"u", "v" and "w" you could store these in netCDF as "velocity_u",
"velocity_v", "velocity_w".

> I have a long set of observations of radar altimetry measurements og
> significant wave heights and wind speeds. So all measurements are acquired
> at different times. One measurement consists of  information about
> acquisition time (year, month, day, decimal hour), lat/lon, SWH, rms of
> measurement, wind speed and others). Note that some variables are
> some are doubles/floats - so I cannot just make a DblArr consisting all
> measurements.
> A file consists of several repeated tracks/cycles and the measurements
> been put into a grid - therefore several measurements within a file may
> belong to a certain grid point though their acquisition times are
> On the other hand, for some grid points there may be no data.
> I hope that someone can help me.

Hmmm. This may require some ingenuity on your part, and you may decide that
netCDF is not the best format for you. It can almost certainly store the
data, but it may not be able to represent all the relationships inherent in
the data. (It's not clear to me exactly what those relationships are.)
Perhaps you could make an unlimited dimension called "acquisition", then
variables called time (Julian date) or "time_year", "time_month", ...,
"lon", "lat", "swh", "swh_rms" etc all varying with "acquisition". The grid
(if it's spatially fixed) can be stored in the same file, and then position
on the grid for each acquisition can be described by one or more variables
dimensioned as "acquisition".

Hope this helps...

Mark Hadfield
m.hadfield@niwa.cri.nz  http://katipo.niwa.cri.nz/~hadfield
National Institute for Water and Atmospheric Research

Posted from clam.niwa.cri.nz [] 
via Mailgate.ORG Server - http://www.Mailgate.ORG