148 """Get a slice of the underlying array
150 If only a single filter is specified,
151 return the single band object sliced
154 if not isinstance(args, tuple):
162 if not isinstance(filterIndex, slice)
and len(filterIndex) == 1:
164 return self.
singles[filterIndex[0]][indices[1:]]
165 elif len(indices) == 2:
166 return self.
singles[filterIndex[0]][indices[1]]
168 return self.
singles[filterIndex[0]]
170 return self.
_slice(filters=filters, filterIndex=filterIndex, indices=indices[1:])
185 """Convert a list of filter names to an index or a slice
189 filterIndex: iterable or `object`
190 Index to specify a filter or list of filters,
191 usually a string or enum.
192 For example `filterIndex` can be
193 `"R"` or `["R", "G", "B"]` or `[Filter.R, Filter.G, Filter.B]`,
194 if `Filter` is an enum.
199 Names of the filters in the slice
200 filterIndex: `slice` or `list` of `int`
201 Index of each filter in `filterNames` in
204 if isinstance(filterIndex, slice):
205 if filterIndex.start
is not None:
209 if filterIndex.stop
is not None:
213 filterIndices = slice(start, stop, filterIndex.step)
216 if isinstance(filterIndex, str):
217 filterNames = [filterIndex]
222 filterNames = [f
for f
in filterIndex]
224 filterNames = [filterIndex]
225 filterIndices = [self.
filtersfilters.index(f)
for f
in filterNames]
226 return tuple(filterNames), filterIndices