RasterChannel
Bases: Channel
, Iterable[npt.NDArray]
Channel that contains batched raster data
Notes
- The data items are assumed to be in shape (n, n), where n is the spatial extent in x and y direction
- The
data
property returns a reference to the data - The dunder methods
__getitem__
and__iter__
return or yield a reference to a data item
PARAMETER | DESCRIPTION |
---|---|
data
|
Data
TYPE:
|
name
|
Name
TYPE:
|
buffer_size
|
Buffer size as a fraction of the spatial extent of the data
TYPE:
|
time_step
|
Time step
TYPE:
|
copy
|
If True, the data is copied during initialization
TYPE:
|
name
property
writable
RETURNS | DESCRIPTION |
---|---|
ChannelName | str
|
Name |
buffer_size
property
RETURNS | DESCRIPTION |
---|---|
FractionalBufferSize
|
Buffer size as a fraction of the spatial extent of the data |
time_step
property
writable
RETURNS | DESCRIPTION |
---|---|
TimeStep | None
|
Time step |
is_copied
property
RETURNS | DESCRIPTION |
---|---|
bool
|
If True, the data is copied during initialization |
batch_size
property
RETURNS | DESCRIPTION |
---|---|
int
|
Batch size |
is_in_tiles
property
RETURNS | DESCRIPTION |
---|---|
bool
|
True if the channel is inside tiles, False otherwise |
key
property
RETURNS | DESCRIPTION |
---|---|
ChannelKey
|
Name and time step combination |
data
property
RETURNS | DESCRIPTION |
---|---|
list[npt.NDArray]
|
Data |
__len__
Computes the batch size.
RETURNS | DESCRIPTION |
---|---|
int
|
Batch size |
from_channels
classmethod
Creates a raster channel from raster channels.
PARAMETER | DESCRIPTION |
---|---|
channels
|
Raster channels
TYPE:
|
copy
|
If True, the data is copied during initialization
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
RasterChannel
|
Raster channel |
__eq__
Compares the raster channels.
PARAMETER | DESCRIPTION |
---|---|
other
|
Other raster channel
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
bool
|
True if the raster channels are equal, False otherwise |
__getitem__
Returns the data item.
PARAMETER | DESCRIPTION |
---|---|
index
|
Index or slice of the data item
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
npt.NDArray | list[npt.NDArray]
|
Data item or sliced data |
__iter__
Iterates over the data.
YIELDS | DESCRIPTION |
---|---|
npt.NDArray
|
Data item |
__add__
Adds the raster channels.
PARAMETER | DESCRIPTION |
---|---|
other
|
Other raster channel
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
RasterChannel
|
Raster channel |
append
Appends the data.
PARAMETER | DESCRIPTION |
---|---|
data
|
Data
TYPE:
|
inplace
|
If True, the data is appended inplace
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
RasterChannel
|
Raster channel |
copy
Copies the raster channel.
RETURNS | DESCRIPTION |
---|---|
RasterChannel
|
Raster channel |
remove_buffer
Removes the buffer.
PARAMETER | DESCRIPTION |
---|---|
inplace
|
If True, the buffer is removed inplace
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
RasterChannel
|
Raster channel |