Commit edd03ed8 authored by renzo's avatar renzo

se llama a telemac

parent edbbcad1
......@@ -55,6 +55,16 @@ def process(source, args):
os.chdir(data_dir)
matlab_call = create_matlab_call(script, source, args)
subprocess.run(matlab_call, shell=True, check=True, stderr=sys.stderr, stdout=sys.stdout)
run_model(source)
clean(metadata.tmp_path)
def run_model(source):
if source == "hycom":
for filename in os.listdir(metadata.hycom["output_path"]):
date = filename[:8]
if not [dir for dir in os.listdir(metadata.telemac_dir) if dir[7:15] == date]:
subprocess.run(metadata.telemac_script + " 'HYCOM' " + date + " " + date + " 1 8", shell=True, check=True)
def clean(root):
......@@ -77,4 +87,4 @@ def clean(root):
# Remove locks
for filename in os.listdir(root):
if filename[-4:] == "lock" and path.split("/")[-1] in filename:
os.remove(os.path.join(root, filename))
os.remove(os.path.join(root, filename))
\ No newline at end of file
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