meteostat / jasper

Automated tasks for importing, exporting and managing Meteostat data.
https://dev.meteostat.net
MIT License
11 stars 2 forks source link

Wrong Priority Order on Station Dumps #7

Closed clampr closed 3 years ago

clampr commented 3 years ago

When comparing the output and just changing model=True to False I expect to get less rows/ or attributes with NaN/null values. Steps to reproduce:

"""define the periode for fetching"""
start = datetime(2020, 3, 1)
end = datetime(2020, 5, 31, 23, 59)
station = "10488"

"""Get hourly data and opt-out for model data"""
df_weatherdata = Hourly(station, start, end, model=False)
df_weatherdata = df_weatherdata.fetch()
df_weatherdata.reset_index(inplace=True)
df_weatherdata.rename(columns={"time": "datetime"}, inplace=True)
df_weatherdata=df_weatherdata.assign(id_national=station)
print(df_weatherdata)

Results: While model=False I still get values or other values while model=True. A model might be even used when data is present?

For comparising: 10488_2020-03-01_2020-05-31_True.csv 10488_2020-03-01_2020-05-31_False.csv

compared csv files online: https://www.textcompare.org/csv/compare?id=61165041052c9b0015ebb514

Originally posted by @cminton-hub in https://github.com/meteostat/meteostat-python/issues/63#issuecomment-898373302

clampr commented 3 years ago

Attempting to fix in https://github.com/meteostat/routines/commit/b204969935ce16b797592ae001dc11ffbe71b1a0.

clampr commented 3 years ago

I can confirm this is fixed. It wasn't actually an issue with model data. It was rather randomly preferring ISD or DWD data. Now, DWD data is always preferred as this can be considered the most reliable source for weather stations in Germany. Respectively for stations in other countries the national weather service's data will be preferred.