metobs_toolkit.dataset.Dataset.create_distancematrix#

Dataset.create_distancematrix() DataFrame[source]#

Compute pairwise great-circle distances between all stations.

Calculates a symmetric distance matrix (in meters) between all stations using the haversine formula. Stations that do not have coordinates assigned are excluded and a warning is logged.

Returns:

Symmetric square DataFrame where both the index and columns are station names. Each cell contains the great-circle distance in meters between the corresponding pair of stations. The diagonal contains zeros.

Return type:

pandas.DataFrame