Return the indices to the data array which correspond to coordinate values.
Any index for a dimension of the data array for which no coordinates are specified is returned as a full slice (i.e. slice(None)).
Size 1 coordinates for dimensions of the domain which are not spanned by the data array may be specified, but no corresponding index will be returned.
Parameters : |
|
---|---|
Returns : | out : tuple |
Examples
>>> f.indices(lat=0.0, lon=0.0)
(slice(0, 1, 1), slice(0, 1, 1))
>>> f.indices(lon=cf.lt(0.0), lon=cf.set([0, 3.75]))
(slice(0, 32, 1), slice(0, 2, 1))
>>> f.indices(lon=cf.lt(0.0), lon=cf.set([0, 356.25]))
(slice(0, 32, 1), slice(0, 96, 96))
>>> f.indices(lon=cf.lt(0.0), lon=cf.set([0, 3.75, 356.25]))
(slice(0, 32, 1), [0, 1, 95])