Example #1
0
    def compute_n_sample(self):
        """Use the fixed population and total mass sampled to generate the
        fixed population to compute the number of systems in the Milky Way
        realization

        Parameters
        ----------
        fixedpop : DataFrame
            Contains binary parameters from an evolved population
            generated by the runFixedPop executable
        fixed_mass : float
            Total mass sampled to generate the fixed population
        gx_component : str
            Milky Way component for which we are generating the population
            realization; choose from 'ThinDisk', 'ThickDisk', 'Bulge'

        Returns
        -------
        n_samp : int
            The number of systems in the Milky Way realization
        """

        # Compute the mass weighted number of systems
        # in a realistic Milky Way pop
        #######################################################################
        component_mass = MC_sample.select_component_mass(self.gx_component)
        n_samp = MC_sample.mass_weighted_number(self.fixed_pop,
                                                self.fixed_mass,
                                                component_mass)

        return n_samp
Example #2
0
 def test_mass_weighted_number(self):
     # Check that the total population number is scaled properly by mass
     n_pop = MC_samp.mass_weighted_number(FIXED_POP, MASS_FIXED,
                                          GX_COMPONENT_MASS_THIN)
     self.assertEqual(n_pop, N_GX)