cf.CoordinateList

class cf.CoordinateList(sequence=())

Bases: cf.variable.VariableList

An ordered sequence of coordinates stored in a single, list-like object. Refer to Variable Lists in the cf package for details.

Methods and attributes defined here:

Initialization

Parameters :
sequence : iterable, optional

Define a new list with these elements.

copy()

Return a deep copy.

Equivalent to copy.deepcopy(x)

Returns :
out :

The deep copy.

Examples

>>> x.copy()
count(value) → integer -- return number of occurrences of value

Uses numerically tolerant equality.

delattr(attr)

Delete a public attribute from each element of the list of variables.

dump(*arg, **kwargs)

Return a string containing the full descriptions of each variable in the list.

See also

cf.dump

equals(other, rtol=None, atol=None)

Return True if two lists are congruent in that

  1. Each pair of their elements are equal.
  2. Both instances have equal attributes.

Numerical equality is to within a tolerance. Refer to cf for details.

Parameters:
  • other (object) – The variable to compare against for equality.
  • atol (None or float) – Optional. If None then use the default method for setting the absolute tolerance for numerical equality (refer to cf for details). If a number then set the absolute tolerance to this value for all such comparisons.
  • rtol (None or float) – Optional. If None then use the default method for setting the relative tolerance for numerical equality (refer to cf for details). If a number then set the relative tolerance to this value for all such comparisons.
Returns:

True if the two objects are congruent, False otherwise.

extract(*args, **kwargs)

Return the elements which match the given conditions.

The match conditions are passed to each element’s match method in turn.

Parameters :
*args, **kwargs :

As for the variable’s match method.

Returns :
out :

A new list containing the matching elements.

Examples

>>> f
[<>
 <>]
>>> f.extract(attr={'standard_name': 'air_temperature'})
[<>]
getattr(*args)

Return a built-in list of the public attributes of each element of the list of variables.

hasattr(*args)

Return a built-in list of the public attributes of each element of the list of variables.

index(value[, start[, stop]]) → integer -- return first index of value

Uses numerically tolerant equality.

insert(index, object)

CFL.insert(index, object) – insert object before index

match(*args, **kwargs)

Return a list of booleans showing which elements match the given conditions.

The match conditions are passed to each element’s match method in turn.

Parameters :
*args, **kwargs :

As for the variable’s match method.

Returns :
out : list

A built-in list of booleans showing which elements match the conditions.

Examples

>>> f
[<>
 <>]
>>> f.match(attr={'standard_name': 'air_temperature'})
[True, False]
name(*arg, **kwargs)

Return a built-in list of the names of each element of the list of variables.

setattr(attr, value)

Set a public attribute from each element of the list of variables.

subset

Subset each variable in the list, returning a new list of variables.

Examples

>>> vl
[<CF Variable: air_temperature(73, 96)>,
 <CF Variable: air_temperature(73, 96)>]
>>> vl.subset[0,0]
[<CF Variable: air_temperature(1,1)>,
 <CF Variable: air_temperature(1,1)>]

Previous topic

cf.Comparison

Next topic

cf.FieldList

This Page