Skip to content
/ mcml-py Public

Port of MCML (Monte Carlo Multi-Layered) to Python.

Notifications You must be signed in to change notification settings

kwsp/mcml-py

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

28 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MCML Python

Port of MCML (Monte Carlo Multi-Layered) to Python.

Requires Python 3.10 or above, numba, and tqdm.

Getting started

  1. Clone the repo (or download the zip file and extract).

  2. Create a virtual environment. Use Miniconda if you don't know what that means. After installing miniconda, open "Anaconda Powershell Prompt" and run

    conda create -y -n mcml python=3.10 numba tqdm
    

    This command creates a new virtual environment named mcml, and installs Python 3.10 along with numba and tqdm.

  3. Activate the mcml virtual environment:

    conda activate mcml
    
  4. cd into the working directory. Replace <path> with the directory containing the file main.py.

    cd <path>
    
  5. Run the MCML main program with a sample input file. The output will be written to text files specified in the input file. For the example input file, this will be sample.mco and sample2.mco.

    python main.py sample.mci
    

Accuracy

The program is checked against the original MCML program. Errors should be <1%.

Speed

Most of this program is JIT compiled with numba, hence the speed is reasonable. Simulating 1,000,000 photons in a 3 layer medium takes <20s on my laptop.

About

Port of MCML (Monte Carlo Multi-Layered) to Python.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages