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

[netCDF #KGB-596011]: hole in dataset



Hi Steve,

> How does NetCDF deal with "holes" in a dataset?

A section of the C Users Guide on "Fill Values" answers that question:

  http://www.unidata.ucar.edu/netcdf/docs/netcdf-c.html#Fill-Values

There is also an attribute convention for the variable attribute
"FillValue", described in the NetCDF User's Guide:

  
http://www.unidata.ucar.edu/netcdf/docs/netcdf.html#index-g_t_005fFillValue-256

> eg. my dataset is indexed by month and year, and my file contains data
> for December 2000 and January 2001. If I use nc_get_var_type() to read
> the entire dataset, will I get data for 2 months (ie. Dec 2000 and Jan
> 2001), or will I get data for 24 months (Jan 2000 - Dec 2001)?

When you use the simplest get_var interface to access the whole
variable, you get all the values, including the fill values that
identify data that was never written.  If you want only smaller slices
of the data, you will need to specify the desired slice using the
get_vara interface.

> Does the behaviour change for record variables?

No, they are treated the same as other variables in terms of filee
values, except fill values are only provided up to the largest record
number written.  So a later read could result in a larger amount of
data. 

--Russ

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



Ticket Details
===================
Ticket ID: KGB-596011
Department: Support netCDF
Priority: Normal
Status: Closed