Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Martin Glatzle
cosmic_dustbox
Commits
4f0d56a3
Commit
4f0d56a3
authored
Jan 08, 2019
by
findesgh
Browse files
Add power law size dist.
parent
dcf4c5ff
Changes
1
Hide whitespace changes
Inline
Side-by-side
cosmic_dustbox/sdist.py
View file @
4f0d56a3
...
...
@@ -148,6 +148,25 @@ class SizeDist(object):
__rmul__
=
__mul__
class
PowerLaw
(
SizeDist
):
"""
Parameters
----------
sizeMin : scalar Quantity [L]
Low end size cutoff of the distribution.
sizeMax : scalar Quantity [L]
High end size cutoff of the distribution.
power : float
Log-slope of the size distribution.
C : scalar Quantity [L]**(-1-power)
Normalization of the size distribution.
"""
def
__init__
(
self
,
sizeMin
,
sizeMax
,
power
,
C
):
def
f
(
a
):
return
C
*
a
**
power
super
(
self
).
__init__
(
sizeMin
,
sizeMax
,
f
)
return
###############################################################################
if
__name__
==
"__main__"
:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment