def test_select_component_mass(self): # Check that the Galactic component masses are selected properly thin_mass = MC_samp.select_component_mass(GX_COMPONENT_THIN) self.assertEqual(thin_mass, GX_COMPONENT_MASS_THIN) thick_mass = MC_samp.select_component_mass(GX_COMPONENT_THICK) self.assertEqual(thick_mass, GX_COMPONENT_MASS_THICK) bulge_mass = MC_samp.select_component_mass(GX_COMPONENT_BULGE) self.assertEqual(bulge_mass, GX_COMPONENT_MASS_BULGE)
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