Quicklink
OM - Realtime Experiment Monitoring
Running OM
Instructions may change
The instructions below are valid as of LCLS Run 22 (first half of calendar year 2024). Some details of the setup may change slightly in the near future. Refer back to this page at the beginning of each run for potential updates.
Prepare workspace
(This section should take no more than 5-10 minutes)
At the beginning of your first shift you need to prepare OM's working directory. This requires access to the operator account for the hutch you will be running the experiment at (mfxopr, cxiopr, ...). The instructions below will be done from the perspective of mfxopr. You may need to subsitute the correct operator or machine names for your hutch to run the commands. The full set of commands without explanatory text can be copied at the end of this block - names will still need to be edited.
Skip Ahead
If OM was requested ahead of time it is possible that these steps would have been followed by beamline staff or a member of the data systems team. In this case you can skip directly to launching OM below. Note that it may still be a good idea to update geometry or mask files.
- SSH into
mfx-monitorwith the operator account:ssh mfxopr@mfx-monitor. If you are using a terminal on a hutch control room machine you can simply use:ssh mfx-monitor- If you are not using a hutch machine you may need to do this in two steps. Note you must have special permission to login as
mfxopr. If you do not, please use a control room terminal.ssh mfx-monitorssh mfxopr@mfx-monitor
mfx-monitoris the default machine for launching OM; however, confirm with beamline staff if it is preferable to usemfx-daq.
- If you are not using a hutch machine you may need to do this in two steps. Note you must have special permission to login as
- Move to the OM directory:
cd ~mfxopr/OM-GUI - Prepare the working directory by copying the template - replace
<exp_name>with your experiment name, e.g.mfxx1001122:cp -r template_2023 <exp_name>
- Change to the workspace directory. If using an
ePix10k2Mdetector use<exp_name>/om-workspace. If using aRayonixdetector use<exp_name>/om-workspace-rayonixcd om-workspace[-rayonix]
- There is a geometry (
.geom) and a mask (.h5) file in this workspace directory. Update these files to the most recent versions. Ask beamline staff for where that may be located. If you need to perform any conversions see notes at the bottom of this page.cp <new_geom>.geom epix10k2M.geom # Copy new geometry to replace epix10k2M.geom or rayonix.geomcp <new_mask>.h5 epix10k2M.h5 # Copy new mask to replace epix10k2M.h5 or rayonix.h5
- Modify the
run_om.shscript in your workspace directory to use the proper machines for OM to run on.- By default, OM will use
daq-mfx-mon02,daq-mfx-mon03,daq-mfx-mon04, anddaq-mfx-mon05to run on. Confirm with beamline staff that this is okay. Check where other things are running. Usewherepsana -dto see machines. - If you need to change the machines, modify the very last line of the script:
--host daq-mfx-mon02,daq-mfx-mon03,daq-mfx-mon04,daq-mfx-mon05 $(pwd)/monitor_wrapper.sh. Note: There is no space between the commas and the hostnames.
- By default, OM will use
Combined commands
SSH to appropriate machine as operatorssh mfxopr@mfx-monitor # if on control room terminal simply ssh mfx-monitor
# If the above doesn't work, try it in two steps
# ssh mfx-monitor
# ssh mfxopr@mfx-monitor
Setup the working directory - example for `rayonix` detector. Fill in `EXPNAME` where appropriate. Ask beamline staff for the locations of geometry files and masks.
cd ~mfxopr/OM-GUI
EXP_NAME=MYEXP1234 # REPLACE with experiment name
cp -r template_2023 $EXP_NAME
cd om-workspace-rayonix
cp <geom_file_location> rayonix.geom
cp <mask_file_location> rayonix.h5
nano run_om.sh # Double check the last line for appropriate machines.
Launching OM
Once the folder has been appropriately setup, there are a number of processes which need to be launched.
- SSH back to the appropriate machine. As above, this is usually
mfx-monitor; however, it may bemfx-daqdepending on what the beamline staff say. - Launch the monitor process:
cd ~mfxopr/OM-GUI/<exp_name>/om-workspace[-rayonix]; screen run_om.sh- The use of
screenis preferred. This will allow other people to reattach to the session from another terminal to e.g. restart the monitor if there are any issues. - To detach from the session (it will remain running), use the key combination:
Ctrl-a Ctrl-d - To reattach to the session type
screen -xr. Do NOT use-dr-> This will detach all clients.
- The use of
- Launch the main GUI elements:
- Main GUI:
cd ~mfxopr/OM-GUI/<exp_name>/om-workspace[-rayonix]; ./run_gui.sh - Frame Viewer:
cd ~mfxopr/OM-GUI/<exp_name>/om-workspace[-rayonix]; ./run_frame_viewer.sh
- Main GUI:
- Optionally, start the parameter tweaker. This is only recommended for advanced users with extensive experience with the algorithm and the meaning of relevant parameters.
cd ~mfxopr/OM-GUI/<exp_name>/om-workspace[-rayonix]; ./run_parameter_tweaker.sh- Note, making modifications using the GUI interface of the parameter tweaker will NOT update the monitor process.
- To update the parameters, after a more optimal set has been found using the GUI interface, copy the parameters into the appropriate locations in the
monitor.yamlfile. This is located in the same directory as all the other scripts to launch OM components. The monitor process must be restarted.
Note: Resetting Plots without restarting OM
Normally, to reset the accumulated plots, OM should be restarted. Restarting OM could however take several seconds, so it is possible to reset the plots without stopping the program.
- SSH back to the appropriate machine. As above, this is usually
mfx-monitor; however, it may bemfx-daqdepending on what the beamline staff say. - Run the reset plot script:
cd ~mfxopr/OM-GUI/<exp_name>/om-workspace[-rayonix]; ./reset_om_plots.sh
Potential Issues
Geometry
Geometry conventions lead to no shortage of potential issues at LCLS. Please pay careful attention to the formats you are using with OM. OM expects the .geom geometry file to follow Crystfel's format which is different from the psana format for geometry files.
Converting geometries
If you need to create a new mask be aware that OM and psana use different formats and conventions. In order to convert a psana mask into an OM mask first:
- Flatten the first coordinate of the array. E.g. An array of shape
8x16x16becomes an array of shape128x16. - For OM, a value of 1 is a pixel which we want to keep, and a value of 0 is a pixel we want to mask.