Commit b9a68f50 authored by renzo's avatar renzo

fix recover_data

parent 2979a9d8
......@@ -5,12 +5,28 @@ from os.path import isfile, join
import metadata
from main import start, parse_arguments
patterns = {}
patterns["shn"] = {"Argentina"}
patterns["anp"] = {"LPa", "MVD", "IdF"}
patterns["hycom"] = {"fn", "estaciones"}
patterns["noaa"] = {"noaa00", "noaa06", "noaa12", "noaa18"}
patterns["copernicus"] = {"estacionesCOP", "fnaCOP"}
def download_all(args):
config = getattr(metadata, args["source"])
path = config["output_path"]
dates = [datetime.strptime(f[:8], '%Y%m%d') for f in listdir(path) if isfile(join(path, f)) and f[-3:] == "mat"]
min_date = min(dates)
files_per_date = {}
dates = []
for f in listdir(path):
if isfile(join(path, f)) and f[-3:] == "mat":
date = datetime.strptime(f[:8], '%Y%m%d')
if date not in files_per_date:
files_per_date[date] = set()
if files_per_date[date] == patterns[args["source"]]:
min_date = min(files_per_date.keys())
max_date =
cur_date = min_date
while (cur_date <= max_date):
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment