BL1-5 Cheat Sheet

Last updated 7 June 2021

This is a guide to help you operate SAXS Beamline 1-5 - a beamline primarily dedicated to the SAXS Materials Science technique.

Computer Control of Beamline 1-5Computer and Control Systems

MARCCD PC runs on a LINUX OS. MARCCD runs the Mar (Rayonix) detector acquisition software, also called marccd (invoked with the command “marccd”). The functions necessary for data collection are invoked remotely from BL15LX.

BL15LX PC also runs on a LINUX OS. BL15LX governs all experimental control: the detector, the shutter, all sample motors and temperature control. The governing software is SPEC; an overlay of UNIX.

BL15PC1 PC runs on Windows 10. Its primary functions are: graphical SPEC control (Spectre) and data reduction; collapsing 2D images to 1D profiles either radially or azimuthally for transmission SAXS data or using rectangular regions of interest for grazing-incidence SAXS data. The data reduction algorithms used here are macros compiled within the Igor Pro software. These macros (Nika, Irena, etc.) are maintained by Jan Ilavsky.

BL15INST1 PC also runs on Windows 10. It's purpose is to run any specialized software that is needed for experiments at the beam line. It is safer to have a separate PC for additional software to avoid conflicts with the operation of the main beam line components.

New "b_user" Account Setup Procedure

SSRL requires a unique computer account to use the beam line computers. This is NOT the same as the user portal account.

There are multiple steps involved for initial account creation:

  • Email Ellie Fazli with the completed X-Ray/VUV Computer form AND the SLAC Information Services form found here.
  • Change your password via ssh into (Instructions)
  • Email Tim Dunn with your beam time information to have your P: drive configured (needed to save and download your data)
  • (Remote users only) Let the support staff know that the account is ready to be enabled for Remote Desktop control.

Remote Control

The beam line can be controlled remotely using a combination of MobaXterm and the Windows remote desktop application. Running MobaXterm on your computer allows you to connect to BL15PC1 via SSH protocol and use remote desktop without being on the SLAC computer network. Within BL15PC1, run MobaXterm to connect to BL15LX to start SPEC. The beam line can now be controlled entirely from your personal computer.

Here are the detailed instructions for this two step process:

  1. Connecting to BL15PC1 (First)
  2. Running SPEC on BL15LX (Second)

Please remember to use the correct computer names for the beamline you are accessing!

Shipping Samples

Please coordinate with the beam line staff if you wish to ship samples to BL1-5. The shipping form for remote operations can be found here.
Additional instructions for shipping samples and equipment to SSRL are here.

Accessing Data

If your data has been stored on the "P:" drive, it can be accessed remotely through a SFTP client (such as WinSCP or Filezilla). Connect to server using the same login protocol as for BL15LX; i.e. "b_user" and password. A quick guide with pictures can be found here.

Controlling the Beam line Through SPEC

SPECtre (SPEC GUI) was developed to provide a more convenient way to control the sample positioning motors as well as the X-ray detector.

Library of useful SPEC commands for BL1-5

Data Acquisition Commands

Opens the shutter

Closes the shutter

mar netroot mydirectory/mysample  [E.g. mar netroot PopleFeb12/AgBe_25C_60s]

Directs SPEC to store acquired images on the (remotely accessible) SPEC file server ( This drive is visible from BL15PC1 as the P: drive and the data will be directed to P:\bl1-5\mydirectory. The image will be tagged as mysample_0001.tiff and any further images will be tagged with the same name and iterating numbers. The data is also visible from the local X: drive – which is the hard drive of BL15LX, located under the desk. But the data is not actually on the X: drive, there is only one copy.

• Directories need to be created on the Windows PC BL15PC1; permissions to create them from BL15LX have been disabled, since it would be possible to create directories with forbidden characters and so then the data would be stored but irretrievable.
• WARNING: It’s possible to overwrite your data with the mar netroot command, because each time the mar netroot command is invoked the file counter is reset to 0001. If you invoke the command twice with the same variables, data will start to be overwritten.

mar bckgrd
This command loads the dark current image of the detector into a buffer within the detector head. All subsequent acquired images have this dark current pre-subtracted. This command should be run whenever there is a significant change in any experimental set-up, or after 24 hrs

mar collect 30
Acquires an image of 30 seconds exposure and saves it

mar reset
A recovery measure used to clear the status flags of the marccd detector. It has application in instances where ^C has been invoked at the SPEC prompt, either to break a running macro, or because a wrong single command was entered, e.g. mar collect x, where x was far too long. Entering ^C on BL15LX will successfully abort the SPEC command and return the SPEC prompt, *but* the marccd software can remain busy and unaddressable. In these cases mar reset from the SPEC prompt will restore the marccd software also. mar reset may also have application in other instances where the marccd software hangs (e.g. if the user unwisely chooses to interact with the marccd software directly)

General Motor Move commands

wm motorname
Abbreviation of "where motor": returns the current position, limit values, etc of motor motorname. The actual motor names are all listed in the multicoloured motor monitor panel; e.g. sp_horz; sp_vert; etc

Abbreviation of "where all": Returns the current position, limit values, etc of all motors

mv motorname 25
Moves motor motorname to absolute position of 25 mm

umv motorname 25
u = update, so the position of motor motorname will be updated (directly below the cursor) as the move proceeds from the starting point to 25.00 mm

umvr motorname 2
r = relative; so the move of motor motorname will be 2 mm in the default positive direction from the starting point

ascan motorname -1 1 40 0.1
This command will open the shutter and collect data for 40 intervals of 0.1 seconds, while motor motorname is stepped through 40 evenly spaced increments between -1 and 1. This command is very useful for sample alignment: two common applications would be locating the zero degree point on GISAXS samples on the goniometer head; or finding the multiple positions available in the multi-sample capillary holder. Note that this command has nothing to do with the MAR detector; the only “data” which is taken is the ion chamber values by which beam transmissions can be deduced. If the ascan command is being invoked for the first time at login, then it is first necessary to assign a filename with the command newfile filename

lup motorname -1 1 40 0.1
This command is similar to the ascan command except the motor moves between relative positions defined from -1 and 1.


Temperature Control Commands

settemp 80
Sets the temperature of the stage to 80 °C and, in macro mode, immediately proceeds to execute the next command in sequence. In direct control mode it immediately returns the prompt

waituntiltemp 80
Sets the temperature of the stage to 80 °C and waits until the temperature is reached before either a) executing the next command in macro mode or b) returning the prompt in direct control mode

Returns the setpoint and current temperature on the BL15LX monitor

Loads the process variable of the temperature controller (i.e. the temperature) into a SPEC variable DEGC. Can verify this with the command p DEGC, which prints the DEGC value at the SPEC prompt on the BL15LX monitor. This has useful application when running macros

Setting up Macros to run the beamline automatically

SPEC allows the use of scripting files to automate certain processes. All arguments and statements follow the UNIX format. In order to get started, you need to first create a macro script (using a text editor) and save it on the P: drive. SPEC must then be navigated to the appropriate folder containing the macro file and then it can be run.

Here is a quick guide for writing a macro script file: macro guide


Find Stanford Synchrotron Radiation Lightsource on TwitterFind Stanford Synchrotron Radiation Lightsource on YouTubeFind Stanford Synchrotron Radiation Lightsource on Flickr