cf.Field

class cf.Field(attributes={})

Bases: cf.variable.Variable

A field construct according to the CF data model.

A field is a container for a data array and metadata comprising properties to describe the physical nature of the data and a coordinate system (called a space) which describes the positions of each element of the data array.

It is structured in exactly the same way as a field construct defined by the CF data model.

The field’s space may contain coordinates and cell measures (which themselves contain data arrays and properties to describe them) and transforms to describe how other auxiliary coordinates may be computed.

As in the CF data model, all components of a field are optional.

Initialization

Parameters :
attributes : dict, optional

Initialize a new instance with attributes from the dictionary’s key/value pairs. Values are deep copied.

CF variable attributes

add_offset The add_offset CF attribute.
ancillary_variables
axis The axis CF attribute.
calendar The calendar CF attribute.
cell_methods The CellMethods object containing the CF cell methods of the data array.
_FillValue The _FillValue CF attribute.
flag_masks The flag_masks CF attribute.
flag_meanings The flag_meanings CF attribute.
flag_values The flag_values CF attribute.
leap_month The leap_month CF attribute.
leap_year The leap_year CF attribute.
long_name The long_name CF attribute.
missing_value The missing_value CF attribute.
month_lengths The month_lengths CF attribute.
positive The positive CF attribute.
scale_factor The scale_factor CF attribute.
standard_name The standard_name CF attribute.
units The units CF attribute.
valid_max The valid_max CF attribute.
valid_min The valid_min CF attribute.
valid_range The valid_range CF attribute.

Data attributes

array A numpy array deep copy of the data array.
Data The Data object containing the data array.
dtype Numpy data-type of the data array.
_FillValue The _FillValue CF attribute.
first_datum The first element of the data array.
is_scalar True if and only if the data array is a scalar array.
last_datum The last element of the data array.
mask The boolean missing data mask of the data array.
ndim Number of dimensions in the data array.
shape Tuple of the data array’s dimension sizes.
size Number of elements in the data array.
subset Return a new field whose data and space are subsetted in a consistent manner.
Units The Units object containing the units of the data array.
varray A numpy array view of the data array.

Other attributes

attributes A dictionary of the standard and non-standard CF attributes.
Flags A Flags object containing self-describing CF flag values.
space The Space object containing the coordinate system (space).

Methods

binary_mask return new variable containing binary mask
chunk Partition the data array using LAMA functionality.
coord Return a coordinate of the field.
copy Return a deep copy.
delattr Delete a standard or non-standard CF attribute.
dump Return a string containing a full description of the field.
equals Return True if the variable is congruent to another variable in that
expand_dims Expand the shape of the data array in place.
extract Return the instance if it matches the given conditions.
getattr Get a standard or non-standard CF attribute.
finalize
hasattr Return True if the variable has standard or non-standard CF attribute.
match Determine whether or not a field satisfies conditions.
name Return a name for the variable.
reverse_dims Reverse the directions of data array axes in place.
setattr Set a standard or non-standard CF attribute.
squeeze Remove size 1 dimensions from the field’s data array in place.
transpose Permute the dimensions of the data array in place.
unsqueeze Insert size 1 dimensions from the field’s space into its data array in place.

Previous topic

cf.VariableList

Next topic

cf.Field.add_offset

This Page