We can adapt from the instructions authored by Dimitri in this document.

About offlineami

The offlineami tool allows you to display images from detectors seen in the daq. It displays only runs which have ended, not an ongoing run. In this sense it is a post-run player that gives you a quick overview of your data and lets you browse the different runs.

Prerequisites

Interactive remote environment

You will need an interactive ssh-based environment. We recommend NoMachine for all platforms, but unix-based operating systems are able to provide this interactive environment using cross-platform tools such as XQuartz for MacOS.

Setting up a connection to PSNXSERV (only with NoMachine)

You will first need to set up a connection to the PSNXSERV node at SLAC. In NoMachine, create a new connection with the following parameters:

  • Protocol: ssh
  • Host: psnxserv.slac.stanford.edu
  • Port: 22
  • Authentication: password (use your SLAC unix-account username and password)
  • Proxy: no
  • Name: give a custom name to your connection

When connecting to the server, always choose the following session parameters:

  • Run the console
  • Run the command in a floating window

Connection without NoMachine (from a unix-based environment)

You can choose to ssh directly using your local console or terminal:

>  ssh -Y [unix-username]@pslogin.slac.stanford.edu

Defining the offlineami function in your .bashrc file

From a remote console (psnxserv or pslogin), make sure you are in your home directory:

>  cd ~

Use a text editor to open your .bashrc file, for example vi (vim or emacs are reliable substitutes):

>  gedit .bashrc

We recommend you to use the global definitions in the beginning of your .bashrc file:

# .bashrc

# Source global definitions

if [ -f /etc/bashrc ]; then

        . /etc/bashrc

fi

Add the offlineami function:

# Function to run offline AMI. Takes experiment name as parameter.

function offlineami()

{

/reg/g/pcds/dist/pds/ami-current/build/ami/bin/x86_64-rhel7-opt/offline_ami -p /reg/d/psdm/mec/$1

}

You can now save the file and close the text editor.

Use a text editor to open your .bash_profile file, for example:

>  gedit .bash_profile

We recommend the following definitions:


# .bash_profile

# Get the aliases and functions

if [ -f ~/.bashrc ]; then

        . ~/.bashrc

fi

# User specific environment and startup programs

export PATH=$PATH:$HOME/bin

You can now save the file and close the text editor.

To avoid restarting the connection, you can use the following command that will apply the latest modification (once you have applied the procedure in this section, you do not need to apply it again):

>  source .bashrc

Launching offlineami

Accessing the psana server

From a remote console (psnxserv or pslogin), start a connection to the psana server:

>  ssh psana

Launching offlineami

Launch the offlineami tool:

>  offlineami

Two interactive windows will pop up:

  • Env
  • PS-Mon



Displaying data

Selecting the dataset of your experiment

In the PS-Mon window, click on Change and a window will pop up.

When looking in /reg/d/psdm/mec/, you can see a list of folders. Each of them is a different MEC experiment. Double click on your experiment’s folder. Once looking in your folder, simply press Choose.

For the purpose of the demonstration, we will look into MEC experiment LW03 from run 18 (folder’s name: meclw0318).

The dataset is now loaded, you can see its path in the PS-Mon window and the run number is preset to Run 0001.

  • Selecting a run

In the PS-Mon window, scroll down the Run menu and select the run number which you would like to display. The PS-Mon window will update. Pay attention to the Data section of the window, its menu will populate with a list of active detectors for this run.

In the following example, we will focus on the four ePix10k detectors that can be displayed for run 71 of MEC experiment LW03:

  • Epix10kaQuad0
  • Epix10kaQuad1
  • Epix10kaQuad2
  • Epix10kaQuad3
  • Displaying data

  • Opening a detector plot window

In the PS-Mon window, select a detector from the menu in the Data section. When clicking a window named after the selected detector pops up. In this example, we selected Epix10kaQuad3.

When the detector window opens, no data are being displayed, the data plot is dark.











  • Setting the display rate of events

The offlineami tool can show you sequentially the different images for each event within a run. You have to select a display rate if you want to control this “movie”.

In the PS-Mon window, vary the Throttle bar in the Offline section.

In this example, we selected 10 Hz.

  • Displaying the dataset

In the PS-Mon window, press Run next to the run number in the Offline section. The detector window will refresh with the data.

  • Organizing your window setup

  • Why setting up a window environment?

As explained in the Introduction section, offlineami will only display runs that have ended. While you are watching different sets of data, the experiment might still be going and new runs have been added. Your system does not know these new runs, it needs an update. As updating will close all detector windows, you will lose your environment setup and will be forced to reset it from scratch. That can be annoying when working with an ongoing experiment.

  • Saving a window setting

Once you have positioned all windows at the location you want them to appear, press Save in the Setup section of the PS-Mon window. Save a window setup file (.ami) in your somewhere in your home directory.

  • Updating offlineami

You can now press Update at the top-right corner of the PS-Mon window. All detector windows will shut down. You are now able to access the latest available runs. Select a new run in the list and wait for the detector list to be loaded.

  • Loading a window setting

In the PS-Mon window, press Load in the Setup section. Search for your window setting file (.ami), select it and press Open. The saved window environment will open up. You can now display the data as described in the Displaying data section.