stilt.Release#

class stilt.Release(*, kind: str, time: datetime.datetime, altitude_ref: Literal['agl', 'msl']='agl', attrs: dict[str, typing.Any]=<factory>) → None[source]#

Base class of the release types.

A release is a frozen value: its release time, its release points, and the vertical reference of their heights. coords() gives (lon, lat, alt) for each release point. Two releases are equal when their type, time, points, and altitude_ref match; attrs do not count.

Parameters#

Parameter

Description

Default

kind

Release type: point, column, or multipoint.

Required

time

Release time, UTC. A time-zone-aware value is converted to UTC and a naive one taken as UTC. A string must be ISO 8601 or YYYYMMDDHHMM; other forms, such as the day-first 05/07/2023, are refused.

Required

altitude_ref

Whether heights are above ground (agl) or sea level (msl).

'agl'

attrs

Extra labels, such as a site or scene name: the columns of releases.csv that runtraj does not use. They are kept when the releases are written back, and are columns of project.releases and project.simulations to select on. They are not part of the release’s id or of equality.

{}

Attributes#

geometry

Shapely geometry of the release points.

id

Release id, the release time followed by the location id.

location_id

Identifier of this release's location.

plot

Plotting methods, such as release.plot.map().

points

Release points as shapely Point(lon, lat, alt) objects.

Methods#

coords()

Return (lon, lat, alt) of each release point, the order from_points takes.

from_dict(d)

Build a release of the right type from a dict made by to_dict().

from_json(text)

Build a release from the JSON to_json() wrote.

from_points(time, points, *[, altitude_ref, ...])

Build the right release type for a list of points.

to_dict()

Return this release as a plain dict that from_dict() reads back.

to_json()

Return this release as JSON, as result files record it; from_json() reads it back.