Commits

Georg Brandl committed 068520a

data: do not make rebinning bin edges depend on data

Comments (0)

Files changed (2)

     # Berlin implementation adds "Finished ..." in the last line,
     # pretend that it is a comment
     arr = loadtxt(fp, ndmin=2, usecols=usecols, comments='F')
+    for i, n in enumerate(names):
+        meta[n] = arr[:,i].mean()
+        meta[n + '__std'] = arr[:,i].std()
     if len(arr) == 0:
         raise UFitError('No data in %s' % filename)
     return names, arr, meta

ufit/data/merge.py

 
     # calculate new x values
     halfbinsize = binsize/2.
-    stops = arange(x.min() - binsize, x.max() + binsize, binsize) + halfbinsize
+    stops = arange(x.min() - (x.min() % binsize) - binsize,
+                   x.max() - (x.max() % binsize) + 2*binsize,
+                   binsize) + halfbinsize
     nbins = len(stops)
 
     # newarray will be the new x, y, m array