python interfaces to the JINA reaclib database
Fortran Jupyter Notebook Python Makefile
Switch branches/tags
Nothing to show
Clone or download
Pull request Compare This branch is 480 commits behind pynucastro:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.


Python interfaces to the JINA reaclib nuclear reactions database. The main goal is to provide a parser for the reaclib format to produce either a callable python function for a rate or output the python code for a function that can be incorporated into a rate module.

For performance reasons, the common temperature factors needed by a rate are stored in a Tfactors class---a Tfactors object is passed into each rate function to get the rate.


import reaclib

r = reaclib.Rate("c13-pg-n14-nacr")

# output python code for this rate
print r.function_string()

# evaluate this rate at T = 1.e9 K
print r.eval(1.0e9)

Also see the Jupyter notebook: pyreaclib-examples.ipynb


This package requires

  • numpy

  • scipy: only needed for the example integrator

  • periodictable: needed to get Z from element symbol, necessary for sorting

  • matplotlib: needed for plotting the rate

  • networkx: for visualizing the network


  • output Fortran functions as an option

    • integrate OpenACC support
  • output Cython code

  • return a polynomial fit to a rate in a given interval

  • create a Ydot() class that can both output dYdt[nucleus] and evaluate dYdt.

  • color the edges on the RateCollection plot according to which nuclear process they are (e.g., a,p), and add a legend showing the basics