Commit 8b0e8cf3 authored by Tammo Jan Dijkema's avatar Tammo Jan Dijkema

Wait for measures process on fail

parent 635de08e
......@@ -17,7 +17,7 @@ do
if [ ${psrname} = "0531+21" ]; then
crabflag="-b64"
fi
dspsrcmd="dspsr -k Dwingeloo -E parfiles/${psrname}.par -L 10 ${crabflag} -A $fil"
dspsrcmd="dspsr -f 408.21 -k Dwingeloo -E parfiles/${psrname}.par -L 10 ${crabflag} -A $fil"
echo $dspsrcmd
arname=$( $dspsrcmd 2>&1 | tail -n 1 | sed -e "s/[^']*'\(.*\)'[^']*/\1/g" )
zapname=${arname/.ar/.zap}
......
......@@ -110,19 +110,20 @@ def create_filterbank(source, infile=None, outfile=None, date=None, headeronly=F
print("Running "+cmd)
measure_process = subprocess.Popen(cmd.split())
if showprogressbar:
from tqdm import tqdm
import time
time.sleep(1) # Give measure process time to print something on the screen
with tqdm(total=duration) as pbar:
for time_chunk in range(duration):
pbar.update(1)
if measure_process.poll() is not None:
break
time.sleep(1)
measure_process.wait()
try:
if showprogressbar:
from tqdm import tqdm
import time
time.sleep(1) # Give measure process time to print something on the screen
with tqdm(total=duration) as pbar:
for time_chunk in range(duration):
pbar.update(1)
if measure_process.poll() is not None:
break
time.sleep(1)
finally:
measure_process.wait()
if measure_process.returncode != 0:
raise RuntimeError("Measure process exited abnormally")
......
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