Skip to content

Station

The Station class represents a single hydrological monitoring station registered in the IDEAM network. It exposes the station's metadata and provides methods to retrieve the time-series datasets associated with it.

colombia_hydrodata.station.Station dataclass

Immutable representation of a hydrometeorological monitoring station.

Holds all descriptive metadata for a station retrieved from the IDEAM data services, including administrative, geographic, hydrographic, and variable information.

Attributes:

Name Type Description
id str

Unique station identifier code.

name str

Human-readable station name.

category str

Station category (e.g. climática, limnigráfica).

technology str

Data-collection technology used at the station.

status str

Operational status of the station (e.g. Activa, Suspendida).

department str

Colombian department where the station is located.

municipality str

Municipality where the station is located.

installation_date datetime | None

Date the station was commissioned, or None if unknown.

suspension_date datetime | None

Date the station was decommissioned, or None if still active.

owner str

Entity responsible for the station.

location Location

Geographic coordinates and altitude of the station.

hydrographic Hydrographic

Hydrographic area, zone, and sub-zone of the station.

variables dict[str, Variable] | None

Mapping of variable keys to their Variable descriptors, or None if no variable information is available.

from_stations_df(station_id) classmethod

Construct a Station by fetching all metadata from remote data services.

Calls the station, location, hydrographic, and Aquarius dataset endpoints in sequence and assembles a fully populated Station instance from the combined responses.

Parameters:

Name Type Description Default
station_id str

The unique identifier code of the station to fetch.

required

Returns:

Type Description
Self

A fully populated Station instance for the requested station.

__contains__(key)

Return True if key identifies a valid variable on this station.

Parameters:

Name Type Description Default
key str

Variable key to test, case-insensitive.

required

Returns:

Type Description
bool

True if the key resolves to a variable, False otherwise.

fetch(key)

Retrieve the dataset for a given variable key.

Parameters:

Name Type Description Default
key str

Variable key, case-insensitive (e.g. "NIVEL@NV_MEDIA_D").

required

Returns:

Type Description
Dataset

A Dataset populated with observations for the requested variable.

Raises:

Type Description
TypeError

If the station has no variables.

KeyError

If key is not found among the available variables.

__getitem__(key)

Retrieve the dataset for key using bracket notation.

Delegates to :meth:fetch.

Parameters:

Name Type Description Default
key str

Variable key, case-insensitive (e.g. "NIVEL@NV_MEDIA_D").

required

Returns:

Type Description
Dataset

A Dataset populated with observations for the requested variable.

__str__()

Return a human-readable summary of the station.

Returns:

Type Description
str

A multi-line string showing the station's name, identifier,

str

location, status, operational dates, owner, hydrographic context,

str

and available variables grouped by measurement type.