-
Notifications
You must be signed in to change notification settings - Fork 1
/
decay
executable file
·36 lines (28 loc) · 1.15 KB
/
decay
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#! /usr/bin/env python3
# sys
import sys
# pprint
from acropolis.pprint import print_Yf
from acropolis.pprint import print_error, print_version
# models
from acropolis.models import DecayModel
# Print version information
print_version()
# Extact the number of command line arguments...
N = len(sys.argv)
# ...and check if there are exactly six
if N != 7:
print_error("Would you kindly specify the following command-line arguments:\n"
+ " 1. The mass of the decaying particle [in MeV]\n"
+ " 2. The lifetime of the decaying particle [in s]\n"
+ " 3. Some reference temperature T0 [in MeV]\n"
+ " 4. The number density of the decaying particle\n"
+ " (relative to photons) at T0\n"
+ " 5. The branching ratio into electron-positron pairs\n"
+ " 6. The branching ratio into two photons.")
# Extract the input parameters
params = [float(arg) for arg in sys.argv[1:]]
# Run the code
Yf = DecayModel(*params).run_disintegration()
# Print the result
print_Yf(Yf)