Bases: cf.variable.VariableList
An ordered sequence of fields stored in a list-like object.
In some contexts, whether an object is a field or a field list is not known and does not matter. So to avoid ungainly type testing, some aspects of the FieldList interface are shared by a field and vice versa.
Any attribute or method belonging to a field may be used on a field list and will be applied independently to each element.
Just as it is straight forward to iterate over the fields in a field list, a field will behave like a single element field list in iterative and indexing contexts.
Initialization
Parameters : |
|
---|
Apply the coord method to each element of the list.
Note that a coordinate list is returned (as opposed to a field list).
Parameters : | |
---|---|
Returns : | out : CoordinateList |
Return a deep copy.
Equivalent to copy.deepcopy(x)
Returns : |
|
---|
Examples
>>> x.copy()
Uses numerically tolerant equality.
Delete a public attribute from each element of the list of variables.
Return a string containing the full descriptions of each variable in the list.
See also
Return True if two lists are congruent in that
- Each pair of their elements are equal.
- Both instances have equal attributes.
Numerical equality is to within a tolerance. Refer to cf for details.
Parameters: |
|
---|---|
Returns: | True if the two objects are congruent, False otherwise. |
Return the elements which match the given conditions.
The match conditions are passed to each element’s match method in turn.
Parameters : | |
---|---|
Returns : |
|
Examples
>>> f
[<>
<>]
>>> f.extract(attr={'standard_name': 'air_temperature'})
[<>]
Return a built-in list of the public attributes of each element of the list of variables.
Return a built-in list of the public attributes of each element of the list of variables.
Uses numerically tolerant equality.
CFL.insert(index, object) – insert object before index
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 : | |
---|---|
Returns : |
|
Examples
>>> f
[<>
<>]
>>> f.match(attr={'standard_name': 'air_temperature'})
[True, False]
Return a built-in list of the names of each element of the list of variables.
Set a public attribute from each element of the list of variables.
Apply the squeeze method to each element of the list.
Parameters : | |
---|---|
Returns : | out : FieldList |
Apply the unsqueeze method to each element of the list.
Parameters : | |
---|---|
Returns : | out : FieldList |
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.subset[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)>]