|
|
|
@ -117,12 +117,17 @@ class Grib:
|
|
|
|
)
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
@staticmethod
|
|
|
|
@staticmethod
|
|
|
|
def extract_useful_data():
|
|
|
|
def extract_useful_data(target_time: str = None):
|
|
|
|
"""Download and process GRIB files into csv of requested parameters
|
|
|
|
"""Download and process GRIB files into csv of requested parameters
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
:param target_time: well formed ISO 8601 time string, we will try to download GRIB available just before it
|
|
|
|
|
|
|
|
|
|
|
|
:returns: filenames of the resulting csv
|
|
|
|
:returns: filenames of the resulting csv
|
|
|
|
"""
|
|
|
|
"""
|
|
|
|
|
|
|
|
if not target_time:
|
|
|
|
target_time = Grib.fresh_grib_time()
|
|
|
|
target_time = Grib.fresh_grib_time()
|
|
|
|
|
|
|
|
else:
|
|
|
|
|
|
|
|
target_time = Grib.fresh_grib_time(datetime.fromisoformat(target_time))
|
|
|
|
save_to = f"{target_time.strftime('%Y%m%d')}-{str((target_time.hour // 6) * 6).zfill(2)}.csv"
|
|
|
|
save_to = f"{target_time.strftime('%Y%m%d')}-{str((target_time.hour // 6) * 6).zfill(2)}.csv"
|
|
|
|
|
|
|
|
|
|
|
|
for forecast_hour in range(MAX_FORECAST_HOUR):
|
|
|
|
for forecast_hour in range(MAX_FORECAST_HOUR):
|
|
|
|
|