cf.FieldList

class cf.FieldList(sequence=())

Bases: cf.field.VariableList

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

Methods and attributes defined here:

coord(*args, **kwargs)

Return the requested coordinate from each field in the list.

copy()

CFL.copy() -> a deep copy of CFL

count(value)

CFL.count(value) -> integer – return number of occurrences of value

Uses numerically tolerant equality.

delpriv(attr)

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

delpub(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

eextract(*arg, **kwargs)

Return the list of variables which match the given phenomena, with only exact phenomenon names allowed.

ematch(*arg, **kwargs)

Return a built-in list of the result of the match on each element of the list of variables, with only exact phenomenon names allowed.

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(*arg, **kwargs)

Return the list of variables which match the given phenomena, with unambiguous abbreviations of phenomenon names allowed.

getpriv(attr, *default)

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

getpub(*args)

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

index(value, start=0, stop=None)

CFL.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(*arg, **kwargs)

Return a built-in list of the result of the match on each element of the list of variables, with unambiguous abbreviations of phenomenon names allowed.

name(*arg, **kwargs)

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

priv(*args, **kwargs)

Set a private attribute from each element of the list of variables or return a built-in list of the private attributes of each element of the list of variables.

pub(*args, **kwargs)

Set a public attribute from each element of the list of variables or return a built-in list of the public attributes of each element of the list of variables.

setpriv(attr, value)

Set a private attribute on each element of the list of variables.

setpub(attr, value)

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

slice

Slice each field in the list, returning a new list of fields. Slicing by indices or by coordinate values are both allowed.

Examples:

>>> sl
[<CF Variable: air_temperature(73, 96)>,
 <CF Variable: air_temperature(73, 96)>]
>>> sl.slice[0,0]
[<CF Variable: air_temperature(1,1)>,
 <CF Variable: air_temperature(1,1)>]
>>> sl.slice(longitude=0, latitude=0)
[<CF Variable: air_temperature(1,1)>,
 <CF Variable: air_temperature(1,1)>]
squash()

Return a built-in list of the result of the match on each element of the list of variables, with unambiguous abbreviations of phenomenon names allowed.

type()

The types of the data stored in each variable’s Data object.

Returns:A list of list of type objects for each of the data. elements.

Examples:

>>> v.type()
[[<type 'netCDF4.Variable'>]]
>>> v.slice[...]
>>> v.type()
[[<type 'numpy.ndarray'>]]

Previous topic

cf.CoordinateList

Next topic

cf.Comparison

This Page