Skip to content

Tiles

Bases: Iterable[Channel]

The tiles specify the channels and their spatial extent.

Notes
  • The type alias Tile can be used for semantic consistency if it specifies a single tile instead of a batch of tiles
  • The channels property returns a reference to the channels
  • The dunder methods __getattr__, __getitem__, and __iter__ return or yield a reference to a channel
PARAMETER DESCRIPTION
channels

Channels

TYPE: list[Channel]

coordinates

Coordinates (x_min, y_min) of the tile or of each tile in meters

TYPE: Coordinates | CoordinatesSet

tile_size

Tile size in meters

TYPE: TileSize

copy

If True, the channels are copied during initialization

TYPE: bool DEFAULT: False

channels property

RETURNS DESCRIPTION
list[Channel]

Channels

coordinates property

RETURNS DESCRIPTION
CoordinatesSet

Coordinates (x_min, y_min) of each tile in meters

tile_size property

RETURNS DESCRIPTION
TileSize

Tile size in meters

is_copied property

RETURNS DESCRIPTION
bool

If True, the channels are copied during initialization

area property

RETURNS DESCRIPTION
int

Area in square meters

batch_size property

RETURNS DESCRIPTION
int

Batch size

channel_keys property

RETURNS DESCRIPTION
ChannelKeySet

Channel name and time step combinations

channel_names property

RETURNS DESCRIPTION
ChannelNameSet

Channel names

grid property

RETURNS DESCRIPTION
Grid

Grid

from_composite_raster classmethod

Creates tiles from composite raster data.

Notes
  • Accessing a channel by its name assumes the time step is None
PARAMETER DESCRIPTION
data

Data

TYPE: npt.NDArray

channel_keys

Channel name, channel name and time step combination, channel names, or channel name and time step combinations (if None, the channel is ignored)

TYPE: ChannelName | str | ChannelKey | list[ChannelName | str | ChannelKey | None] | None

coordinates

Coordinates (x_min, y_min) of the tile in meters

TYPE: Coordinates

tile_size

Tile size in meters

TYPE: TileSize

buffer_size

Buffer size in meters

TYPE: BufferSize DEFAULT: 0

copy

If True, the channels are copied during initialization

TYPE: bool DEFAULT: False

RETURNS DESCRIPTION
Tiles

Tiles

from_tiles classmethod

Creates tiles from tiles.

PARAMETER DESCRIPTION
tiles

Tiles

TYPE: list[Tiles]

copy

If True, the channels are copied during initialization

TYPE: bool DEFAULT: False

RETURNS DESCRIPTION
Tiles

Tiles

__eq__

Compares the tiles.

PARAMETER DESCRIPTION
other

Other tiles

TYPE: object

RETURNS DESCRIPTION
bool

True if the tiles are equal, False otherwise

__len__

Computes the number of channels.

RETURNS DESCRIPTION
int

Number of channels

__bool__

Checks if the tiles contain channels.

RETURNS DESCRIPTION
bool

True if the tiles contain channels, False otherwise

__contains__

Checks if the channel is in the tiles.

Notes
  • Accessing a channel by its name assumes the time step is None
PARAMETER DESCRIPTION
channel_key

Channel name or channel name and time step combination

TYPE: ChannelName | str | ChannelKey

RETURNS DESCRIPTION
bool

True if the channel is in the tiles, False otherwise

__getattr__

Returns the channel.

Notes
  • Accessing a channel by its name assumes the time step is None
PARAMETER DESCRIPTION
channel_name

Channel name

TYPE: str

RETURNS DESCRIPTION
Channel

Channel

__getitem__

Returns the channel.

Notes
  • Accessing a channel by its name assumes the time step is None
PARAMETER DESCRIPTION
channel_key

Channel name or channel name and time step combination

TYPE: ChannelName | str | ChannelKey

RETURNS DESCRIPTION
Channel

Channel

__iter__

Iterates over the channels.

YIELDS DESCRIPTION
Channel

Channel

__add__

Adds the tiles.

PARAMETER DESCRIPTION
other

Other tiles

TYPE: Tiles

RETURNS DESCRIPTION
Tiles

Tiles

append

Appends the channels.

PARAMETER DESCRIPTION
channels

Channels

TYPE: Channel | list[Channel]

inplace

If True, the channels are appended inplace

TYPE: bool DEFAULT: False

RETURNS DESCRIPTION
Tiles

Tiles

copy

Copies the tiles.

RETURNS DESCRIPTION
Tiles

Tiles

remove

Removes the channels.

Notes
  • Removing a channel by its name assumes the time step is None
PARAMETER DESCRIPTION
channel_keys

Channel name, channel name and time step combination, channel names, channel name and time step combinations, no channels (False or None), or all channels (True)

TYPE: ChannelName | str | ChannelKey | ChannelNameSet | ChannelKeySet | ChannelNameKeySet | bool | None DEFAULT: True

inplace

If True, the channels are removed inplace

TYPE: bool DEFAULT: False

RETURNS DESCRIPTION
Tiles

Tiles

remove_buffer

Removes the buffer.

Notes
  • Removing the buffer of a channel by its name assumes the time step is None
PARAMETER DESCRIPTION
channel_keys

Channel name, channel name and time step combination, channel names, channel name and time step combinations, no channels (False or None), or all channels (True)

TYPE: ChannelName | str | ChannelKey | ChannelNameSet | ChannelKeySet | ChannelNameKeySet | bool | None DEFAULT: True

inplace

If True, the buffer is removed inplace

TYPE: bool DEFAULT: False

RETURNS DESCRIPTION
Tiles

Tiles

select

Selects the channels.

Notes
  • Selecting a channel by its name assumes the time step is None
PARAMETER DESCRIPTION
channel_keys

Channel name, channel name and time step combination, channel names, channel name and time step combinations, no channels (False or None), or all channels (True)

TYPE: ChannelName | str | ChannelKey | ChannelNameSet | ChannelKeySet | ChannelNameKeySet | bool | None DEFAULT: True

inplace

If True, the channels are selected inplace

TYPE: bool DEFAULT: False

RETURNS DESCRIPTION
Tiles

Tiles

to_composite_raster

Converts the tiles to composite raster data.

Notes
  • Accessing a channel by its name assumes the time step is None
PARAMETER DESCRIPTION
channel_keys

Channel name, channel name and time step combination, channel names, or channel name and time step combinations

TYPE: ChannelName | str | ChannelKey | list[ChannelName | str | ChannelKey]

RETURNS DESCRIPTION
npt.NDArray

Composite raster data