Python instead of COMIS


gopaw embarques the core of a Python-2.7 to replace the COMIS FORTRAN interpreter.

WARNING, WARNING, WARNING: we do not bring the whole Python library, but only what is needed to define a function and do some maths in it.

You have an example of usage in the examples/py_root directory by looking at the pawex10.kumac script:

MACRO PAWEX10 1=100
**************************************************************************
*                       PAW TUTORIAL EXAMPLE 10                          *
* Calculate and plot (BOX option) Mandel distribution                    *
**************************************************************************
Exec ALLDEF
fun2 10 mandel.py [1] -2.4 .8 [1] -1.2 1.2 ' '
fortran/file 66 mandel.ps
metafile 66 -111
hi/pl 10 BOX
close 66
RETURN

with mandel.py being:

# Copyright (C) 2018, Guy Barrand. All rights reserved.
# See the file gopaw.license for terms.

def mandel(XP,YP):
  NMAX = 30
  X = XP
  Y = YP
  XX = 0
  YY = 0
  for N in range(1,NMAX+1) :  #[1,NMAX]
    TT = XX*XX-YY*YY+X
    YY = 2.0*XX*YY+Y
    XX = TT
    if 4.0 < (XX*XX+YY*YY) :
      break

  #print XP,YP
  #print N

  return (1.0*N)/(1.0*NMAX)

The way of doing is the same than in the original CERN-PAW example that worked with the FORTRAN COMIS interpreter. See original examples/f77_hbook/pawex10.kumac and mandel.f at end. Note that pictures in the Gallery section had been done with the Python versions of all the pawex[1,24].kumac found in examples/py_root. In py_root, the _root comes from the fact that manipulation of .hbook files had been replaced with manipulation of .root files.

To run the pawex10.kumac Python version:

    UNIX> cd <some_path>/examples/py_root  # have a local copy.
    UNIX> <start gopaw> 
 on Windows:
     DOS> cd <some_path>\examples\py_root
     DOS> <start gopaw> 
   GOPAW> exec pawex10
pawex10.png