gridfile.fillValue

Specify a fill value for data catalogued in a .grid file


Syntax



Description

fill = obj.fillValue
fill = obj.fillValue(‘default’)

Return the default fill value for a grid file.

sourceFills = obj.fillValue(‘sources’)
sourceFills = obj.fillValue(‘sources’, s)
sourceFills = obj.fillValue(‘sources’, sourceNames)

Return the fill values for the specified data sources. If no sources are specified, returns the fill value for all data sources in the gridfile.

obj.fillValue(fill)

Set the default fill value for data loaded from a .grid file. Numeric data matching the fill value are converted to NaN when loading. This syntax sets the fill value for all data sources currently in the .grid file and applies the fill value by default to all data sources added in the future.

obj.fillValue(fill, s)
obj.fillValue(fill, sourceNames)

Implements a fill value for the specified data sources. The fill value overrides any fill values previously applied to the data sources.


Input Arguments

fill

numeric scalar
The fill value. Data matching the fill value are converted to NaN when loaded from a data source.

s

logical vector [nSources] | vector, linear indices
The indices of the data sources that should be assigned a fill value.

sourceName

string vector
The names of the data sources that should be assigned a fill value. Names may either be just file names, or the full file path / opendap url to the source.

Output Arguments

fill

numeric scalar
The default fill value for the gridfile

sourceFills

numeric vector
The fill values for the specified data sources