-
Notifications
You must be signed in to change notification settings - Fork 39
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
Supernova volumetric redshift rate #140
Changes from 7 commits
7acf0c0
ade2aa8
a2568e3
b097932
b861c5d
f63b212
ce81b81
b9c61e0
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
@@ -0,0 +1,45 @@ | ||||||
r"""Creates the volumetric SNe Ia rate for an array of redshifts | ||||||
================= | ||||||
.. autosummary:: | ||||||
:nosignatures: | ||||||
:toctree: ../api/ | ||||||
SNeIa_redshifts | ||||||
|
||||||
Models | ||||||
====== | ||||||
.. autosummary:: | ||||||
:nosignatures: | ||||||
:toctree: ../api/ | ||||||
Ia_redshift_rate | ||||||
""" | ||||||
|
||||||
from astropy import units | ||||||
|
||||||
|
||||||
def Ia_redshift_rate(redshift, r0=2.27e-5, a=1.7): | ||||||
"""Creates a redshift distribution of Type Ia Supernovae | ||||||
This function computes the redshift distribution of Type Ia Supernovae | ||||||
using the rate parameters as given in [1]. | ||||||
Parameters | ||||||
---------- | ||||||
redshift : numpy.array | ||||||
Redshift at which to evaluate the Type Ia supernovae rate. | ||||||
Returns | ||||||
------- | ||||||
rate : astropy.Quantity | ||||||
Volumetric rate of Type Ia's the redshifts given in units of | ||||||
[SNe Ia yr−1 Mpc−3] | ||||||
|
||||||
Examples | ||||||
-------- | ||||||
>>> import numpy as np | ||||||
>>> z = np.array([0.0,0.1,0.2]) | ||||||
>>> Ia_redshift_rate(z,r0=2.27e-5,a=1.7) | ||||||
<Quantity [2.27000000e-05, 2.66927563e-05, 3.09480989e-05] yr / Mpc3> | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Will probably have to update the units here as well |
||||||
References | ||||||
---------- | ||||||
.. [1] Frohmaier, C. et al. (2019), https://arxiv.org/pdf/1903.08580.pdf . | ||||||
""" | ||||||
|
||||||
rate = r0*(1+redshift)**a * units.year *(units.Mpc)**-3 | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think this whitespace will fix your PEP8 error. Also I think it should be
Suggested change
|
||||||
return rate |
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.
Wondering what are these default values? Are they "standard" values? I would generally prefer them to not have defaults in most cases. They should also be documented under 'Parameters' even if it just says 'free parameters of the model'