M meteo_scraper/ecmwf_scraper.py +4 -2
@@ 107,17 107,19 @@ def exploit_grib_file_hres(tsa, gribfile
val_zone = values[:, mask_zone]
val_mean_zone = np.mean(val_zone, axis=1)
ts = pd.Series(data=val_mean_zone, index = index)
+ ts = ts.tz_localize('utc')
seriesname = f'meteo.area.{zone.lower()}.{param}.{unit.lower()}.hres.ecmwf.fcst.3-6h'
- tsa.replace(seriesname, ts, author='scraper-ecmwf') #replace
+ tsa.update(seriesname, ts, author='scraper-ecmwf') #replace
print(f'retrieving {param} for cities...')
for row in CITIES.iterrows():
index_city = nearest_gridpoint(row[1].lng, row[1].lat, 'ecmwf')
val_city = values[:, index_city]
ts = pd.Series(data=val_city, index = index)
+ ts = ts.tz_localize('utc')
seriesname = f"meteo.city.{(row[1].country).replace(' ', '').lower()}.{(row[1].city_ascii).replace(' ', '').lower()}.{param}.{unit.lower()}.hres.ecmwf.fcst.3-6h"
- tsa.replace(seriesname, ts, author='scraper-ecmwf')
+ tsa.update(seriesname, ts, author='scraper-ecmwf')
def exploit_grib_file_ens(tsa, gribfile, param, unit):
M meteo_scraper/gfs_scraper.py +4 -2
@@ 60,14 60,16 @@ def get_last_run_data(tsa):
val_zone = data[:, mask_zone]
val_mean_zone = np.mean(val_zone, axis=1)
ts = pd.Series(data=val_mean_zone, index = time)
+ ts = ts.tz_localize('utc')
seriesname = f'meteo.area.{zone.lower()}.{param}.{unit.lower()}.gfs.1p00.fcst.3h'
- tsa.replace(seriesname, ts, author='scraper-gfs')
+ tsa.update(seriesname, ts, author='scraper-gfs')
print(f'retrieving {param} for cities...')
for row in CITIES.iterrows():
index_city = nearest_gridpoint(row[1].lng, row[1].lat, '1p00')
val_city = data[:, index_city]
ts = pd.Series(data=val_city, index = time)
+ ts = ts.tz_localize('utc')
seriesname = f"meteo.city.{(row[1].country).replace(' ', '').lower()}.{(row[1].city_ascii).replace(' ', '').lower()}.{param}.{unit.lower()}.gfs.1p00.fcst.3h"
- tsa.replace(seriesname, ts, author='scraper-gfs')
+ tsa.update(seriesname, ts, author='scraper-gfs')