Commit 78ff366a authored by Sebastian Heimann's avatar Sebastian Heimann
Browse files

fits plot: improved plotting of time-shifted traces

parent 2842b108
...@@ -86,6 +86,15 @@ def eigh_sorted(mat): ...@@ -86,6 +86,15 @@ def eigh_sorted(mat):
return evals[iorder], evecs[:, iorder] return evals[iorder], evecs[:, iorder]
def make_norm_trace(a, b, exponent):
tmin = max(a.tmin, b.tmin)
tmax = min(a.tmax, b.tmax)
c = a.chop(tmin, tmax, inplace=False)
bc = b.chop(tmin, tmax, inplace=False)
c.set_ydata(num.abs(c.get_ydata() - bc.get_ydata())**exponent)
return c
class GrondModel(object): class GrondModel(object):
def __init__(self, **kwargs): def __init__(self, **kwargs):
self.listeners = [] self.listeners = []
...@@ -1001,14 +1010,12 @@ def draw_fits_figures(ds, model, plt): ...@@ -1001,14 +1010,12 @@ def draw_fits_figures(ds, model, plt):
spec.ydata *= w spec.ydata *= w
if result.tshift is not None and result.tshift != 0.0: if result.tshift is not None and result.tshift != 0.0:
result.filtered_syn.shift(result.tshift) #result.filtered_syn.shift(result.tshift)
result.processed_syn.shift(result.tshift) result.processed_syn.shift(result.tshift)
dtrace = result.processed_syn.copy() dtrace = make_norm_trace(
dtrace.set_ydata( result.processed_syn, result.processed_obs,
( problem.norm_exponent)
(result.processed_syn.get_ydata() -
result.processed_obs.get_ydata())**2))
target_to_result[target] = result target_to_result[target] = result
......
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