示例#1
0
    def bin_kludged(self):

        k1 = 1
        k2 = 1 / 5 / k1
        self.v2 = (2 * (self.sigma_3d * k1) - 2 * (self.v2a * k2))

        #self.v2 = (2*(self.sigma_3d/5)-2*(self.v2a))
        #v2n = v2/128**3*twopi
        self.binned2 = rb.rb(self.rall, self.v2, bins=self.bins)
        return self.binned2[1], self.binned2[2]
示例#2
0
 def density_plot(self):
     dx = 1. / 128
     bins = np.arange(0.5 * dx, 1, dx)
     fig, ax = plt.subplots(2, 2)
     ax[0][0].imshow(self.ACx.sum(axis=0))
     ax[1][0].imshow(self.ACy.sum(axis=0))
     ax[0][1].imshow(self.ACz.sum(axis=0))
     self.v2abin = rb.rb(self.rall, self.v2a, bins=bins)
     ax[1][1].plot(v2abin[1], v2abin[2])
     self.v2abin = v2abin
     fig.savefig('plots_to_sort/ac.png')
     plt.close(fig)
示例#3
0
 def plot(self):
     dx = 1. / 128
     bins = np.arange(0.5 * dx, 1, dx)
     fig, ax = plt.subplots(2, 2)
     if self.field == 'velocity':
         ax[0][0].imshow(self.ACx.sum(axis=0))
         ax[1][0].imshow(self.ACy.sum(axis=0))
         ax[0][1].imshow(self.ACz.sum(axis=0))
     elif self.field == 'velocity_magnitude':
         ax[0][0].imshow(self.ACv.sum(axis=0))
     elif self.field == 'density':
         ax[0][0].imshow(self.ACdelta.sum(axis=0))
     v2abin = rb.rb(self.rall, self.v2a, bins=bins)
     ax[1][1].plot(v2abin[1], v2abin[2])
     self.v2abin = v2abin
     fig.savefig('plots_to_sort/ac_%s.png' % self.field)
     plt.close(fig)
示例#4
0
    def bin_not_kludged(self):

        self.v2 = 2 * (self.sigma_3d - 2 * (self.v2a))
        #v2n = v2/128**3*twopi
        self.binned2 = rb.rb(self.rall, self.v2, bins=self.bins)
示例#5
0
 def bin_ac(self):
     edge, center, hist = rb.rb(self.rall, self.v2a, bins=self.bins)
     db = edge[1:] - edge[:-1]
     ok = hist > 0
     L = (hist[ok] * db[ok]).sum() / hist[0]
     return center, hist, L
示例#6
0
 def bin_sf2(self):  #was bin_take3
     edge, center, hist = rb.rb(self.rall, self.v2a, bins=self.bins)
     s2 = 2 * (hist[0] - hist)
     self.binned2 = [edge, center, hist]
     return center, s2