Giter VIP home page Giter VIP logo

pyrate's Introduction

pyrate

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.

Install

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.

Use

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

Configuration files must contain the fields:

  • Z_projectile: projectile proton number
  • A_projectile: projectile mass number
  • Z_target: target proton number
  • A_target: target mass number
  • Sfactor_file: path to AZURE data file
  • output_file: path to which rate will be written, as a csv text file
  • T_min: starting temperature of the calculation (in GK)
  • T_max: final temperature of the calculation (in GK)
  • T_step: temperature step size (in GK)

Output

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).

Scripts

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.

Requirements

  • 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).

pyrate's People

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.