-
Notifications
You must be signed in to change notification settings - Fork 39
Halo circular velocity function from Maller & Bullock 2004 #284
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
Closed
sarahbridle
wants to merge
25
commits into
skypyproject:main
from
sarahbridle:halo-circular-velocity
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 c1a2f53
drafted the circular velocity code pending testing
sarahbridle 309223a
managed to run this version and get some numbers out. noted some majo…
sarahbridle 95928f0
Merge branch 'master' into halo-circular-velocity
sarahbridle 9a46b24
Update skypy/halo/properties.py
sarahbridle 23dfe37
Update skypy/halo/properties.py
sarahbridle d2aa008
Responded to comments to tidy up names etc
sarahbridle 685ca0e
fixed over indented block pointed out by Lucia
sarahbridle 8e4149a
Fixed errors in equation and fixed units - but distracted by reloadin…
sarahbridle 0979f27
Merge branch 'master' into halo-circular-velocity
sarahbridle e87e0c3
Merge branch 'master' into halo-circular-velocity
itrharrison fa8e855
Revert "strip halo module"
57824ad
Revert "strip power_spectrum module"
7628ac4
Merge branch 'module/power_spectrum' into module/halo
75a9fe5
Merge remote-tracking branch 'skypyproject/master' into module/halo
rrjbca 9346b2f
rename skypy.halo to skypy.halos (#420)
rrjbca 7165490
Merge remote-tracking branch 'skypyproject/master' into module/halos
rrjbca 761ccf0
Merge remote-tracking branch 'skypyproject/master' into module/halos
rrjbca 29411f4
Merge remote-tracking branch 'skypyproject/master' into module/power_…
rrjbca 21a7285
Fix flake8 code style errors in power_spectrum module (#430)
rrjbca dfa92a9
Merge remote-tracking branch 'skypyproject/module/power_spectrum' int…
rrjbca 862af0b
Fix flake8 code style errors in halos module (#431)
rrjbca 1aa09dc
ENH: Add a mass sampler for the colossus halo mass function (#423)
sutieng bc6ec88
ENH: Halos from COLOSSUS joint mass-redshift distributions (#452)
rrjbca 3b861d3
Merge branch 'module/halos' into halo-circular-velocity
itrharrison File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. | ||
|
||
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 |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.