Skip to main content

meteostat.interpolate

Estimate weather data at a specific geographical point based on nearby weather stations.

  • Type: Function
  • Source Code: GitHub

Parameters

ParameterDescriptionData TypeDefault Value
tsA TimeSeries object containing weather data from nearby stations.TimeSeriesRequired
pointGeographical point specifying latitude, longitude, and elevation.PointRequired
distance_thresholdMaximum horizontal distance in meters to use Nearest Neighbor. If None, only Nearest Neighbor will be used regardless of distance.int or None5000 (5 km)
elevation_thresholdMaximum elevation difference in meters to use Nearest Neighbor. If None, only Nearest Neighbor will be used regardless of elevation difference.int or None50 (50 m)
elevation_weightWeight for elevation difference in distance calculation.float10
powerPower parameter for IDW (higher = more weight to closer stations).float2
lapse_rateLapse rate in °C per 1000 meters for temperature adjustment. If None, no adjustment will be applied.float or None6.5
lapse_rate_thresholdMinimum elevation difference in meters to apply lapse rate adjustmentint50 (50 m)

Returns

TimeSeries

Time series object with interpolated weather data for the specified point.

Example

from datetime import date
import meteostat as ms

# Specify location and time range
POINT = ms.Point(50.1155, 8.6842, 113) # Coordinates with elevation
START = date(2018, 1, 1)
END = date(2018, 12, 31)

# Get nearby weather stations
stations = ms.stations.nearby(POINT, limit=4)

# Get daily data and perform interpolation
ts = ms.daily(stations, START, END)
df = ms.interpolate(ts, POINT).fetch()

print(df)