S5.Weather.readgrib.era5_spot#
- S5.Weather.readgrib.era5_spot(dataset: Dataset, start_date: datetime | None = None, end_date: datetime | None = None, latitude: float = 54.766776, longitude: float = 358.430261, elevation: float = 0, distance: float = 0)[source]#
Extract data from era5 grib file for a single spot in space.
Wind direction, wind velocity, temperature, and pressure are extracted from the grib file. The azimuth and elevation are calculated using pvlib.solarposition.
- Parameters:
dataset – xarray dataset with the grib file opened.
start_date – Start date and time with timezone.
end_date – End date and time with timezone.
latitude – Latitude of the location in decimal degrees.
longitude – Longitude of the location in decimal degrees
elevation – Elevation of the spot in meters
distance – Distance along the route.
- Returns:
A pandas dataframe with the weather data.
- Raises:
IndexError – When the start or end date are outside of the available data in the grib file