From 939d328ee4e1b1a5b4a93ebcd57e313857f9ad93 Mon Sep 17 00:00:00 2001
From: Daniel Brown <ddb@star.sr.bham.ac.uk>
Date: Wed, 2 Dec 2015 15:01:02 +0000
Subject: [PATCH] adding out.info()

---
 bin/test_plot.py |  3 ++-
 pykat/finesse.py | 19 +++++++++++++++++++
 2 files changed, 21 insertions(+), 1 deletion(-)

diff --git a/bin/test_plot.py b/bin/test_plot.py
index 2401f1e..5fca8ad 100644
--- a/bin/test_plot.py
+++ b/bin/test_plot.py
@@ -42,6 +42,7 @@ kat.m2.Rcy =  1000.0
 kat.maxtem = 0
 
 out = kat.run()
-fig = out.plot(yaxis="log abs:deg")
+#fig = out.plot(yaxis="log abs:deg")
 
 #fig.savefig("test_plot.pdf")
+out.info()
\ No newline at end of file
diff --git a/pykat/finesse.py b/pykat/finesse.py
index 2987ef1..5c9cd39 100644
--- a/pykat/finesse.py
+++ b/pykat/finesse.py
@@ -240,6 +240,25 @@ class katRun(object):
         self.katVersion = None
         self.yaxis = None
         
+    def info(self):
+        
+        kat = pykat.finesse.kat()
+        kat.verbose = False
+        kat.parseCommands(self.katScript)
+        
+        detectors = list(set([lbl.split()[0] for lbl in self.ylabels]))
+        detectors.sort()
+        
+        print("--- Output info ---")
+        print("Run date and time: %s" % self.StartDateTime)
+        print("Detectors used: %s" % (", ".join(detectors)))
+        
+        if kat.noxaxis:
+            print("No xaxis used")
+        else:
+            print("One xaxis used: %s" % kat.xaxis.getFinesseText())
+        
+        
     def plot(self, detectors=None, filename=None, show=True, yaxis=None, legend=True, loc=0, title=None):
         """
         This will generate a plot for the output data of this particular pykat run.
-- 
GitLab