ice_shelf_state_and_fate.raster_tools.bounding_box

A simple class for defining and retrieving extent related parameters.

Classes

BoundingBox([min_x, max_x, min_y, max_y, ...])

Defines any number of spatial constraints.

class BoundingBox(min_x: float | None = None, max_x: float | None = None, min_y: float | None = None, max_y: float | None = None, min_t: datetime | float | None = None, max_t: datetime | float | None = None, number_of_points: float | None = None, min_z: float | None = None, max_z: float | None = None)

Bases: object

Defines any number of spatial constraints.

min_x

min x, by default None

Type:

float | None

max_x

max x, by default None

Type:

float | None

min_y

min y, by default None

Type:

float | None

max_y

max y, by default None

Type:

float | None

min_t

min t, by default None

Type:

datetime | float | None

max_t

max t, by default None

Type:

datetime | float | None

number_of_points

number of points in the bounding box, by default None

Type:

float | None

min_z

min z, by default None

Type:

float | None

max_z

max z, by default None

Type:

float | None

Notes

The x and y attributes can be used as longitude and latitude.

as_dict() → dict[str, datetime | float | None]

Return a dictionary of bounding box values.

Returns:

Bounding box return

Return type:

dict[str, datetime | float | None]

coordinate_extent_defined() → bool

Check if a non-zero x/y coordinate extent exists.

Returns:

True if extent defined

Return type:

bool

date_extent_defined() → bool

Check if a non-zero time extent exists.

Returns:

True if extent defined

Return type:

bool

static from_dict(extent_dict: dict[str, datetime | float | None]) → BoundingBox

Build a BoundingBox object from a dictionary.

Parameters:

extent_dict (dict[str, datetime | float | None]) – Dictionary of bounding box values

Returns:

New BoundingBox instance

Return type:

BoundingBox

intersects(bounding_box: BoundingBox) → bool

Check if instances intersects another BoundingBox instance. Touching edges does not count as an intersect.

Parameters:

bounding_box (BoundingBox) – Second test BoundingBox instance

Returns:

True if instances overlap, otherwise false.

Return type:

bool

max_t: datetime | float | None = None
max_x: float | None = None
max_y: float | None = None
max_z: float | None = None
min_t: datetime | float | None = None
min_x: float | None = None
min_y: float | None = None
min_z: float | None = None
number_of_points: float | None = None
z_extent_defined() → bool

Check if a non-zero z (vertical) extent exists.

Returns:

True if extent defined

Return type:

bool