Giter Site home page Giter Site logo

asapy's Introduction

ASAPY

A python based method to sample ACE data based on ENDF covariances.

See ASAPY-dissertation_section.pdf for more background.

Recommended install via conda by

conda create -n asapy python=3.7 
conda activate asapy
conda install -c conda-forge mpich-mpicc 
pip install .
# these probably all won't pass because of some hard coded njoy/boxer2mat paths, sorry!
pytest

mpi4py is a requirement that means you need mpicc on your system. You can get it easily with conda https://anaconda.org/conda-forge/mpich-mpicc if you don't mind mixing conda/pip and what not. You can build it yourself too.

NJOY is a requirement which you can get from https://github.com/njoy/NJOY2016 which also has installation instructions, in general this should work and create an exectuable in the bin folder created, feel free to install it somewhere in your $PATH.

mkdir bin
cd bin
cmake ..
make -j16

boxer2mat is included in this repo which was copied from the NJOY manual because it is not distributed with NJOY. You can cd into that folder and simply type make if you have gfortran. If not you can easily edit the Makefile to use the fortran compiler of your choice (no really, the make file has 4 lines in it)

You'd then supply ENDF files to ENDFToCov.py which will extract covariance data from ENDF data (not included here) and make HDF5 stores of the data.

Then you can sample ACE files (not included here) from those covariances using various distributions with XsecSampler.py.

Shout out to openMC for their ACE data reader, included in ASAPy/data with their license requirement.

An example use case would be to process an ENDF file to get all the covariance matrices stored on the file by:

python ./ASAPy/EndfToCov.py ENDF_FILE -energy_bin_structure SCALE_252 -boxer_exec /Users/veeshy/projects/ASAPy/boxer2mat/boxer2mat -njoy_exec /Users/veeshy/projects/NJOY2016/bin/njoy

That will result in an HDF store with multi-group cross-sections, std-deviations, and covariance matrices.

You can then use this information to sample ACE data files via below which would draw 500 samples varying only mt=102 via lognormal sampling.

python ./ASAPy/XsecSampler.py ACE_FILE HDF_FILE_CREATED_IN_PREVIOUS_STEP 500 102 --make_plots -distribution lognormal

asapy's People

Contributors

veeshy avatar

Stargazers

 avatar

Watchers

 avatar  avatar

asapy's Issues

Create a readable cov matrix from covr output

The NJOY listing 11.8 is a fortran77 program that can read the output of a covr run (BOXER file format) then convert it into a easier to read format. This program and scripts to use it should be added into the ENDF -> covariance data scripts.

Sample multiple MT

Sample data > write data loop assumes only one MT changes unless the writer detects endf sum rule changes.

Need to be able to sample multiple MTs then do the write. Iโ€™m thinking

  • having the writer accept list of mt and sample df then loop over them
  • make cmd interface accept list of mt

Read chi cov

Currently the chi njoy cov does not print to the boxer format. The plot is clearly correct so there is something odd going on must investigate so we can sample any endf file chi

Sample chi

We can read chi, need to sample it

Only one chi cov is usually available so need to sample all out angles with the same cov.

I think only the CDF is printed on ace so need to figure out how to sample this okay. The zu thesis talks about it

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.