stilt.receptors#

Classes

ColumnReceptor(time, longitude, latitude, ...)

Represents a vertical column receptor at a single (x, y) location, defined by a bottom and top height.

Location(geometry)

Represents a spatial location for STILT models, independent of time.

MultiPointReceptor(time, points)

Represents a receptor composed of multiple 3D points, all at the same time.

PointReceptor(time, longitude, latitude, height)

Represents a single receptor at a specific 3D point (latitude, longitude, height) in space and time.

Receptor(time, location)

SlantReceptor(time, points)

Represents a slanted column receptor, defined by multiple points along the slant.

class stilt.receptors.Location(geometry)[source]#

Represents a spatial location for STILT models, independent of time. Can be used to generate consistent location IDs and create receptors when combined with time.

__init__(geometry)[source]#

Initialize a location with a shapely geometry.

Parameters:

geometry (shapely.Geometry) – A geometric object (e.g., Point, MultiPoint, LineString).

property geometry#

Location geometry.

property id: str#

Generate a unique identifier for this location based on its geometry.

property coords: DataFrame#

Returns the location’s coordinates as a pandas DataFrame.

property points: list[Point]#

Returns a list of shapely Point objects representing the location’s coordinates.

classmethod from_point(longitude, latitude, height)[source]#

Create a Location from a single point.

Parameters:
  • longitude (float) – Longitude coordinate

  • latitude (float) – Latitude coordinate

  • height (float) – Height above ground level

Returns:

A point location

Return type:

Location

classmethod from_column(longitude, latitude, bottom, top)[source]#

Create a Location representing a vertical column.

Parameters:
  • longitude (float) – Longitude coordinate

  • latitude (float) – Latitude coordinate

  • bottom (float) – Bottom height of column

  • top (float) – Top height of column

Returns:

A column location

Return type:

Location

classmethod from_points(points)[source]#

Create a Location from multiple points.

Parameters:

points (list of tuple) – List of (lon, lat, height) tuples

Returns:

A multi-point location

Return type:

Location

class stilt.receptors.Receptor(time, location)[source]#
__init__(time, location)[source]#

A receptor that wraps a geometric object (Point, MultiPoint, etc.) and associates it with a timestamp.

Parameters:
  • time (datetime) – The timestamp associated with the receptor.

  • location (Location) – A location object representing the receptor’s spatial position.

property geometry: Geometry#

Receptor geometry.

property timestr: str#

Get the time as an ISO formatted string.

Returns:

Time in ‘YYYYMMDDHHMM’ format.

Return type:

str

property id: str#
abstract property is_vertical: bool#
static build(time, longitude, latitude, height)[source]#

Build a receptor object from time, latitude, longitude, and height.

Parameters:
  • time (datetime) – Timestamp of the receptor.

  • longitude (float | list[float]) – Longitude(s) of the receptor.

  • latitude (float | list[float]) – Latitude(s) of the receptor.

  • height (float | list[float]) – Height(s) above ground level of the receptor.

Returns:

The constructed receptor object.

Return type:

Receptor

static load_receptors_from_csv(path)[source]#

Load receptors from a CSV file.

Return type:

list[Receptor]

class stilt.receptors.PointReceptor(time, longitude, latitude, height)[source]#

Represents a single receptor at a specific 3D point (latitude, longitude, height) in space and time.

__init__(time, longitude, latitude, height)[source]#

A receptor that wraps a geometric object (Point, MultiPoint, etc.) and associates it with a timestamp.

Parameters:
  • time (datetime) – The timestamp associated with the receptor.

  • location (Location) – A location object representing the receptor’s spatial position.

property longitude: float#
property latitude: float#
property height: float#
__iter__()[source]#

Allow unpacking of PointReceptor into (lon, lat, height).

Return type:

Generator[float, None, None]

class stilt.receptors.MultiPointReceptor(time, points)[source]#

Represents a receptor composed of multiple 3D points, all at the same time.

__init__(time, points)[source]#

A receptor that wraps a geometric object (Point, MultiPoint, etc.) and associates it with a timestamp.

Parameters:
  • time (datetime) – The timestamp associated with the receptor.

  • location (Location) – A location object representing the receptor’s spatial position.

property points: list[Point]#
__iter__()[source]#

Allow unpacking of MultiPointReceptor into its constituent Points.

Return type:

Generator[Point, None, None]

class stilt.receptors.ColumnReceptor(time, longitude, latitude, bottom, top)[source]#

Represents a vertical column receptor at a single (x, y) location, defined by a bottom and top height.

__init__(time, longitude, latitude, bottom, top)[source]#

A receptor that wraps a geometric object (Point, MultiPoint, etc.) and associates it with a timestamp.

Parameters:
  • time (datetime) – The timestamp associated with the receptor.

  • location (Location) – A location object representing the receptor’s spatial position.

property longitude: float#
property latitude: float#
property top: float#
property bottom: float#
classmethod from_points(time, points)[source]#
class stilt.receptors.SlantReceptor(time, points)[source]#

Represents a slanted column receptor, defined by multiple points along the slant.

classmethod from_top_and_bottom(time, bottom, top, numpar, weights=None)[source]#
Parameters:
  • time (any) – Timestamp.

  • bottom (tuple) – (lon, lat, height) tuple for the bottom of the slant.

  • top (tuple) – (lon, lat, height) tuple for the top of the slant.

  • numpar (int) – Number of points along the slant.

  • weights (list of float, optional) – Weights for each point along the slant. Must be the same length as numpar.