cf.Coordinate

class cf.Coordinate(properties={}, attributes={}, data=None, bounds=None, source=None, copy=True)[source]

Bases: cf.boundedvariable.BoundedVariable

Base class for a CF dimension or auxiliary coordinate construct.

Attributes

Attribute Type Description
climatology bool Whether or not the bounds are intervals of climatological time. Presumed to be False if unset.

Initialization

Parameters:
properties: dict, optional

Initialize a new instance with CF properties from a dictionary’s key/value pairs.

attributes: dict, optional

Provide the new instance with attributes from a dictionary’s key/value pairs.

data: cf.Data, optional

Provide the new instance with an N-dimensional data array.

bounds: cf.Data or cf.Bounds, optional

Provide the new instance with cell bounds.

copy: bool, optional

If False then do not copy arguments prior to initialization. By default arguments are deep copied.

Coordinate CF properties

add_offset The add_offset CF property.
axis The axis CF property.
calendar The calendar CF property.
comment The comment CF property.
_FillValue The _FillValue CF property.
history The history CF property.
leap_month The leap_month CF property.
leap_year The leap_year CF property.
long_name The long_name CF property.
missing_value The missing_value CF property.
month_lengths The month_lengths CF property.
positive The positive CF property.
scale_factor The scale_factor CF property.
standard_name The standard_name CF property.
units The units CF property.
valid_max The valid_max CF property.
valid_min The valid_min CF property.
valid_range The valid_range CF property.

Coordinate attributes

array A numpy array deep copy of the data array.
attributes([attrs, copy]) Attributes which are not CF properties.
bounds The cf.Bounds object containing the cell bounds.
cellsize A cf.Data object containing the variable cell sizes.
ctype The CF coordinate type.
data The cf.Data object containing the data array.
dtarray An independent numpy array of date-time objects.
dtype Numpy data-type of the data array.
day The day of each date-time data array element.
hardmask Whether the mask is hard (True) or soft (False).
hasbounds True if there are cell bounds.
hour The hour of each date-time data array element.
isauxiliary False, denoting that the variable is not an auxiliary coordinate object.
isdimension False, denoting that the variable is not a dimension coordinate object.
isscalar True if the data array is scalar.
lower_bounds The lower cell bounds in a cf.Data object.
mask The mask of the data array.
minute The minute of each date-time data array element.
month The month of each date-time data array element.
ndim The number of dimensions in the data array.
properties([props, clear, copy]) Attributes which are CF properties.
second The second of each date-time data array element.
shape A tuple of the data array’s dimension sizes.
size The number of elements in the data array.
subspace Return a new bounded variable whose data and bounds are subspaced in a consistent manner.
T True if and only if the coordinates are for a CF T axis.
unique() The unique elements of the data array.
Units The Units object containing the units of the data array.
upper_bounds The upper cell bounds in a cf.Data object.
varray A numpy array view of the data array.
X True if and only if the coordinates are for a CF X axis.
Y True if and only if the coordinates are for a CF Y axis.
year The year of each date-time data array element.
Z True if and only if the coordinates are for a CF Z axis.

Coordinate methods

asauxiliary Return the coordinate recast as an auxiliary coordinate.
asdimension Return the coordinate recast as a dimension coordinate.
binary_mask A binary (0 and 1) missing data mask of the data array.
chunk Partition the data array.
clip Clip (limit) the values in the data array and its bounds in place.
close Close all files referenced by the bounded variable.
contiguous Return True if a coordinate has contiguous cells.
convert_reference_time Convert reference time data values to have new units.
copy Return a deep copy.
cos Take the trigonometric cosine of the data array and bounds in place.
datum Return an element of the data array as a standard Python scalar.
delprop Delete a CF property.
dump Return a string containing a full description of the coordinate.
equals True if two coordinates are equal, False otherwise.
expand_dims Insert a size 1 axis.
files Return the names of any files containing parts of the data array.
fill_value Return the data array missing data value.
flip Flip dimensions of the data array and bounds in place.
getprop Get a CF property.
hasprop Return True if a CF property exists, otherise False.
HDF_chunks
identity Return the identity.
insert_bounds Insert cell bounds.
insert_data Insert a new data array.
mask_invalid Mask the array where invalid values occur (NaN or inf).
match Determine whether or not a variable satisfies conditions.
name Return a name.
override_units

New in version 2.0.

select Return the instance if it matches the given conditions.
setprop Set a CF property.
sin Take the trigonometric sine of the data array and bounds in place.
squeeze Remove size 1 dimensions from the data array and bounds in place.
transpose Permute the dimensions of the data array and bounds in place.
where Set data array elements depending on a condition.