Things are more than a little untidy, but have a working tutor4.py with setup and shower() defined in Python. Changed to tutor4 rather than tutor1 because tutor4 adds extreme detail of all interactions with energies etc. through WATCH.
Pre-reqs:
Python 3.9 available and callable with python3.9.
EGSnrc config set up for linux
EGS_HOME set to .../egsnrc2py/egsnrc2py/egs_home
Steps to use (binary files etc not stored in repo).
in egs_home/tutor4 folder...:
make
tutor4 -p tutor_data to launch the standard EGSnrc mortran/Fortran run
./make_f2py. This creates the egsfortran...so file and copies to the main egsnrc2py folder so egsfortran is importable as part of the package.
python3.9 tutor4.py
Compare outputs of the two - I got identical results in what I sampled (including full diff on history 3, and last line of history 10)
This PR does
Python init of paths, set up geom etc., calling hatch
Python shower() subroutine
all needed global blocks defined
Python still calls fortran ELECTR
Lessons learned:
must be very careful to have all globals defined
if assigning immutables to a global, must use the common block name and attribute, e.g. stack.np = 1, else can re-bind variables to a non-egsfortran Python local/global.
Things are more than a little untidy, but have a working
tutor4.py
with setup andshower()
defined in Python. Changed totutor4
rather than tutor1 because tutor4 adds extreme detail of all interactions with energies etc. throughWATCH
.Pre-reqs:
python3.9
.linux
Steps to use (binary files etc not stored in repo).
make
tutor4 -p tutor_data
to launch the standard EGSnrc mortran/Fortran run./make_f2py
. This creates theegsfortran...so
file and copies to the mainegsnrc2py
folder soegsfortran
is importable as part of the package.python3.9 tutor4.py
Compare outputs of the two - I got identical results in what I sampled (including full diff on history 3, and last line of history 10)
This PR does
Lessons learned:
stack.np = 1
, else can re-bind variables to a non-egsfortran Python local/global.Checklist