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
calendar The calendar CF attribute.
cell_methods The CellMethods object containing the CF cell methods of the data array.
comment The comment CF attribute.
Conventions The Conventions CF attribute.
_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.
history The history CF attribute.
institution The institution 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.
references The references CF attribute.
scale_factor The scale_factor CF attribute.
source The source CF attribute.
standard_error_multiplier The standard_error_multiplier CF attribute.
standard_name The standard_name CF attribute.
title The title 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 field in place for 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 instance.
equals True if two fields are logically equal, False otherwise.
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 Finalize a newly created field.
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