-
Notifications
You must be signed in to change notification settings - Fork 1
Getting Started with Command‐Line
This information will likely change as more support for python
and .NET
is introduced.
You will need version 8 of .NET which is available from Microsoft below
https://dotnet.microsoft.com/en-us/download/dotnet/8.0
On Ubuntu Linux:
Do not forget to update your ~/.bashrc
or whatever you use so that this directory is in your path. Also define DOTNET_ROOT
export DOTNET_ROOT=/usr/share/dotnet
PATH=$PATH:$DOTNET_ROOT
Install pip
sudo apt install python3-pip
git clone https://github.com/VirtualPhotonics/vts.git
Get the latest VTS libraries for the specific platform from releases and extract them into the libraries folder under Vts.Scripting.Python.
pip install pythonnet
pip install numpy
pip install plotly
pip install scipy
Note for MacOS and Linux: Because pythonnet
under macOS (or linux) defaults to mono
, two more things need to added to ~/.bashrc
export PYTHONNET_RUNTIME=coreclr
export PYTHONNET_PYDLL=/usr/local/bin/python3 (MacOS)
export PYTHONNET_PYDLL=/usr/bin/python3 (Linux)
Use the path for python on your system (which python3
will tell you)
To run .py scripts in this repository change directory to folder and run script
cd forward-solvers
python3 r-of-rho.py
These commands can be run on Linux or on Windows within a PowerShell window.
To create new scripts that access the VTS
library include the following the header
from pythonnet import load
load('coreclr')
import clr
import os
file = '../libraries/Vts.dll'
clr.AddReference(os.path.abspath(file))
import numpy as np
import plotly.graph_objects as go
from Vts import *
from Vts.Common import *
from Vts.Extensions import *
from Vts.Modeling.Optimizers import *
from Vts.Modeling.ForwardSolvers import *
from Vts.SpectralMapping import *
from Vts.Factories import *
from Vts.MonteCarlo import *
from Vts.MonteCarlo.Sources import *
from Vts.MonteCarlo.Tissues import *
from Vts.MonteCarlo.Detectors import *
from Vts.MonteCarlo.Factories import *
from Vts.MonteCarlo.PhotonData import *
from Vts.MonteCarlo.PostProcessing import *
from System import Array, Object
Virtual Photonics Technology Initiative
Project Site | Discussion | Education