#! /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 AnnihilationModel

# 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 not in [7, 8]:
    print_error("Would you kindly specify the following command-line arguments:\n"
                + "         1. The mass of the dark-matter particle           [in MeV]\n"
                + "         2. The s-wave constribution to the cross-section  [in cm^3/s]\n"
                + "         3. The p-wave constribution to the cross-section  [in cm^3/s]\n"
                + "         4. The kinetic decoupling temperature of the\n"
                + "            dark-matter particle                           [in MeV]\n"
                + "         5. The branching ratio into electron-positron pairs\n"
                + "         6. The branching ratio into two photons.\n"
                + "         7. The density parameter of dark-matter (optional, default: 0.12).")

# Extract the input parameters
params = [float(arg) for arg in sys.argv[1:]]

# Run the code
Yf = AnnihilationModel(*params).run_disintegration()

# Print the result
print_Yf(Yf)
