Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Halo circular velocity function from Maller & Bullock 2004 #284

Closed
Closed
Changes from 6 commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
a8226f9
Placeholder for halo circuloar velocity function
sarahbridle Sep 22, 2020
c1a2f53
drafted the circular velocity code pending testing
sarahbridle Sep 22, 2020
309223a
managed to run this version and get some numbers out. noted some majo…
sarahbridle Sep 22, 2020
95928f0
Merge branch 'master' into halo-circular-velocity
sarahbridle Sep 29, 2020
9a46b24
Update skypy/halo/properties.py
sarahbridle Sep 29, 2020
23dfe37
Update skypy/halo/properties.py
sarahbridle Sep 29, 2020
d2aa008
Responded to comments to tidy up names etc
sarahbridle Sep 29, 2020
685ca0e
fixed over indented block pointed out by Lucia
sarahbridle Sep 29, 2020
8e4149a
Fixed errors in equation and fixed units - but distracted by reloadin…
sarahbridle Oct 2, 2020
0979f27
Merge branch 'master' into halo-circular-velocity
sarahbridle Oct 2, 2020
e87e0c3
Merge branch 'master' into halo-circular-velocity
itrharrison Oct 7, 2020
fa8e855
Revert "strip halo module"
skypybot Feb 1, 2021
57824ad
Revert "strip power_spectrum module"
skypybot Feb 1, 2021
7628ac4
Merge branch 'module/power_spectrum' into module/halo
skypybot Feb 1, 2021
75a9fe5
Merge remote-tracking branch 'skypyproject/master' into module/halo
rrjbca Feb 1, 2021
9346b2f
rename skypy.halo to skypy.halos (#420)
rrjbca Feb 2, 2021
7165490
Merge remote-tracking branch 'skypyproject/master' into module/halos
rrjbca Feb 15, 2021
761ccf0
Merge remote-tracking branch 'skypyproject/master' into module/halos
rrjbca Feb 16, 2021
29411f4
Merge remote-tracking branch 'skypyproject/master' into module/power_…
rrjbca Feb 17, 2021
21a7285
Fix flake8 code style errors in power_spectrum module (#430)
rrjbca Feb 17, 2021
dfa92a9
Merge remote-tracking branch 'skypyproject/module/power_spectrum' int…
rrjbca Feb 17, 2021
862af0b
Fix flake8 code style errors in halos module (#431)
rrjbca Feb 17, 2021
1aa09dc
ENH: Add a mass sampler for the colossus halo mass function (#423)
sutieng Mar 9, 2021
bc6ec88
ENH: Halos from COLOSSUS joint mass-redshift distributions (#452)
rrjbca May 18, 2021
3b861d3
Merge branch 'module/halos' into halo-circular-velocity
itrharrison Mar 24, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
75 changes: 75 additions & 0 deletions skypy/halo/properties.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
"""Halo properties module.

This module provides methods to add simple properties to halos

Models
======

.. autosummary::
:nosignatures:
:toctree: ../api/

halo_circular_velocity

"""

import numpy as np

__all__ = [
'halo_circular_velocity',
]

def halo_circular_velocity(M, Delta_v, redshift, cosmology):
"""Halo circular velocity.
This function computes the halo circular velocity, setting it
equal to the virial velocity using equation (3) and footnote 2 from [1]_.

Parameters
----------
M : (nm,) array_like
Array for the virial mass, in units of solar mass.
Delta_v : (nm,) array_like
The mean overdensity of the halo.
redshift : (nm,) array_like
The redshift of each halo.
cosmology : astropy.cosmology.Cosmology
Cosmology object providing methods for the evolution history of
omega_matter and omega_lambda with redshift.
sarahbridle marked this conversation as resolved.
Show resolved Hide resolved

Returns
--------
circular_velocity: (nm,) array_like
Halo circular velocity for a given mass array, cosmology and redshift, in
units of km s-1.

Examples
---------
>>> import numpy as np
>>> from skypy.halo import properties

This example will compute the halo circular velocity, for a Planck15 cosmology at redshift 0.

>>> from astropy.cosmology import Planck15
>>> cosmology = Planck15
>>> M = 10**np.arange(9.0, 12.0, 2)
>>> Delta_v = np.arange(1.0, 1.1, 0.1)
>>> redshift = np.arange(0.3, 1, 0.5)
>>> properties.halo_circular_velocity(M, Delta_v, redshift, cosmology)
<Quantity [ 6.11303684, 36.72661831] km2 / (Mpc2 s2)>

References
----------
.. [1] Maller and Bullock 2004 MNRAS 355 694 DOI:10.1111/j.1365-2966.2004.08349.x
sarahbridle marked this conversation as resolved.
Show resolved Hide resolved

Notes of things to ask / think about:
* where to get Delta_v from - do we have a module for this already, or compute it in here too?
sarahbridle marked this conversation as resolved.
Show resolved Hide resolved
* fix h hack / check h in Maller & Bullock is h100
* should we call it the circular_velocity or the virial_velocity?
sarahbridle marked this conversation as resolved.
Show resolved Hide resolved
* ditto M - should we call it M_v or pretend virial mass = halo mass throughout?
sarahbridle marked this conversation as resolved.
Show resolved Hide resolved
* should we output the virial radius here as well or is this already done elsewhere?
sarahbridle marked this conversation as resolved.
Show resolved Hide resolved
"""

h = cosmology.H0 / 100
circular_velocity = 96.6 * (Delta_v * cosmology.Om0 * h **2) * pow((1 + redshift)/0.3,0.5) * pow(M/1e11,1/3)
sarahbridle marked this conversation as resolved.
Show resolved Hide resolved
sarahbridle marked this conversation as resolved.
Show resolved Hide resolved

return circular_velocity