diff --git a/bin/test_plot.py b/bin/test_plot.py index bb186301b90de38d4a49301bf42bc4df888666b9..cc54c7cb781272bd45698c1f6f40eb41a4d07138 100644 --- a/bin/test_plot.py +++ b/bin/test_plot.py @@ -24,9 +24,10 @@ kat.parseCommands(code) kat.add(cavity('cav1', 'm1', 'n3', 'm2', 'n4')) -kat.add(photodiode('pd_cav','n4',num_demods=1, demods=[1])) kat.add(photodiode('pd_ref','n2')) kat.add(photodiode('pd_trs','n5')) +kat.add(photodiode('pd_cav','n4', num_demods=1, demods=[1])) + kat.add(xaxis("lin", [0, 360], kat.m2, kat.m2.phi, 100)) @@ -41,7 +42,6 @@ out = kat.run(printout=0,printerr=0) pl.figure() pl.plot(out.x, out["pd_cav"]) -pl.plot(out.x, out["pd_ref"]) pl.xlabel(out.xlabel) pl.ylabel("Intensity [W]") pl.legend(out.ylabels) diff --git a/pykat/finesse.py b/pykat/finesse.py index e2c8f51d518e80aafc66783254cf459c2159cb0f..5bbd06aae112cd273717604cb1438cd2e3913985 100644 --- a/pykat/finesse.py +++ b/pykat/finesse.py @@ -73,11 +73,13 @@ class katRun(object): idx = [i for i in range(len(self.ylabels)) if self.ylabels[i].split(" ")[0] == str(value)] if len(idx) == 1 and len(self.y.shape) == 1: - return self.y.squeeze() + return self.y + elif len(idx) > 0 and len(self.y.shape) == 1: + return self.y[idx] elif len(idx) > 0: return self.y[:,idx].squeeze() elif len(idx) == 1: - return self.y[idx].squeeze() + return self.y[:,idx].squeeze() else: raise pkex.BasePyKatException("No output by the name {0} found".format(str(value)))