Skip to content
Snippets Groups Projects
Commit d5754c38 authored by Lionel GUEZ's avatar Lionel GUEZ
Browse files

Use subprocess instead of pty

Much simpler and more robust. This should also ease submitting the
script to a batch scheduler. And we can now check the return code of
Matlab.
parent 88ec00d5
No related branches found
No related tags found
No related merge requests found
......@@ -16,9 +16,9 @@ import scipy.io as sio
import datetime
import f90nml
import sys
import pty
import os
from dateutil import parser
import subprocess
def define_fields(writers):
"""writers is a dictionary of shapefile.Writer objects."""
......@@ -145,7 +145,7 @@ while True:
if os.access(adt_file, os.R_OK):
print("Processing", my_date, "...")
os.symlink(adt_file, "adt.mat")
pty.spawn(["matlab", "-batch", "inst_eddies"])
subprocess.run(["matlab", "-batch", "inst_eddies"], check = True)
matlab_data = sio.loadmat("adt_v6.mat", squeeze_me = True,
variable_names = ("date_num", "X", "Y",
"Anticyclonic_Cell",
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment