P02.1 - Public : Beamtime Software Details

The Terminal

On the Linux PCs in the control hutch, the terminal can be started in one of three ways:

  • Click on Applications in the top right, under System Tools click on the icon for Terminal
  • On the desktop, right click and select Open Terminal from the menu
  • Press Alt+F2 (simultaneously). In the box that appears, type gnome-terminal and press OK/enter

Beamline Software

The main graphical user interface for controlling the beamline can be started either from the link on the desktop (Beamline Control Software) or by opening a terminal and running:

$ Beamline.sh

Running Scripts - ipython3

Scripts are run inside an ipython terminal. To open one of these, you first need to open a terminal and then type:

$ screen -S robo
$ cd ~/Scripts/p021
$ ipython3

N.B. robo is the name of the screen. It can be anything you want.

Once inside ipython3, you need to import the script written for you by the beamline staff (example: In 1). If you make changes to the script in Atom (see below), you first need to save the script and then reload it (example: In 2). You can also use shorter names to reduce typing (example: In 3), but this changes the way you need to reload your script (example: In 4)

In [1]: import mybeamtime

In [2]: reload(mybeamtime)
Out[2]: <module 'mybeamtime' from 'mybeamtime.pyc'>

In [3]: import mybeamtime as mbt

In [4]: reload(mbt)
Out[4]: <module 'mybeamtime' from 'mybeamtime.pyc'>

atom

Atom is the editor that is used by the beamline for editing scripts. You can start Atom by clicking on Applications and selecting the Atom icon from the Accessories group. Alternatively you can just type atom into any terminal. Scripts are typically located in the directory /home/p021user/Scripts/p021 You can access all scripts by selecting Open Folder from the file menu in Atom. Ask your local contact if you are unsure which is the right one.

When writing scripts, it's important to look out for any underlined text. This indicates an error in the script and should be corrected (if possible) before running the code. Also, please be careful with spaces: if you create a block of code where some lines have 4 spaces and some have 5 spaces in the front it will not run!

Also avoid using rare characters, especially when entering sample names! Only use '-' or '_'. If possible avoid spaces (' ') or punctuations ('.').

screen

Screen (see above) means that your commands keep on running in case something goes wrong with the PC (but it keeps running). You can see what screen sessions are running with the command: screen -ls

You can also detach from a screen by pressing Ctrl+a then d. To reattach, or in case all the windows disappear, in a terminal run screen -x robo. You can even attach from a different PC using the terminal (the following assumes the screen session was running on haspp021ch1a):

$ ssh p021user@haspp021ch1a
...
$ screen -x robo

DAWN

DAWN is a software suite produced by Diamond Light Source which we use at the beamline to analyse/reduce diffraction data. The software can be started on the Linux PC in the middle of the hutch from a terminal by typing:

$ dawnsci

DAWN is also available on the Windows PCs - you can start it from the desktop icon.

There are more details about resources for using DAWN in Beamtime Data Processing.

Online

Online is the old software for controlling the beamline. It can be started on the control PC (left side of the control hutch) from a terminal, run:

$ online-gpfs.sh

This will save data into /gpfs/current/raw/online

For beamline staff only there are two other commands to start online. The

  • online-comm.sh - using online in a commissioning visit. Data is saved into /gpfs/commissioning/raw/online
  • online-local.sh -  using online with data not saved to GPFS