pyrate is a small code base designed to integrate reaction rates from astrophysical S-factor data generated by AZURE2. It takes in reaction information and AZURE output data through a JSON configuration file.
After downloading this repository, the python dependencies (numpy, scipy) need to be installed, if they aren't already present on the machine. For convience, a requirements.txt file is present in the repository. One can then install the dependencies using pip as pip install -r requirements.txt
. It is recommended to install the requirements to a virtual environment. See the docs for details on creating virtual environments.
Once dependencies are installed, run pyrate as python main.py <your_config>
where <your_config>
is a JSON file containing the relevant data for running pyrate.
pyrate will rate the rate as a function of temperature to an output file specified in the configuration.
Configuration files must contain the fields:
Z_projectile
: projectile proton numberA_projectile
: projectile mass numberZ_target
: target proton numberA_target
: target mass numberSfactor_file
: path to AZURE data fileoutput_file
: path to which rate will be written, as a csv text fileT_min
: starting temperature of the calculation (in GK)T_max
: final temperature of the calculation (in GK)T_step
: temperature step size (in GK)
The output of the rate calculation will be written to the output file specified in the configuration. The format is CSV, and should be importable to common spreadsheet/dataframe processors like Excel, pandas, and polars. The column names are Temperature(GK)
and Rate(cm^3/(mol*s)
.
The scripts folder contains examples of different types of analysis that might be used on the rate data generated by pyrate. plot_rate.py
takes in rate data and makes a plot of different results using matplotlib and polars. fit_rate.py
uses lmfit and the REACLIB rate parameterization to fit a rate with the REACLIB parameters. plot_sfactor.py
reads in AZURE2 data and plots the S-Factor (or cross section) calculated by AZURE2. Note that to use these scripts they need to be edited with updated file paths for the relevant data.
- python 3.10
- pip
- numpy
- scipy
Optional, but included in the requirements.txt are:
- matplotlib: for plotting rates
- polars: for analyzing csv data
- pyside6 (qt): as a backend for matplotlib
- lmfit: for fitting rates
On some linux systems, additional system packages may need to be installed. For example, on Ubuntu 22.04 you need to install the additional package python3-venv using apt (as sudo apt install python3-venv
). Additionally, for PySide6.5(Qt) to function on Ubnuntu 22.04 one must install the package libxcb-cursor0 via apt (as sudo apt install libxcb-cursor0
).