Commit 3e5ac3e3 authored by Sebastian Steinlechner's avatar Sebastian Steinlechner
Browse files

katRun.info() updated to give x location of min/max values

parent 260ed16d
Pipeline #1554 canceled with stage
......@@ -277,14 +277,22 @@ class katRun(object):
import numpy as np
maxs = np.max(self.y, 0)
mins = np.min(self.y, 0)
maxlbl = max([len(lbl) for lbl in self.ylabels])
imaxs = np.argmax(self.y, 0)
imins = np.argmin(self.y, 0)
maxs = self.y[imaxs, np.arange(self.y.shape[1])]
mins = self.y[imins, np.arange(self.y.shape[1])]
if not kat.noxaxis:
xmaxs = self.x[imaxs]
xmins = self.x[imins]
else:
xmaxs = np.zeros(self.y.size)
xmins = xmaxs
maxlbl = max([len(lbl) for lbl in self.ylabels])
for i, lbl in enumerate(self.ylabels):
a = "{0:" + str(maxlbl) + "} : min = {1:.15e} max = {2:.15e}"
print(a.format(lbl, mins[i], maxs[i]))
a = "{0:" + str(maxlbl) + "}: min = {1:.15e} @ {2:.15e},\n\tmax = {3:.15e} @ {4:.15e}"
print(a.format(lbl, mins[i], xmins[i], maxs[i], xmaxs[i]))
def plot(self, detectors=None, filename=None, show=True,
......
Supports Markdown
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