cf.BoundedVariable

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

Bases: cf.variable.Variable

Base class for CF dimension coordinate, auxiliary coordinate and domain ancillary objects.

Initialization

Parameters:
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.

source: cf.BoundedVariable, optional

Take the attributes, CF properties and data array from the source object. Any attributes, CF properties or data array specified with other parameters are set after initialisation from the source instance.

copy: bool, optional

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

CF Properties

add_offset The add_offset 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.
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.

Attributes

Data The cf.Data object containing the data array.
T Always False.
Units The Units object containing the units of the data array.
X Always False.
Y Always False.
Z Always False.
add_offset The add_offset CF property.
array A numpy array deep copy of the data array.
binary_mask A binary (0 and 1) missing data mask of the data array.
bounds The cf.Bounds object containing the cell bounds.
calendar The calendar CF property.
cellsize A cf.Data object containing the variable cell sizes.
comment The comment CF property.
data The cf.Data object containing the data array.
day The day of each date-time data array element.
dtarray An independent numpy array of date-time objects.
dtvarray A numpy array view the data array converted to date-time objects.
dtype Numpy data-type of the data array.
hardmask Whether the mask is hard (True) or soft (False).
hasbounds True if there are cell bounds.
hasdata True if there is a data array.
history The history CF property.
hour The hour of each date-time data array element.
isauxiliary True if the variable is an auxiliary coordinate object.
isdimension True if the variable is a dimension coordinate object.
isdomainancillary True if the variable is a domain ancillary object.
isfieldancillary True if the variable is a field ancillary object.
ismeasure True if the variable is a cell measure object.
isperiodic

New in version 2.0.

isscalar True if the data array is scalar.
leap_month The leap_month CF property.
leap_year The leap_year CF property.
long_name The long_name CF property.
lower_bounds The lower cell bounds.
mask The mask of the data array.
minute The minute of each date-time data array element.
missing_value The missing_value CF property.
month The month of each date-time data array element.
month_lengths The month_lengths CF property.
ndim The number of dimensions in the data array.
reference_datetime
scale_factor The scale_factor CF property.
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.
standard_name The standard_name CF property.
subspace Return a new bounded variable whose data and bounds are subspaced in a consistent manner.
units The units CF property.
unsafe_array
upper_bounds The upper cell bounds.
valid_max The valid_max CF property.
valid_min The valid_min CF property.
valid_range The valid_range CF property.
varray A numpy array view of the data array.
year The year of each date-time data array element.

Methods

HDF_chunks(*chunksizes) Specify HDF5 chunks for the data array.
__init__([properties, attributes, data, …]) Initialization
all() Test whether all data array elements evaluate to True.
allclose(y[, atol, rtol]) Returns True if two broadcastable bounded variables have equal array values to within numerical tolerance.
any() Return True if any data array elements evaluate to True.
asdatetime([i]) Convert the internal representation of data array elements to date-time objects.
asreftime([i]) Convert the internal representation of data array elements to numeric reference times.
attributes([attrs, copy]) Inspect or change attributes which are not CF properties.
ceil([i]) The ceiling of the data array.
chunk([chunksize]) Partition the data array.
clip(a_min, a_max[, units, bounds, i]) Limit the values in the data array.
close() Close all files referenced by the bounded variable.
concatenate(variables[, axis, _preserve]) Join a sequence of variables together.
contiguous([overlap]) Return True if a {+variable} has contiguous cells.
convert_reference_time([units, …]) Convert reference time data values to have new units.
copy([_omit_Data, _only_Data, …]) Return a deep copy.
cos([bounds, i]) Take the trigonometric cosine of the data array.
cyclic([axes, iscyclic]) Set the cyclicity of axes of the data array.
datum(*index) Return an element of the data array as a standard Python scalar.
delprop(prop) Delete a CF property.
direction() Return None, indicating that it is not specified whether the values are increasing or decreasing.
dump([display, omit, field, key, _level, _title]) Return a string containing a full description of the variable.
equals(other[, rtol, atol, …]) True if two bounded variables are equal, False otherwise.
equivalent(other[, rtol, atol, traceback]) True if two bounded variables are equal, False otherwise.
exp([bounds, i]) The exponential of the data array.
expand_dims([position, i]) Insert a size 1 axis into the data array.
files() Return the names of any files containing parts of the data array.
fill_value([default]) Return the data array missing data value.
flip([axes, i]) Flip dimensions of the data array and bounds in place.
floor([bounds, i]) Floor the data array.
getprop(prop, *default) Get a CF property.
hasprop(prop) Return True if a CF property exists, otherise False.
identity([default, relaxed_identity]) Return the identity of the bounded variable.
cf.BoundedVariable.insert
insert_bounds(bounds[, copy]) Insert cell bounds.
insert_data(data[, bounds, copy]) Insert a new data array.
inspect() Inspect the object for debugging.
log([base, bounds, i]) The logarithm of the data array.
mask_invalid([i]) Mask the array where invalid values occur.
match([description, ndim, exact, match_and, …]) Determine whether or not a variable satisfies conditions.
max() The maximum of the data array.
mean() The unweighted mean the data array.
mid_range() The unweighted average of the maximum and minimum of the data array.
min() The minimum of the data array.
name([default, identity, ncvar, …]) Return a name for the bounded variable.
override_calendar(calendar[, i]) Override the calendar of date-time units.
override_units(new_units[, i])

New in version 2.0.

properties([props, clear, copy]) Inspect or change the CF properties.
range() The absolute difference between the maximum and minimum of the data array.
remove_data() Remove and return the data array.
rint([bounds, i]) Round data array.
roll(iaxis, shift[, i]) Roll the bounded variable along an axis.
round([decimals, bounds, i]) Round the data array.
sample_size() The number of non-missing data elements in the data array.
sd() The unweighted sample standard deviation of the data array.
select(*args, **kwargs) cf.BoundedVariable.select has been deprecated.
setprop(prop, value) Set a CF property.
sin([bounds, i]) The trigonometric sine of the data array.
squeeze([axes, i]) Remove size 1 dimensions from the data array
sum() The sum of the data array.
tan([bounds, i]) The trigonometric tangent of the data array.
transpose([axes, i]) Permute the dimensions of the data.
trunc([bounds, i]) Truncate the data array.
unique() The unique elements of the data array.
var() The unweighted sample variance of the data array.
where(condition[, x, y, i]) Set data array elements depending on a condition.