From 8ce44924774004f0a424b8e491fc663c81671281 Mon Sep 17 00:00:00 2001
From: James Clark <james.clark@ligo.org>
Date: Wed, 3 Mar 2021 17:17:57 +0000
Subject: [PATCH] Mdc extractor

---
 BayesWaveUtils/bayeswave_pipe/bayeswave_pipe_utils.py | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/BayesWaveUtils/bayeswave_pipe/bayeswave_pipe_utils.py b/BayesWaveUtils/bayeswave_pipe/bayeswave_pipe_utils.py
index 49d7b1e6..9712486b 100644
--- a/BayesWaveUtils/bayeswave_pipe/bayeswave_pipe_utils.py
+++ b/BayesWaveUtils/bayeswave_pipe/bayeswave_pipe_utils.py
@@ -96,6 +96,7 @@ Note that we could use many more env variables for similar purposes if needed.
 import re
 import os,sys
 import socket
+import tarfile
 
 #
 # Preliminary setup
@@ -105,6 +106,16 @@ executable=sys.argv[2]
 if not os.path.exists(outputDir): os.makedirs(outputDir)
 geolocation=open("{0}/{1}_cehostname.txt".format(outputDir, executable), "w")
 
+#
+# Extract MDC data if present
+#
+try:
+    with tarfile.open('mdcs.tar.bz2', 'r') as tar:
+        tar.extractall()
+except:
+    pass
+
+
 #
 # Geolocation
 #
-- 
GitLab