fix multiply function to check if xvals is empty before evaluating further
@@ -99,6 +99,13 @@ class Distribution(object):
x_vals = np.unique(np.concatenate([k.x for k in dists]))
x_vals = x_vals[(x_vals>new_xmin-SUPERTINY_NUMBER)&(x_vals<new_xmax+SUPERTINY_NUMBER)]
y_vals = np.sum([k.__call__(x_vals) for k in dists], axis=0)
+ if not y_vals:
+ print ("ERROR in distribution multiplication: Distributions do not overlap")
+ x_vals = [0,1]
+ y_vals = [BIG_NUMBER,BIG_NUMBER]
+ res = Distribution(x_vals, y_vals, is_log=True,
+ min_width=min_width, kind='linear')
+ return res
peak = y_vals.min()
ind = (y_vals-peak)<BIG_NUMBER/1000
n_points = ind.sum()
