-
Notifications
You must be signed in to change notification settings - Fork 38
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
ENH: Add concentration, radius, Delta_Sigma functions to halos module #467
base: module/halos
Are you sure you want to change the base?
Conversation
Hi Sutieng, thank you for your pull request. Could you please set up your git username and email correctly for GitHub? There is a description in the GitHub documentation. Afterwards, you will need to fix the existing commits in this PR. The easiest that I can think of is resetting your commits without undoing any of the changes, then simply committing again, which will use the new username and email: $ git reset --soft module/halos
$ git commit
$ git push --force |
e579554
to
d60129e
Compare
Thanks Nicolas! I've just set up the git email and re-pushed all the commits. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good job!
Very nice and clear.
A few comments on:
- Units with
h
(to check) - Docstrings
- More tests?
Parameters | ||
---------- | ||
mass : float or array_like | ||
Spherical overdensity halo mass in units of solar mass/h, corresponding |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We had a debate about the use of h
in units. We finally decided to work in units without h
.
Is this relevant for you here?
Spherical overdensity halo mass in units of solar mass/h, corresponding | ||
to the mass definition, mdef. | ||
mdef : str | ||
Halo mass definition for spherical overdensities used by colossus. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Which are the options to choose from? Is it worth adding them here?
Returns | ||
------- | ||
concentration : float or array_like | ||
Halo concentration(s); has the same dimensions as mass. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Units?
r'''Calculate the scale radius and the spherical overdensity radius of halo by assuming | ||
the NFW model. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
r'''Calculate the scale radius and the spherical overdensity radius of halo by assuming | |
the NFW model. | |
r'''Halo radii with the NFW model. |
return c | ||
|
||
|
||
def radius(mass, concentration, redshift, mdef, Delta, cosmology, sigma8, ns): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this function name descriptive enough? what about radii_NFW
or anything better??
mdef : str | ||
Halo mass definition for spherical overdensities used by colossus. | ||
radius : float or array_like | ||
Radius in physical kpc/h. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See above re: discussion about units and h
.
def test_colossus_concentration(): | ||
from skypy.halos._colossus import concentration | ||
from astropy.cosmology import Planck15 | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We could add a comment here, briefly explaining what this test is doing.
For example:
# Check concentration array matches mass length
or similar
def test_colossus_radius(): | ||
from skypy.halos._colossus import radius | ||
from astropy.cosmology import Planck15 | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add a short comment explaining.
def test_colossus_Delta_Sigma(): | ||
from skypy.halos._colossus import Delta_Sigma | ||
from astropy.cosmology import Planck15 | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
comment
|
||
DeltaSigma = Delta_Sigma(mass, c, redshift, mdef, radius, cosmo, sigma8, ns) | ||
|
||
assert len(DeltaSigma) == len(radius) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In general, is there anything else we can test here? Corner cases? Does any of this follow a formula for certain parameters...?
Description
This implements several functions to derive the halo concentration, scale radius, the spherical overdensity radius and the excess surface density for halos module.
Checklist