def prepare(self, fluxes, bins): y = asarray(fluxes[:,0]) self.flux = y self.modelvals = asarray(fluxes[:,1:]) self.xlo, self.xhi = dataspace1d(y.min(), y.max(), numbins=bins+1)[:2] y = histogram1d(y, self.xlo, self.xhi) self.y = y/float(y.max())
def prepare(self, fluxes, bins): """Define the histogram plot. Parameters ---------- fluxes : numpy array The data, stored in a niter by (npar + 2) matrix, where each row is an iteration, the first column is the flux for that row, the next npar columns are the parameter values, and the last column indicates whether the row was clipped (1) or not (0). bins : int The number of bins to split the flux data into. """ fluxes = asarray(fluxes) y = fluxes[:, 0] self.flux = y self.modelvals = fluxes[:, 1:-1] self.clipped = fluxes[:, -1] self.xlo, self.xhi = dataspace1d(y.min(), y.max(), numbins=bins + 1)[:2] y = histogram1d(y, self.xlo, self.xhi) self.y = y / float(y.max())