Describe the bug
I was trying to get the nearest stations that provides "SOLAR" parameter in hour resolution with recent period based on coordinates and a given rank.
When i run that it generates an error saying: could not convert string to float: '42 54'
To Reproduce
In order to reproduce that error i ran this code:
def get_nearest_stations(lat=49.59, lon=8.16, rank=5):
logger.info(
f"getting nearest stations from latitude:{lat} and longitude: {lon}"
)
try:
stations = (
wetterdienst.provider.dwd.observation.DwdObservationRequest(
parameter=["SOLAR"],
resolution="hourly",
period="recent",
start_date="2017-01-01", # if not given timezone defaulted to UTC
)
.filter_by_rank(latlon=(lat, lon), rank=rank)
.df
)[["station_id", "distance"]]
except Exception as e:
raise ValueError(f"Error fetching nearest stations data: {e}")
logger.info(f"Nearest stations are: {stations.to_dict(orient='records')}")
return stations
get_nearest_stations(lat=49.96, lon=8.25, rank=10)
Expected behavior
It should return a DataFrame containing the 10 nearest stationIds and their distance from the given coordinates.
Screenshots
Desktop (please complete the following information):
Describe the bug I was trying to get the nearest stations that provides "SOLAR" parameter in hour resolution with recent period based on coordinates and a given rank. When i run that it generates an error saying: could not convert string to float: '42 54'
To Reproduce In order to reproduce that error i ran this code:
Expected behavior It should return a DataFrame containing the 10 nearest stationIds and their distance from the given coordinates.
Screenshots![image](https://github.com/earthobservations/wetterdienst/assets/74920057/93f1c45e-dbbd-4e3f-b140-f57e80e5deb0)
Desktop (please complete the following information):