Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
astro
astrotools
Commits
900b4a47
Commit
900b4a47
authored
Sep 03, 2020
by
Marcus Wirtz
Browse files
[simulations] Clarify dimensions of 'fractions'
parent
a8ca239d
Pipeline
#327007
canceled with stages
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
astrotools/simulations.py
View file @
900b4a47
...
...
@@ -618,9 +618,9 @@ class SourceBound(BaseSimulation):
f
=
self
.
charge_weights
[
key
]
if
f
==
0
:
continue
fractions
=
data
[
'fractions'
].
item
()[
key
]
fractions
=
data
[
'fractions'
].
item
()[
key
]
# dimensions: (energy_in, distances, charges_out, energy_out)
# reweight to spectral index (simulated gamma=-1) and apply energy / rigidity cut
fractions
=
self
.
_reweight_spectrum
(
fractions
,
charge
[
key
])
fractions
=
self
.
_reweight_spectrum
(
fractions
,
charge
[
key
])
# dim: (distances, charges_out, energy_out)
self
.
source_matrix
+=
f
*
np
.
sum
(
fractions
,
axis
=-
1
)[
dis_bin_idx
]
self
.
arrival_matrix
+=
f
*
fractions
# Account for optional luminosity weights of sources
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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