pyrats/trees.py
def plot_accretion_history(self, hid, scale='mass'):
        """Plot halo accretion history.

        Blah
        """
        # Define the selected halo
        halo = self.trees.ix[hid]
        sim = self.sim

        # Get progenitors
        progs = self._get_progenitors(hid)

        # Scalings
        scc = np.log10(progs.m)
        sc = (scc - scc.min()) / (scc.max() - scc.min()) * 500.

        try:
            fig = self.fig
        except AttributeError:
            self.fig = plt.figure(figsize=(12, 12))
        try:
            ax = self.ax
        except AttributeError:
            self.ax = self.fig.add_subplot(111)

        time = np.array([self.timestep['age'][hts - 1]
                         for hts in progs.halo_ts])
        self.ax.scatter(time, progs.m * 1e11, c=progs.halo_ts, s=sc,
                        cmap='summer', rasterized=True)
        self.ax.set_xlabel(r'$t$ (Gyr)')
        self.ax.set_ylabel(r'$M$ ($\mathrm{M}_{\odot}$)')
        self.ax.set_ylim(1e11 * progs.m.min() / 3., 1e11 * progs.m.max() * 3.)
        self.ax.set_xlim(time.min(), time.max())
        self.ax.set_yscale('log')

        self.fig.tight_layout()
        self.fig.savefig('halo_{:d}_history.pdf'.format(
            int(halo.halo_num)), dpi=200, format='pdf')

        return hid
Plot halo accretion history.

        Blah
        
Plot halo accretion history.
Blah
Plot halo accretion history . Blah
def plot_accretion_history(self, hid, scale='mass'):
        halo = self.trees.ix[hid]
        sim = self.sim
        progs = self._get_progenitors(hid)
        scc = np.log10(progs.m)
        sc = (scc - scc.min()) / (scc.max() - scc.min()) * 500.
        try:
            fig = self.fig
        except AttributeError:
            self.fig = plt.figure(figsize=(12, 12))
        try:
            ax = self.ax
        except AttributeError:
            self.ax = self.fig.add_subplot(111)
        time = np.array([self.timestep['age'][hts - 1]
                         for hts in progs.halo_ts])
        self.ax.scatter(time, progs.m * 1e11, c=progs.halo_ts, s=sc,
                        cmap='summer', rasterized=True)
        self.ax.set_xlabel(r'$t$ (Gyr)')
        self.ax.set_ylabel(r'$M$ ($\mathrm{M}_{\odot}$)')
        self.ax.set_ylim(1e11 * progs.m.min() / 3., 1e11 * progs.m.max() * 3.)
        self.ax.set_xlim(time.min(), time.max())
        self.ax.set_yscale('log')
        self.fig.tight_layout()
        self.fig.savefig('halo_{:d}_history.pdf'.format(
            int(halo.halo_num)), dpi=200, format='pdf')
        return hid
def plot_accretion_history ( self , hid , scale = 'mass' ) : halo = self . trees . ix [ hid ] sim = self . sim progs = self . _get_progenitors ( hid ) scc = np . log10 ( progs . m ) sc = ( scc - scc . min ( ) ) / ( scc . max ( ) - scc . min ( ) ) * 500. try : fig = self . fig except AttributeError : self . fig = plt . figure ( figsize = ( 12 , 12 ) ) try : ax = self . ax except AttributeError : self . ax = self . fig . add_subplot ( 111 ) time = np . array ( [ self . timestep [ 'age' ] [ hts - 1 ] for hts in progs . halo_ts ] ) self . ax . scatter ( time , progs . m * 1e11 , c = progs . halo_ts , s = sc , cmap = 'summer' , rasterized = True ) self . ax . set_xlabel ( r'$t$ (Gyr)' ) self . ax . set_ylabel ( r'$M$ ($\mathrm{M}_{\odot}$)' ) self . ax . set_ylim ( 1e11 * progs . m . min ( ) / 3. , 1e11 * progs . m . max ( ) * 3. ) self . ax . set_xlim ( time . min ( ) , time . max ( ) ) self . ax . set_yscale ( 'log' ) self . fig . tight_layout ( ) self . fig . savefig ( 'halo_{:d}_history.pdf' . format ( int ( halo . halo_num ) ) , dpi = 200 , format = 'pdf' ) return hid
Plot halo accretion history.
Plot halo accretion history .
"""Plot halo accretion history.

        Blah
        """ # Define the selected halo # Get progenitors # Scalings
self
hid
scale