Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
astro
astrotools
Commits
c36aa2a3
Commit
c36aa2a3
authored
Dec 11, 2019
by
teresa.bister
Browse files
[simulations] save inside fraction in crs
parent
053fe6b4
Pipeline
#217595
failed with stages
in 1 minute and 58 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
astrotools/simulations.py
View file @
c36aa2a3
...
...
@@ -633,6 +633,7 @@ class SourceBound(BaseSimulation):
# Determine fraction of cosmic rays which come from inside rmax (signal cosmic rays)
distance_fractions
=
self
.
arrival_matrix
*
coord
.
atleast_kd
(
self
.
dis_bins
,
3
)
inside_fraction
=
np
.
sum
(
distance_fractions
[
self
.
dis_bins
<=
self
.
universe
.
rmax
])
/
np
.
sum
(
distance_fractions
)
self
.
crs
[
'inside_fraction'
]
=
inside_fraction
# Sample for each set the number of CRs coming from inside and outside rmax
nsplit
=
np
.
random
.
multinomial
(
self
.
ncrs
,
[
inside_fraction
,
1
-
inside_fraction
],
size
=
self
.
nsets
).
T
...
...
Write
Preview
Supports
Markdown
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