@@ -203,3 +203,137 @@ def colossus_mf(redshift, model, mdef, m_min, m_max, sky_area, cosmology,
203203 cosmology , sigma8 , ns , size , resolution )
204204
205205 return z , m
206+
207+
208+ def concentration (mass , mdef , redshift , model , cosmology , sigma8 , ns ):
209+ r'''Halo concentration calculator.
210+
211+ This function calculates halo concentration(s) using the model of c-M relation
212+ available in colossus.
213+
214+ Parameters
215+ ----------
216+ mass : float or array_like
217+ Spherical overdensity halo mass in units of solar mass/h, corresponding
218+ to the mass definition, mdef.
219+ mdef : str
220+ Halo mass definition for spherical overdensities used by colossus.
221+ redshift : float
222+ Halo redshift
223+ model : string
224+ The model of the c-M relation which is available in colossus.
225+ cosmology : astropy.cosmology.Cosmology
226+ Astropy cosmology object
227+ sigma8 : float
228+ Cosmology parameter, amplitude of the (linear) power spectrum on the
229+ scale of 8 Mpc/h.
230+ ns : float
231+ Cosmology parameter, spectral index of scalar perturbation power spectrum.
232+
233+ Returns
234+ -------
235+ concentration : float or array_like
236+ Halo concentration(s); has the same dimensions as mass.
237+
238+ '''
239+ from colossus .cosmology .cosmology import fromAstropy
240+ from colossus .halo import concentration
241+
242+ fromAstropy (cosmology , sigma8 = sigma8 , ns = ns )
243+
244+ c = concentration .concentration (mass , mdef , redshift , model )
245+
246+ return c
247+
248+
249+ def radius (mass , concentration , redshift , mdef , Delta , cosmology , sigma8 , ns ):
250+ r'''Calculate the scale radius and the spherical overdensity radius of halo by assuming
251+ the NFW model.
252+
253+ This function calculates the scale radius and any spherical overdensity radius
254+ for NFW dark matter halo.
255+
256+ Parameters
257+ ----------
258+ mass : float
259+ A spherical overdensity halo mass in units of solar mass/h, corresponding
260+ to the mass definition, mdef.
261+ concentration : float
262+ The concentration corresponding to the given halo mass and mass definition.
263+ redshift : float
264+ The halo redshift value.
265+ mdef : str
266+ Halo mass definition for spherical overdensities used by colossus.
267+ Delta : str
268+ The mass definition for which the spherical overdensity radius is computed.
269+ cosmology : astropy.cosmology.Cosmology
270+ Astropy cosmology object
271+ sigma8 : float
272+ Cosmology parameter, amplitude of the (linear) power spectrum on the
273+ scale of 8 Mpc/h.
274+ ns : float
275+ Cosmology parameter, spectral index of scalar perturbation power spectrum.
276+
277+ Returns
278+ -------
279+ rs : float
280+ The scale radius in physical kpc/h.
281+ RDelta : float
282+ Spherical overdensity radius of a given mass definition Delta.
283+
284+ '''
285+ from colossus .cosmology .cosmology import fromAstropy
286+ from colossus .halo import profile_nfw
287+
288+ fromAstropy (cosmology , sigma8 = sigma8 , ns = ns )
289+
290+ prof = profile_nfw .NFWProfile (M = mass , c = concentration , z = redshift , mdef = mdef )
291+ rs = prof .par ['rs' ]
292+ RDelta = prof .RDelta (redshift , Delta )
293+
294+ return rs , RDelta
295+
296+
297+ def Delta_Sigma (mass , concentration , redshift , mdef , radius , cosmology , sigma8 , ns ):
298+ r'''The excess surface density at given radius by assuming the NFW model.
299+
300+ This function uses Colossus routines to compute the excess surface density profile,
301+ which is defined as Delta_Sigma(R) = Sigma(<R) − Sigma(R).
302+
303+ Parameters
304+ ----------
305+ mass : float
306+ A spherical overdensity halo mass in units of solar mass/h, corresponding
307+ to the mass definition, mdef.
308+ concentration : float
309+ The concentration corresponding to the given halo mass and mass definition.
310+ redshift : float
311+ Halo redshift
312+ mdef : str
313+ Halo mass definition for spherical overdensities used by colossus.
314+ radius : float or array_like
315+ Radius in physical kpc/h.
316+ cosmology : astropy.cosmology.Cosmology
317+ Astropy cosmology object
318+ sigma8 : float
319+ Cosmology parameter, amplitude of the (linear) power spectrum on the
320+ scale of 8 Mpc/h.
321+ ns : float
322+ Cosmology parameter, spectral index of scalar perturbation power spectrum.
323+
324+ Returns
325+ -------
326+ DeltaSigma: float or array_like
327+ The excess surface density at the given radius, in units of h physical Msun/kpc^2;
328+ has the same dimensions as radius.
329+
330+ '''
331+ from colossus .cosmology .cosmology import fromAstropy
332+ from colossus .halo import profile_nfw
333+
334+ fromAstropy (cosmology , sigma8 = sigma8 , ns = ns )
335+
336+ prof = profile_nfw .NFWProfile (M = mass , c = concentration , z = redshift , mdef = mdef )
337+ deltaSigma = prof .deltaSigma (radius )
338+
339+ return deltaSigma
0 commit comments