Home

FillValue

FillValue is a special marker used in data arrays and file formats to indicate that a data element is missing, unknown, or invalid. It functions as a sentinel value that allows software to distinguish gaps from valid measurements and to preserve array shapes in storage and processing.

In NetCDF and related conventions, a variable attribute called _FillValue specifies which value represents missing data

Fill values must be representable within the variable’s data type and are chosen to be unlikely to

In data processing, fill values are ignored or masked during statistical calculations and analyses to avoid

for
that
variable.
Older
practice
sometimes
references
a
missing_value
attribute
as
well;
modern
CF
conventions
standardize
the
use
of
_FillValue.
When
files
are
created
or
read,
software
may
initialize
or
replace
data
with
the
fill
value,
and
readers
often
expose
missing
data
as
masked
values
or
as
NaN.
occur
in
valid
data.
For
integer
types,
a
distinctive
sentinel
such
as
-9999
is
common.
Floating-point
variables
frequently
use
NaN
as
the
fill
value,
with
many
libraries
automatically
mapping
_FillValue
to
NaN
on
read.
bias.
When
writing
data,
authors
specify
the
fill
value
to
maintain
compatibility
across
software
that
consumes
the
file.
Some
formats,
such
as
HDF5,
provide
a
dataset
creation
property
to
set
an
explicit
fill_value
that
pre-fills
memory
with
the
sentinel
value.
Related
topics
include
missing
data,
NaN,
NetCDF,
CF
conventions,
and
HDF5.