diff --git a/properties.py b/properties.py index 40e824a..be523b5 100644 --- a/properties.py +++ b/properties.py @@ -61,12 +61,12 @@ def plot_ylabel(self): def _get_profile(self, halo, maxrad): delta = self.plot_xdelta() - nbins = int(0.9*maxrad / delta) - maxrad = 0.1*maxrad + delta * nbins + nbins = int(maxrad / delta) + maxrad = delta * nbins oprof = pynbody.analysis.profile.Profile(halo.g[self.ofilt], type='lin', ndim=3, - min=0.1*maxrad, max=maxrad, nbins=nbins) + min=0, max=maxrad, nbins=nbins) iprof = pynbody.analysis.profile.Profile(halo.g[self.ifilt], type='lin', ndim=3, - min=0.1*maxrad, max=maxrad, nbins=nbins) + min=0, max=maxrad, nbins=nbins) mass_out = (oprof['p_r']/delta).view(np.ndarray) mass_in = (iprof['p_r']/delta).view(np.ndarray) metal_out = (oprof['p_r_metals']/delta).view(np.ndarray) @@ -743,4 +743,4 @@ def calculate(self, halo, properties): mdot_grid_sum, _ = np.histogram(t_orbit[order],weights=Mdot_orbit[order],bins=nbins,range=(0,grid_tmax_Gyr)) mdot_grid_ave = mdot_grid_sum/mdot_grid_n - return mdot_grid_ave[self.store_slice(t_max)] \ No newline at end of file + return mdot_grid_ave[self.store_slice(t_max)]