cf.Count¶
-
class
cf.
Count
(properties=None, data=None, source=None, copy=True, _use_data=True)[source]¶ Bases:
cf.mixin.propertiesdata.PropertiesData
,cfdm.count.Count
A count variable required to uncompress a ragged array.
A collection of features stored using a contiguous ragged array combines all features along a single dimension (the sample dimension) such that each feature in the collection occupies a contiguous block.
The information needed to uncompress the data is stored in a count variable that gives the size of each block.
NetCDF interface
The netCDF variable name of the count variable may be accessed with the
nc_set_variable
,nc_get_variable
,nc_del_variable
andnc_has_variable
methods.The name of the netCDF dimension spanned by the count variable’s data may be accessed with the
nc_set_dimension
,nc_get_dimension
,nc_del_dimension
andnc_has_dimension
methods.The name of the netCDF sample dimension spanned by the compressed data (that is stored in the “sample_dimension” netCDF attribute and which does not correspond to a domain axis construct) may be accessed with the
nc_set_sample_dimension
,nc_get_sample_dimension
,nc_del_sample_dimension
andnc_has_sample_dimension
methods.New in version 3.0.0.
Initialisation
- Parameters
- properties:
dict
, optional Set descriptive properties. The dictionary keys are property names, with corresponding values. Ignored if the source parameter is set.
Properties may also be set after initialisation with the
set_properties
andset_property
methods.- Parameter example:
properties={'long_name': 'number of obs'}
- data: data_like, optional
Set the data. Ignored if the source parameter is set.
A data_like object is any object that can be converted to a
Data
object, i.e.numpy
array_like objects,Data
objects, and cf instances that containData
objects.The data also may be set after initialisation with the
set_data
method.A data_like object is any object that can be converted to a
Data
object, i.e.numpy
array_like objects,Data
objects, and cf instances that containData
objects.- source: optional
Initialise the properties and data from those of source.
Note that if source is a
Count
instance thencf.Count(source=source)
is equivalent tosource.copy()
.- copy:
bool
, optional If False then do not deep copy input parameters prior to initialisation. By default arguments are deep copied.
- properties:
Inspection¶
Methods
A full description of the count variable. |
|
Return the canonical identity. |
|
Return all possible identities. |
|
Inspect the object for debugging. |
Attributes
An identity for the Count object. |
Selection¶
Methods
Whether or not the construct identity satisfies conditions. |
|
Whether or not the data has a given dimensionality. |
|
Whether or not the netCDF variable name satisfies conditions. |
|
Whether or not properties satisfy conditions. |
|
Whether or not the construct has given units. |
Properties¶
Methods
Remove a property. |
|
Get a CF property. |
|
Whether a property has been set. |
|
Set a property. |
|
Return all properties. |
|
Remove all properties. |
|
Set properties. |
Attributes
The add_offset CF property. |
|
The calendar CF property. |
|
The comment CF property. |
|
The _FillValue CF property. |
|
The history CF property. |
|
The leap_month CF property. |
|
The leap_year CF property. |
|
The long_name CF property. |
|
The missing_value CF property. |
|
The month_lengths CF property. |
|
The scale_factor CF property. |
|
The standard_name CF property. |
|
The units CF property. |
|
The valid_max CF property. |
|
The valid_min CF property. |
|
The valid_range CF property. |
Units¶
Methods
Override the units. |
|
Override the calendar of date-time units. |
Attributes
The |
Data¶
Attributes
A numpy array deep copy of the data array. |
|
Deprecated at version 3.0.0, use |
|
The |
|
An independent numpy array of date-time objects. |
|
Return an element of the data array as a standard Python scalar. |
|
The |
|
True if the data array is scalar. |
|
The number of dimensions in the data array. |
|
A tuple of the data array’s dimension sizes. |
|
The number of elements in the data array. |
|
A numpy array view of the data array. |
Methods
Return a subspace defined by indices. |
|
Remove the data. |
|
Return the data. |
|
Whether or not the construct has data. |
|
Set the data. |
Rearranging elements
Flatten axes of the data. |
|
Flip (reverse the direction of) data dimensions. |
|
Expand the shape of the data array. |
|
Roll the data along an axis. |
|
Remove size one axes from the data array. |
|
Interchange two axes of an array. |
|
Permute the axes of the data array. |
Data array mask
Return the data array missing data value. |
A binary (0 and 1) missing data mask of the data array. |
|
Count the non-masked elements of the data. |
|
Count the masked elements of the data. |
|
Whether the mask is hard (True) or soft (False). |
|
The mask of the data array. |
|
Mask the array where invalid values occur. |
|
Apply masking as defined by the CF conventions. |
Changing data values
Called to implement assignment to x[indices] |
|
Mask the array where invalid values occur. |
|
Return a new variable whose data is subspaced. |
|
Set data array elements depending on a condition. |
Miscellaneous
Partition the data array. |
|
Close all files referenced by the construct. |
|
Convert reference time data values to have new units. |
|
Set the cyclicity of an axis. |
|
Return or set the period of the data. |
|
Whether or not a given axis is cyclic. |
|
True if a given axis is periodic. |
|
Return the name of the file or files containing the data. |
|
Whether or not there are cell bounds. |
Miscellaneous¶
Methods
Join a sequence of variables together. |
|
Return a deep copy. |
|
Return the commands that would create the construct. |
|
Whether two instances are the same. |
|
Uncompress the construct. |
Attributes
|
|
Always False. |
|
Always False. |
|
Always False. |
|
An identity for the Count object. |
Mathematical operations¶
Methods
Trigonometrical and hyperbolic functions
Take the trigonometric inverse cosine of the data element- wise. |
|
Take the inverse hyperbolic cosine of the data element-wise. |
|
Take the trigonometric inverse sine of the data element-wise. |
|
Take the inverse hyperbolic sine of the data element-wise. |
|
Take the trigonometric inverse tangent of the data element- wise. |
|
Take the inverse hyperbolic tangent of the data element-wise. |
|
Take the trigonometric cosine of the data element-wise. |
|
Take the hyperbolic cosine of the data element-wise. |
|
Take the trigonometric sine of the data element-wise. |
|
Take the hyperbolic sine of the data element-wise. |
|
Take the trigonometric tangent of the data element-wise. |
|
Take the hyperbolic tangent of the data array. |
Rounding and truncation
The ceiling of the data, element-wise. |
|
Limit the values in the data. |
|
Floor the data array, element-wise. |
|
Round the data to the nearest integer, element-wise. |
|
Round the data to the given number of decimals. |
|
Truncate the data, element-wise. |
Statistical collapses
Alias for |
|
The unweighted mean the data array. |
|
The unweighted average of the maximum and minimum of the data array. |
|
Alias for |
|
The absolute difference between the maximum and minimum of the data array. |
|
The number of non-missing data elements in the data array. |
|
The sum of the data array. |
|
Alias for |
|
Alias for |
|
The unweighted sample standard deviation of the data array. |
|
The unweighted sample variance of the data array. |
|
The maximum of the data array. |
|
The minimum of the data array. |
Exponential and logarithmic functions
The exponential of the data, element-wise. |
|
The logarithm of the data array. |
Date-time operations¶
Attributes
The day of each date-time data array element. |
|
An independent numpy array of date-time objects. |
|
The hour of each date-time data array element. |
|
The minute of each date-time data array element. |
|
The month of each date-time data array element. |
|
The reference date-time of units of elapsed time. |
|
The second of each date-time data array element. |
|
The year of each date-time data array element. |
Logic functions¶
Truth value testing
Test whether all data elements evaluate to True. |
|
Test whether any data elements evaluate to True. |
Comparison
Test whether all data are element-wise equal to other, broadcastable data. |
|
Whether two instances are the same. |
|
True if two constructs are equal, False otherwise. |
Set operations
The unique elements of the data. |
NetCDF¶
Methods
Remove the netCDF variable name. |
|
Return the netCDF variable name. |
|
Whether the netCDF variable name has been set. |
|
Set the netCDF variable name. |
|
Remove the netCDF dimension name. |
|
Return the netCDF dimension name. |
|
Whether the netCDF dimension name has been set. |
|
Set the netCDF dimension name. |
|
Remove the netCDF sample dimension name. |
|
Return the netCDF sample dimension name. |
|
Whether the netCDF sample dimension name has been set. |
|
Set the netCDF sample dimension name. |
Aliases¶
Methods
Alias for |
Attributes
Alias for |
Arithmetic and comparison operations¶
Arithmetic, bitwise and comparison operations are defined as element-wise operations on the data, which yield a new construct or, for augmented assignments, modify the construct’s data in-place.
Comparison operators
The rich comparison operator |
|
The rich comparison operator |
|
The rich comparison operator |
|
The rich comparison operator |
|
The rich comparison operator |
|
The rich comparison operator |
Binary arithmetic operators
The binary arithmetic operation |
|
The binary arithmetic operation |
|
The binary arithmetic operation |
|
The binary arithmetic operation |
|
The binary arithmetic operation |
|
The binary arithmetic operation |
|
The binary arithmetic operations |
|
The binary arithmetic operation |
Binary arithmetic operators with reflected (swapped) operands
The binary arithmetic operation |
|
The binary arithmetic operation |
|
The binary arithmetic operation |
|
The binary arithmetic operation |
|
The binary arithmetic operation |
|
The binary arithmetic operation |
|
The binary arithmetic operations |
|
The binary arithmetic operation |
Augmented arithmetic assignments
The augmented arithmetic assignment |
|
The augmented arithmetic assignment |
|
The augmented arithmetic assignment |
|
The augmented arithmetic assignment |
|
The augmented arithmetic assignment |
|
The augmented arithmetic assignment |
|
The augmented arithmetic assignment |
|
The binary arithmetic operation |
Unary arithmetic operators
The unary arithmetic operation |
|
The unary arithmetic operation |
|
The unary arithmetic operation |
Binary bitwise operators
The binary bitwise operation |
|
The binary bitwise operation |
|
The binary bitwise operation |
|
The binary bitwise operation |
|
The binary bitwise operation |
Binary bitwise operators with reflected (swapped) operands
The binary bitwise operation |
|
The binary bitwise operation |
|
The binary bitwise operation |
|
The binary bitwise operation |
|
The binary bitwise operation |
Augmented bitwise assignments
The augmented bitwise assignment |
|
The augmented bitwise assignment |
|
The augmented bitwise assignment |
|
The augmented bitwise assignment |
|
The augmented bitwise assignment |
Unary bitwise operators
The unary bitwise operation |
Groups¶
Methods
Return the netCDF variable group hierarchy. |
|
Remove the netCDF variable group hierarchy. |
|
Set the netCDF variable group hierarchy. |
|
Return the netCDF dimension group hierarchy. |
|
Remove the netCDF dimension group hierarchy. |
|
Set the netCDF dimension group hierarchy. |
|
Remove the netCDF dimension group hierarchy. |
|
Return the netCDF dimension group hierarchy. |
|
Set the netCDF dimension group hierarchy. |
Special¶
Methods
Called to implement membership test operators. |
|
Called by the |
|
Return a subspace defined by indices. |
|
Called by the |
|
Called to implement assignment to x[indices] |
|
Called by the |
|
Returns a numpy array representation of the data. |
|
Returns a new reference to the data. |
|
Implements the “member of set” condition. |
|
Implements the “within a range” condition. |
|
Implements the “without a range” condition. |
Deprecated¶
Methods
Deprecated at version 3.0.0. |
|
Deprecated at version 3.0.0. |
|
Deprecated at version 3.0.0. |
|
Deprecated at version 3.0.0, use method |
|
Deprecated at version 3.0.0. |
|
Deprecated at version 3.0.0, use |
|
Deprecated at version 3.0.0, use method |
|
Expand the data by adding a halo. |
|
Deprecated at version 3.0.0, use |
|
Deprecated at version 3.0.0, use |
|
Deprecated at version 3.0.0, use method |
|
Deprecated at version 3.0.0, use |
|
Deprecated at version 3.7.0, use |
|
Deprecated at version 3.7.0, use |
|
Deprecated at version 3.7.0, use |
|
Deprecated at version 3.7.0, use |
|
Deprecated at version 3.7.0, use |
|
Deprecated at version 3.0.0, use method ‘identity’ instead. |
|
Deprecated at version 3.0.0, use method |
|
Deprecated at version 3.0.0. |
|
Deprecated at version 3.0.0, use method |
|
Deprecated at version 3.0.0, use |