Docker

ioda exists under gbarrand/ioda on:

https://hub.docker.com

docker pull

To get an image, for example on a Mac:

     macOS> docker login  # to login on hub.docker.com
     macOS> docker pull gbarrand/ioda:<version>

On some platforms, you may have to "sudo" the upper commands.

Setup X11 and run on macOS before Mojave

As it is a X11 app, you have to setup the DISPLAY. On a Mac with XQuartz:

     macOS> ifconfig  # to get your IP address.
        sh> DISPLAY=<IP>:0;export DISPLAY
     ( csh> setenv DISPLAY <IP>:0 )
     macOS> xhost + <IP>
     macOS> docker run -e DISPLAY=${DISPLAY} -v /tmp/.X11-unix:/tmp/.X11-unix:rw gbarrand/ioda:<version>

Setup X11 and run on macOS with Mojave

The upper does not work on Mojave, but the below ansatz, found on stackerflow, works for us :

    mojave> <open a new terminal>
    movaje> <install socat. We installed it with Macports by doing "sudo port install socat">
    movaje> <be sure that the socat app is in your path>

Check that the port 6000 is not used with :

    mojave> lsof -i TCP:6000

then do :

   socat TCP-LISTEN:6000,reuseaddr,fork UNIX-CLIENT:\"$DISPLAY\" &

then another "lsof -i TCP:6000" should give something as :

   COMMAND   PID    USER   FD   TYPE             DEVICE SIZE/OFF NODE NAME
   socat   23420 barrand    5u  IPv4 0x4e5bb941508d0a39      0t0  TCP *:6000 (LISTEN)

and then, the following command works for us :

   docker run -e DISPLAY=docker.for.mac.host.internal:0 -v /tmp/.X11-unix:/tmp/.X11-unix:rw -t -i gbarrand/ioda:<version>

Setup X11 and run on macOS before Mojave

On a Windows-10 with the X11/Xming server, from XLaunch, start Xming with "on" in the "No Access Control" box, or from the DOS prompt :

    DOS> Xming :0 -multiwindow -clipboard -ac
 (you may have to kill Xming from "Task manager"), and :
    DOS> docker run -e DISPLAY=10.0.75.1:0 gbarrand/ioda:<version>

Getting output whilst running

If producing a out.jpg or out.png with the export menu item, you can get it on your host with:

     macOS> docker ps  # to get the container id.
     macOS> docker cp <container id>:/root/Documents/ioda/out.jpg .

Mount a working directory

As the /root/Documents/ioda directory is a default directory known by ioda to get files and also to deposit output pictures (through the export menut item), it is interesting to show how to mount it on a local host directory, for example /tmp/work_dir. To do that, for example on a Mac :

     mkdir -p /tmp/work_dir
     cd /tmp/work_dir

have here some input/data file, for example one taken from github/ioda under the ioda/ioda/comres directory :

     <get demo.root>

Then launch docker/ioda by mounting /tmp/work_dir on /root/Documents/ioda by adding in the upper docker run command :

     -v /tmp/work_dir:/app/Documents/ioda:rw

From docker/ioda :

     files > ioda > .root > demo.root > h20
  produce out.png :
     meta-zone > home > large-down arrow > export > out.png
  then exit with :
     meta-zone > home > short-down arrow > exit

(meta-zone = area at the bottom of the window. When touched/clicked it permits to toggle from screen mode to menut mode).

You should have in the local host /tmp/work_dir a out.png file.

From 1.14.x, exec a .kumac

With a ioda having the gopaw core, have in the working directory a my.kumac with :

     vector/create VECT1(10)
     vector/input VECT1 10 8 6 4 2 3 5 7 9 11
     v/draw vect1
     /picture/print out.png


From docker/ioda :

     files > ioda > .kumac > my.kumac

You should see :

.kumac refering other files.

If the .kumac refers a data file or another .kumac file, you have to do a local copy of them and refer them by using the IODA_DATA_DIR environment variable. For example with a my.kumac to work on data_B4.hdf5 file :

     <get data_B4.hdf5 from github/ioda/comres>
     <get m51.fits>
     <get alldef.kumac>

Have in /tmp/work_dir/my.kumac :

     exec $IODA_DATA_DIR/alldef
     zone 2 2
     opt stat
     h/file 1 $IODA_DATA_DIR/data_B4.hdf5   | file coming from Geant4.
     cd //lun1/default_histograms
     h/plot Eabs
     h/plot Egap
     h/plot Labs
     h/plot Lgap
     close 1

From docker/ioda :

     files > ioda > .kumac > my.kumac

You should see :

Or to work on the data_m51.fits file, have in a /tmp/work_dir/my.kumac :

     SET XTIC 0.0001;SET YVAL 100.
     SET YTIC 0.0001;SET XVAL 100.
     NULL 0 2 0 2
     h/file 1 $IODA_DATA_DIR/data_m51.fits  | width = 512, height = 512, mean = 43.8, rms = 37.7, cmap.size = 256
     IMAGE_HDU 1 0 0 200 colbr32 1 1 1 1.2 00 00

From docker/ioda :

     files > ioda > .kumac > my.kumac

You should see :