contraction_agama.py
def contract_enclosed_mass( mass_DM, mass_bar, f_bar=0.157 ):
    """ Returns the contracted DM enclosed mass given the 'uncontracted' profile and that of the baryonic distribution.
    It uses Eq. (10) from Cautun et al (2020).
   
   Args:
      mass_DM       : enclosed mass in the DM component in the absence of baryons. 
                          It corresponds to '(1-baryon_fraction) * enclosed mass in
                          DMO (dark matter only) simulations'.
      mass_bar      : enclosed baryonic mass for which to calculate the DM profile.
      f_bar         : optional cosmic baryonic fraction.
   Returns:
      Array of 'contracted' enclosed masses.
   """
    func_M_DM_contract = lambda M, M_DMO, M_bar: 1.023 * (M_DMO/(1.-f_bar)/(M+M_bar))**-0.540 * M_DMO
    return optimize.fixed_point( func_M_DM_contract, mass_DM.copy(), args=(mass_DM,mass_bar), xtol=1.e-6 )
 Returns the contracted DM enclosed mass given the 'uncontracted' profile and that of the baryonic distribution.
    It uses Eq. (10) from Cautun et al (2020).
   
   Args:
      mass_DM       : enclosed mass in the DM component in the absence of baryons. 
                          It corresponds to '(1-baryon_fraction) * enclosed mass in
                          DMO (dark matter only) simulations'.
      mass_bar      : enclosed baryonic mass for which to calculate the DM profile.
      f_bar         : optional cosmic baryonic fraction.
   Returns:
      Array of 'contracted' enclosed masses.
   
Returns the contracted DM enclosed mass given the 'uncontracted' profile and that of the baryonic distribution.
It uses Eq.
Returns the contracted DM enclosed mass given the ' uncontracted ' profile and that of the baryonic distribution . It uses Eq .
def contract_enclosed_mass( mass_DM, mass_bar, f_bar=0.157 ):
    func_M_DM_contract = lambda M, M_DMO, M_bar: 1.023 * (M_DMO/(1.-f_bar)/(M+M_bar))**-0.540 * M_DMO
    return optimize.fixed_point( func_M_DM_contract, mass_DM.copy(), args=(mass_DM,mass_bar), xtol=1.e-6 )
def contract_enclosed_mass ( mass_DM , mass_bar , f_bar = 0.157 ) : func_M_DM_contract = lambda M , M_DMO , M_bar : 1.023 * ( M_DMO / ( 1. - f_bar ) / ( M + M_bar ) ) ** - 0.540 * M_DMO return optimize . fixed_point ( func_M_DM_contract , mass_DM . copy ( ) , args = ( mass_DM , mass_bar ) , xtol = 1.e-6 )
Returns the contracted DM enclosed mass given the 'uncontracted' profile and that of the baryonic distribution.
Returns the contracted DM enclosed mass given the ' uncontracted ' profile and that of the baryonic distribution .
""" Returns the contracted DM enclosed mass given the 'uncontracted' profile and that of the baryonic distribution.
    It uses Eq. (10) from Cautun et al (2020).
   
   Args:
      mass_DM       : enclosed mass in the DM component in the absence of baryons. 
                          It corresponds to '(1-baryon_fraction) * enclosed mass in
                          DMO (dark matter only) simulations'.
      mass_bar      : enclosed baryonic mass for which to calculate the DM profile.
      f_bar         : optional cosmic baryonic fraction.
   Returns:
      Array of 'contracted' enclosed masses.
   """
Array of 'contracted' enclosed masses.
Array of ' contracted ' enclosed masses .
mass_DM
mass_bar
f_bar
mass_DM       
enclosed mass in the DM component in the absence of baryons.
It corresponds to '(1-baryon_fraction) * enclosed mass in
DMO (dark matter only) simulations'.
enclosed mass in the DM component in the absence of baryons . It corresponds to ' ( 1 - baryon_fraction ) * enclosed mass in DMO ( dark matter only ) simulations ' .
mass_bar      
enclosed baryonic mass for which to calculate the DM profile.
enclosed baryonic mass for which to calculate the DM profile .
f_bar         
optional cosmic baryonic fraction.
optional cosmic baryonic fraction .