We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 0c872ec + e427237 commit 54dc7a7Copy full SHA for 54dc7a7
apercal/libs/lib.py
@@ -7,6 +7,7 @@
7
import astropy.io.fits as pyfits
8
import matplotlib.pyplot as plt
9
import numpy as np
10
+import drivecasa
11
12
from apercal.subs import setinit as subs_setinit
13
from apercal.modules import default_cfg
@@ -138,6 +139,18 @@ def exceptioner(O, E):
138
139
raise FatalMiriadError(E)
140
141
142
+def run_casa(cmd, raise_on_severe=False, timeout=1800):
143
+ """Run a list of casa commands"""
144
+ casa = drivecasa.Casapy()
145
+ try:
146
+ casa_output, casa_error = casa.run_script(cmd, raise_on_severe=True, timeout=timeout)
147
+ logger.debug('\n'.join(casa_output))
148
+ except RuntimeError:
149
+ logger.error("Casa command failed")
150
+ if raise_on_severe:
151
+ raise
152
+
153
154
def str2bool(s):
155
if s.upper() == 'TRUE' or s.upper() == "T" or s.upper() == "Y":
156
return True
0 commit comments