Code Monkey home page Code Monkey logo

brpni_sim's Introduction

alt text

BRPNI_SIM

This neutron Larmor precession simulator is compatible with a diffusive neutron source with a given intensity profile. It was designed to verify theories regarding Polarized Neutron Imaging (PNI). The simulator is written in Python 3.11 and uses the following packages:

  • numpy
  • matplotlib
  • multiprocessing
  • datetime

This package also contains two post-simulation analysis scripts, which are also written in Python. fit_background.py is used to fit the background of the simulated data, and fit_data.py is used to fit the simulated data to a Gaussian function. Both scripts use the following packages:

  • numpy
  • matplotlib
  • scipy

Please find the presentation slides for this project [here](https://github.com/ThisisShoo/PNI_Sim/blob/main/Misc/Algorithm Presentation.pptx)

Installation

To install the simulator, simply clone the repository.

Usage

All user-facing variables are defined in the beginning of main.py, and they can be modified to suit the user's needs. See the comments in main.py for more information on each variable. To run the simulator, simply run main.py. The output will be saved in the plots folder.

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Acknowledgements

This project was developed by Shuhan Zheng (University of Toronto, GitHub: https://github.com/ThisisShoo) for his 2023 summer research project at China Spallation Neutron Source (CSNS), under the guidance of Dr. Tianhao Wang, and many students at Polarized Neutron Group at CSNS. It would not have been possible without their help.

brpni_sim's People

Contributors

thisisshoo avatar

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.