The Holton Utilities
This page documents the beamline-control utilities developed
at ALS 8.3.1. These commands are available for all users from the
Unix command line on all computer consoles at 8.3.1. They are also
available to the "dcsuser" account on the bl82c machine for beamlines 8.2.1
and 8.2.2. On occasion, they can also be found on the linux processing
computers bl82xk2.
the links are to the actual
code for each program (if you want to look at it).
The "Caveat" sections reflect
portability issues and their various reasons.
The "Tip Script" section
provides a short sequence of commands that you can cut-and-paste to a Unix
shell in order to do something useful.
User start-up
These "high-level" procedures will automatically
conduct routine procedures involved in beamline maintenance, commissioning
and characterization. They work by running the "low-level" alignment
procedures listed below. If these scripts fail, you will need to
use the lower-level programs manually to figure out what's going on.
-
startup.com
-
walks through all the steps in you should take in starting up a new user.
This includes calibrating the monochromator, tuning up the beamline, resetting
the divergence, clearing out the run list in BLU-ICE.
-
The only steps that need to be done by hand are:
-
mounting the alignment jig
-
adjusting the crosshairs on the video monitor
-
adjusting the lo-mag prism
-
mounting the Selenium reference
usage: startup.com [hurry]
will guide you through everything neccesary to start up a new user.
realign.com
is a microscope/beam/rotation axis alignment procedure. It is a good
idea to run this every time you change the pinhole. It will prompt
you when to put on the alignment jig and show you a little movie about
where to find it. It will then use autocenter.com
to position the jig, tuneup.com to maximize
the beam through the pinhole, find_beam.com
to locate the pinhole position in the video camera, and find_axis.com
to locate the sample rotation axis in the video camera. It will then
adjust the pinhole stage "UP" position so that it is centered in the beam
and then run tuneup.com again to maximize
the beam through the new pinhole position. Then it will prompt you
to align the low-mag microscope so it is coaxial with the high-mag microscope.
usage: realign.com
reset_runs.com
will clear the last user's run information from BLU-ICE,
set the wavelength to 1.1A, set the divergence to 2x0.35 mrad and set the
goniometer to accept 18mm
Hampton pins. It will also signal the DVD robot to create the departing
user's last disk.
usage: reset_runs.com
aliases: finished
go
will start up BLU-ICE,
ADXV,
and a calculator program. This is useful if the user accidentally
closes the BLU-ICE
window by mistake.
usage: go
aliases: dcs ice blu-ice bluice blue-ice start
session Control.sh
eta.com
tells you how long it will take for the current data collection run to
finish. A filename pattern and expected number of images can be specified
on the command line. If nothing is specified on the command line,
then the current run in BLU-ICE is used. The date stamps on the files are
used to calculate the average "step" time per frame, and this is extrapolated
to predict how long the rest of the run will take. The script will
re-run itself periodically to give an increasingly accurate prediction
as more files become available. Unusually large time gaps (like refills)
are ignored in the stepsize calculation, but a warning is issued whenever
a gap of more than five images exists between the last image file time
stamp and the current time.
example: eta.com
returns:
now on /data/mcfuser/wemmer/mbc/cube0630/peak1_2_036.img
70 files expected, 22 so far, 48 to go
00:20:19 elapsed, 00:46:19 remaining
rate: 57.9 s/file
total time expected: 01:06:38
time is now: Mon Jun 30 12:03:16
PDT 2003
will finish at Mon Jun 30 12:49:35 PDT 2003
example: eta.com '/data/dcsuser/somebody/semet3_*.img'
400
returns:
now on /data/dcsuser/somebody/semet3_101_179.img
400 files expected, 359 so far, 41 to go
00:48:33 elapsed, 00:05:32 remaining
rate: 8.1 s/file
total time expected: 00:54:05
time is now: Mon Jun 30 12:05:02
PDT 2003
will finish at Mon Jun 30 12:10:34 PDT 2003
Note that the filename pattern MUST be enclosed in single quotes.
This is to prevent your current shell from expanding ("glob"ing) the pattern
before passing it to eta.com.
Caveat: Defaulting to the current run will
not work on 8.2.x or 5.0.x because dcss_adapter does not provide current
run information.
nuke
is a weapon of last resort. This will first ask the user for a reason
why the system was restarted. This reason is emailed to the system
administrators and logged in the system change log.
Nuke will then jump to each computer in the control system and kill every
process remotely associated with it. Once everythting has been stopped,
each log in /data/logs is backed up using a unique number as an additional
extension, and the entire control system
is restarted, including a call to go to launch the GUI.
usage: nuke [die]
Use "nuke die" only when you just
want to kill the system and not restart it. As in going down for
maintenance.
Alignment Tools
-
tuneup.com
-
is a full optimization of the x-ray beam through the pinhole. This
procedure will move the sample 1mm down the cryostream (to protect it and
to get it out of the way). Disable the feedback
system. Insert the photodiode.
Open the shutter. Maximize the flux out of the
monochromator.
Maximize the flux through the pinhole with a vertical
and horizontal scan of the beam. Then
the shutter is closed, diode removed and the feedback system recalibrated
to the new beam position. Finally, the original sample position is
restored. The hill-climbing features of the frontend software are
used first, and then a "manual" scan through the current position is fitted
to a parabola in gnuplot.
-
tune_rock.com
-
optimizes the output flux of the monochromator by adjusting Theta2.
-
tune_M2.com
-
optimizes the delivered flux through the pinhole by vertical beam steering
with M2 Tilt.
-
tune_chi2.com
-
optimizes the delivered flux through the pinhole by horizontal beam steering
with Chi2.
-
-
feedback.com
-
controls the video beam position feedback system.
-
usage: feedback.com [off|keep]
-
where:
-
off means to stop feeding
back the centroid position to M2 tilt and chi2
-
keep means to use the current
centroid position as the "right" position
-
example: feedback.com keep
-
The "keep" option will only enable
the feedback system if a centroid is indeed observed with the shutter closed
and if no centroid is observed 200 tries in a row with the shutter open.
This prevents mishaps due to inoportune beam dumps and improperly set-up
video options in the front end.
-
-
find_beam.com
-
will locate the position of the x-ray beam in the current microscope field-of-view.
The new beam location is then used to update the crosshairs in the beamline
GUIs.
-
-
find_axis.com
-
will locate the position of the center of spindle rotation in the current
microscope field-of-view. The location of this axis relative to the
x-ray beam is used to calculate a new "up" position of the pinhole stage
so that the x-ray beam and rotation axis cross. The optimal move
of the pinhole stage is then suggested.
-
-
find_backstop.com
-
will locate the shadow of the beamstop in the most recent diffraction image.
An optimal move of the beamstop positioning motors is then suggested.
-
-
find_direct_beam.com
-
will insert all attenuator foils, move the monochromator to 1.1A, close
down the slits to 0.02 x 0.02 mrad, lower the pinhole stage and take a
0.1s direct-beam image using snapshot.com.
After the snapshot, the wavelength, divergece, etc. are all returned to
their original values. The beam spot pixels are then extracted and
fit to a Gaussian in gnuplot to precisely locate the centroid of the direct
beam on the detector surface. Upon user approval, the new beam center
will be updated in DCSS and used in subsequent image files.
-
-
autocenter.com
-
Places the sample in the vicinity of the beam by using center.com at phi=0
and phi=90 at low magnification and then again at high magnification.
The tip of the sample is then placed at the left side of the video screen.
The faceon.com procedure is then run
to try and present the most informative side of the sample to the user.
-
-
center.com
-
moves the tip of the sample into the x-ray beam. The sample is identified
by photographing it in two positions and then taking the square of the
difference between the images. This minimizes artefacts due to lighting
and dirt on the microscope.
-
-
center_wire.com
-
moves a long, thin object into the x-ray beam. The wire is identified
by looking for a sharp change in intensity in a thin vertical stripe taken
through the beam position.
-
-
focus.com
-
maximizes the variance of the video image by moving the sample along the
camera's viewing axis. This tends to bring the sample into focus.
-
-
faceon.com
-
maximizes the entropy of the video image by rotating the sample.
n images are taken at evenly-spaced values of phi and the results are fitted
to a sine wave. The sample is then rotated to the phi value that
gives maximum entropy/information.
-
usage: faceon.com n
-
where: n is the number of evenly-spaced
images to take and fit to the sine wave
-
example: faceon.com 6
-
-
calibrate.com
-
measure the pixel size in the microscope by observing a known sample motion.
Not fully implemented.
-
-
align_apertures.com
-
automates the procedure for aligning the slits. This is meant to
recalibrate the stored endpoint positions in the frontend computer so that
the commanded divergence is true. Not fully
implemented.
-
Data Collection Tools
-
snapshot.com
-
takes a single diffraction image in BLU-ICE. It is a useful tool
for automated screening and scripted beamline comissioning:
usage: snapshot.com /data/user/frame_0_001.img
[options]
where:
/data/user/frame_0_001.img
is the name of the image file to create
options include:
-fast
do not wait for image to appear on disk before exiting
-dose
use dose mode
-nodose
do not use dose mode
-newdark
collect a new dark current
-nodark
do not collect a new dark current
xs
use an exposure time of x
seconds
xmm
use a detector distance of x
seconds
xdeg
use a starting phi value of x
degrees
xeV
use a photon energy of x
electron volts
xA
use an x-ray wavelength of x
Angstroms
osc=x
use an oscillation width of x
degrees
The default for all these options is to use the values currently stored
in run "0" of BLU-ICE. The changes to run "0" will be left in place,
so sucessive "snapshot.com" commands will "inherit" the parameters given
to the last command.
example: snapshot.com /data/mcfuser/tests/bs_0_001.img 10s 600mm 1A 0deg -nodose -newdark
Will collect a 10-second (equivalent dose) exposure with the detector at
600 mm. The starting value of phi will be 0 degrees, the photon energy
will be 12398.42 eV after collecting a new dark current.
example: snapshot.com /data/mcfuser/tests/bs_0_001.img 10s 600mm
Will collect a 10-second exposure with the detector at 600 mm. The
starting value of phi, the photon energy and the dose mode setting will
be whatever is currently stored in the snapshot run.
run1.com
much the same as snapshot.com, execpt that a
data collection run is executed.
usage: run1.com /data/user/frame_1_001.img
[options]
where:
/data/user/frame_1_001.img
is the name of the image file to create
options include:
-dose
use dose mode
-nodose
do not use dose mode
-inverse
collect in inverse beam mode
-noinverse do
not collect in inverse beam mode
xs
use an exposure time of x
seconds
xmm
use a detector distance of x
seconds
xdeg
use a starting phi value of x
degrees
xeV
use a photon energy of x
electron volts (cumulative)
xA
use an x-ray wavelength of x
Angstroms
osc=x
use an oscillation width of x
degrees
wedge=x
use an wedge size of x
degrees
range=x
cover a rotation range of x
degrees total
The default for all these options is to use the values currently stored
in run "0" of BLU-ICE. The changes to run "0" will be left in place,
so sucessive "snapshot.com" commands will "inherit" the parameters given
to the last command.
example: run1.com /data/mcfuser/tests/native_1_001.img 1s 200mm 1A 0deg -nodose -newdark
Will collect a 100 image data set with 10-second (equivalent dose) exposure
with the detector at 200 mm. The starting value of phi will be 0
degrees, the photon energy will be 12398.42 eV.
example: run1.com /data/mcfuser/tests/semet_1_001.img 10s 600mm 12660eV 12655eV 12300eV
Will collect a 10-second exposure with the detector at 600 mm at the three
indicated photon energies. The starting value of phi and the dose
mode setting will be whatever is currently stored in the snapshot run.
scan.com
aquires a fluorescence scan.
usage: scan.com start_eV end_eV [step_eV]
or:
scan.com Ee [step_eV] [time_s]
or:
scan.com scanfile.scan
where:
start_eV
is the photon energy at which to start the scan
end_eV
is the photon energy at which to end the scan
step_eV
is the minimum amount to increment the photon energy (default: 1.0 eV)
time_s
is the acquisition time in seconds (default: 1.0 s)
Ee
is the element symbol of the metal to scan
scanfile.scan
is a previously-generated scan file to process
The output scan will be stored in a file named after the current snapshot.
For example, if the last snapshot was /data/mcfuser/test_0_001.img,
then the file generated by scan.com
will be /data/mcfuser/test_Se_0_001.img.
If that is not possilbe, the filename "./scan.log"
will be used. By default, scans are done with an uneven stepsize,
reaching a minumum of the specified step_eV at the middle of the scan.
Specifying an element symbol will generate a scan straddling that element's
lowest-energy acessible edge.
Initially, a fluorescence optimization will be run at the high energy end
of the scan range. Filters and divergence motors will be adjusted
to achieve 30 kcps. Once the scan is done, the filters and divergence
will be returned to their starting values.
The output scan will be processed in Chooch where available.
example: scan.com
Se
will perform a 1.0s/step scan from 12651 eV to 12810 eV in steps of not
less than 1.0 eV.
pause.com
pauses the current data-collection run in BLU-ICE. You can use this
in scripts to make sure your procedure does not mess up somebody's images.
unpause.com
puts any paused run in BLU-ICE back into a "running" state. You can
use this in your scripts to make sure your use of "pause.com" does not
stop data collection permanenetly.
collecting.com
reports wether or not a data collection run is currently actively collecting
in BLU-ICE. The return $status will be set to zero if no data collection
is running, and to something non-zero if it is running.
example: collecting.com
returns: data collection is not running.
example: echo $status
returns: 0
Data Archiving Tools
-
sendhome
-
Sendhome is a file transfer program, designed for sending x-ray image data
home from a synchrotron site in real time. The sendhome script continuously
watches for newly-created images, and then sends them to a specified remote
machine when they appear. The transfer is done through an ssh
login session, so, as long as you can logon to the remote computer using
ssh, the program will work, and the remote password only needs to be given
once. Transfers are also compressed, so most x-ray images are sent ~3X
faster than FTP. The syntax is simmilar to scp:
usage: sendhome /data/user/frame_001.img user@remotehost.college.edu:/bigdisk/user/frames
will send frame_001.img and any images in /data/user
(on the local machine) newer than frame_001.img to /bigdisk/user/frames
on remotehost.college.edu, using "user"'s account. However, sendhome
is (at the moment) "upload-only", so you can't use it to transfer remote
files to the local machine. To do that, you should ssh to the remote machine,
and "sendhome" back to your local host. The ssh
login session is conducted in the usual way, except that, instead of a
remote command prompt, you see the remote tar job unpacking your files.
Once the transfer has started, you can press <Cntrl>-Z
("Ctrl" key and "Z" key), followed by the "bg"
unix command to continue transfering files in the background.
For the technically curious, the transfer is done something like this:
ls -1rt /data/user | (cd /data/user ; tar cf - - ) | compress | ssh user@remotehost.college.edu "(cd /bigdisk/user/frames ; tar xvf - )"
Caveat: Unfortunately, sendhome only works
on SGIs and Linux machines. OSF1 users are out of luck unless they get
a better tar program. Also, you MUST have ssh installed on both ends in
order for sendhome to be secure!
backup_local.com
is a script for archiving files onto DVD-R or CD-R under Linux. Formerly
known as backup.com. You must have
a DVD-R or CD-R drive attached to the local machine for backup_local.com
to work:
usage: backup_local.com directory -not junk -only good -since timefile -nolabel -noimage -noverify
where:
directory is the directory(s) you want to back up onto a DVD-R
junk are files/subdirectories you want to leave out
good is a string that the back-ed up filenames must contain (default: everything)
timefile no files as old or older than timefile will be included
-nolabel don't generate labels with autolabel.com
-noimage don't generate an intermediate disk image (fast and dangerous)
-noverify don't check the written files match the originals with verify.com
example: backup_local.com /data/mcfuser/whatever -not '_0_'
will back up everything but screening shots
example: backup_local.com /data/mcfuser/whatever -only img -only scan -not '_0_'
will back up every *.img or *.scan file but no screening shots
example: backup_local.com /data/mcfuser -since /data/mcfuser/blah/firstrun_1_100.img
will back up everything collected AFTER firstrun_1_100.img
Caveat: backup_local.com
can only run on a machine with a DVD/CD-R drive attached. Try "dvdrecord
-scanbus" first.
backup_rimage.com
submits an archive to the DVD robot. The syntax is largely the same
as the old backup.com but with a
few new features. Note that the robot has a queue of disks to make
and may have a backlog. To see what is really cooking, look at the
"Production Server" on graphics2.
usage: backup_rimage.com directory -not junk -only good -copies n -since timefile -splituser -realtime
where:
directory is the directory(s) you want to back up onto a DVD-R
junk are files/subdirectories you want to leave out
good is a string that the back-ed up filenames must contain (default: img|scan|jpg)
n how many copies to make of each DVD (default: 1)
timefile no files as old or older than timefile will be included
can also be:
last implies the last file in the last archive submitted to the robot
now implies the current time (useful for -realtime)
-splituser don't mix users on the same DVD (default: mix them)
-realtime keep scanning directory and wait for >4.6GB before writing a DVD
-priority urgency of the archive (bumps up job in the queue) (default: 4)
-mediasize maximum amount of data you want on one disk (in bytes)
-regardless shortcut to make sure all the files get backed up, regardless of their name
-note a text string to print next to the serial number on the disk
example: backup_rimage.com /data/mcfuser/ -since
now -realtime -splituser
will back up every image and scan collected from this point onward.
Files with different "X" in /data/mcfuser/X/whatever...
will be kept on different disks and /data/mcfuser
will be continuously monitored. No DVD will be written until it gets
larger than 4.6GB, a different user collects an image or the finished
program is run.
example: backup_rimage.com /home/mcfuser/processing
-only "." -priority 1 -not temp -not TMP
will back up every file in /home/mcfuser/processing
except for ones containing "temp" or "TMP" in their names. The robot
will do this job as soon as it is done with it's current disk write.
Caveat: backup_rimage.com
can only run on the file server, so "ssh server"
first.
backup_firewire.com
copies a filesystem to a Windows-shared firewire disk in real time.
The script will scan the network for DHCP-configured laptops, and default
to a sensible share being offered by them, but will usually at least need
your laptop's password.
usage: backup_firewire.com //host/share:Username%password directory
where:
host is the name of the Windows computer sharing the disk (default: discover DHCP)
share is the sharename you gave to the firewire disk (default: discover one)
Username is the Windows username on "host" (default: Administrator)
password is your Windows password (default: empty)
directory is the directory system to be sent
example: backup_firewire.com //192.168.10.3/share/Administrator%password
sends everything under the current directory to the folder shared as
"share" by the Administrator account on the computer with IP address
192.168.10.3.
example: backup_firewire.com //archive/ALS_831:Administrator
stuff
sends everything under "stuff"
to the "ALS_831" share on the computer called "archive"
using the Administrator account and an empty password.
example: backup_firewire.com ///%password
/data/mcfuser
sends everything under /data/mcfuser
to the first DHCP-connected laptop on the network, using the first share
found on that computer using the Administrator accound and password "password"
Caveat: backup_firewire.com
is fastest when run on the file server, so "ssh
server" first.
verify.com
verifies a DVD against the files on disk.
usage: verify.com /dvdrom [/directory] [random]
[readthru]
where:
/dvdrom is the directory
that the DVD/CD is mounted on
/directory is the old directory that was
used to make the DVD (default: /)
random means
to check the files in a random order (default: order listed on disk)
readthru means to ignore any
errors and check every file (default: exit on first error)
example: verifty.com /dvdrom /home/jamesh
will check /dvdrom/some/random/file.txt
against /home/jamesh/some/random/file.rxt
for every file found under /dvdrom
that is, the contents of /dvdrom
should match precisely the contents of /directory.
image_history.com
make a log of all image data on disk and create a script for purging data
up to any desired date or disk free space.
titles.com
comes up with maximally descriptive titles given a list of filenames. A
maximum of two titles will be generated. The most common unique root
directory names will be used.
usage: suamrize.com [directory|list.txt] [slots]
where:
directory is the directory containing
files and subdirectories to sumarize
list.txt is a text file listing
the filenames to sumarize
example: titles.com /data/mcfuser/jamesh/diode
returns: Jamesh
sumarize.com
comes up with a maximally descriptive pattern list that matches a list
of filenames. An arbitrarilly large number of filenames can be provided,
but the output is gaurenteed to contain less than a specified number of
patterns. The default is 14, which is the maximum number of 12-point
ines that can fit on a DVD label.
usage: suamrize.com [directory|list.txt] [slots]
where:
directory is the directory containing
files and subdirectories to sumarize
list.txt is a text file listing
the filenames to sumarize
slots is
the maximum number of output patterns
example: sumarize.com /archive/files_0546.list
returns: /data/mcfuser/jamesh/SMAD/alpha/ssad_3.1A_1_###.img
1-60
/data/mcfuser/jamesh/SMAD/alpha/ssad_3.1A_2_001.img
/data/mcfuser/jamesh/SMAD/alpha/test_4000_0_###.img 1-6
/data/mcfuser/jamesh/SMAD/alpha/test_5000_0_###.img 2-6
/data/mcfuser/jamesh/SMAD/alpha/ssad_2.5A_1_###.img 1-60
/data/mcfuser/jamesh/SMAD/alpha/test_6000_0_###.img 1-7
example: sumarize.com /archive/files_0546.list
3
returns: /data/mcfuser/jamesh/SMAD/alpha/ssad_3.1A_1_###.img
1-60
/data/mcfuser/jamesh/SMAD/alpha/*.img (19)
/data/mcfuser/jamesh/SMAD/alpha/ssad_2.5A_1_###.img 1-60
sumarize.com was intended to create
labels for DVDs but it is handy for sumarizing arbitrary directories and
identifying data sets.
autolabel.com
is a fully-automated label maker. The beamline name is even deduced
from the detector serial number in the image files.
usage: autolabel.com [directory|list.txt] [CD|DVD]
[double] ["title"] [bmp]
where:
directory is the directory containing
files and subdirectories on the disk
list.txt is a text file listing
the filenames on the disk
CD|DVD is
the desired media type to appear on the label (default: DVD)
double be sure
to print two copies of each label with meritline.com
title is
the title to print on to the dvd (default: from titles.com)
bmp
do not print the label on the laser printer, create label.bmp graphics
file instead
The following programs are called by autolabel and constitute an example.
makelabel.com
generates the base graphic for a CD/DVD label.
usage: makelabel.com [dpi] [-beamline beamline] [-synchrotron ALS] [CD|DVD]
where:
dpi
is the desired dots-per-inch on the label (default: 200dpi)
beamline is the desired beamline
ID to appear on the label (default: current)
CD|DVD is the desired
media type to appear on the label (default: DVD)
example: makelabel.com 200dpi -beamline 5.0.3 DVD
creates:
titlestamp.com
writes up to two titles at the top and bottom of a DVD label graphic.
The titles will be shrunk to fit into the predetermined area.
example: titlestamp.com label.miff "James Holton"
example
creates:
datestamp.com
writes a date on the upper right margin of a DVD label graphic. The
string will be shrunk if it doesn't fit in the area.
usage: datestamp.com label.miff ["Date string"]
where:
label.miff is
the graphics file to print the date onto
"Date string" is the date to print
(default: today's date)
example: datestamp.com label.miff
creates:
filestamp.com
writes up to 14 text strings onto the top and bottom of a DVD label.
An attempt is made to position them in an asthetically-pleasing and maximally
informtive manner. For example, if the filename is too long, the
right side is always kept on the printed area because that is usually the
most non-redundant information.
example: sumarize.com /archive/files_0546.list >! files
filestamp.com
label.miff files
creates:
textstamp.com
writes an arbitraty text string at a specified location on the DVD label graphic.
For example, this is useful for identifying the label by number when it comes
out of the printer without the number ending up on the final disk itself.
usage: textstamp.com label.miff "some text" -pos 1.23,2.34 -pointsize 12 -maxwidth 1.5
where:
label.miff is the graphics file to print the text onto
"some text" is the string to print
1.23,2.34 is the position (in inches) of the center of the text
12 is the point size of the font to use
1.5 is the maximum horizontal size (in inches) the text can be before the listed point size is shrunk
example: textstamp.com label.tiff "0001" -pos 2.35 2.5 -pointsize 33 -maxwidth 1.5
creates:
meritline.com
prepare a DVD label for printing on a Meritline
sticky-label in a laser printer. All this program really does
is paste the label graphic into a larger, page-size GIF file.
usage: meritline.com label.miff [label.miff]
where:
label.miff is
the graphics file(s) to print onto the sticky label
creates:
The result can be printed directly with lp meritline.gif.
Diagnostic Tools
-
ring.com
-
This is a quick and simple way to check if there is light in the beamline.
example: ring.com
returns: 343.394 mA light available hutch is hot
example: ring.com
returns: 198.421 mA and filling hutch is dark
ring.com uses Imono In to tell if light is available
and Izero to see if the hutch is hot or dark.
-
flux.com
-
This script reports all the ion gauge readings in the beamline and tells
you how the PIN diode current compares to the maximum expected value.
It is used by tuneup.com to report how well the
tuneup is going, and is also useful as a check to see if a tuneup needs
to be done.
usage: flux.com [active]
where:
active indicates you want flux.com to open the shutter and insert the PIN diode for you.
example: flux.com
returns:
Sat Jun 21 18:03:02 PDT 2003
11271.3 eV (1.10000 A) convergance: 2.0 x 0.3
Iring: 352.58 mA
Iin: 0.9734 uA ( 1.1043 uA at 400 mA)
Iout: 0.3862 nA ( 0.4382 nA at 400 mA)
Izero: 3.5702 nA ( 4.0612 nA at 400 mA)
Flux = -0.00 uA at 352.58 mA ( -0.0000 uA at 400 mA or -9.34e+04 hv/s)
Beam intensity is 0% of maximum
example: flux.com active
returns:
Sat Jun 21 18:03:37 PDT 2003
diode is in
shutter is open
autoscaling...
done.
shutter is closed
diode is out
11271.3 eV (1.10000 A) convergance: 2.0 x 0.3
Iring: 352.092 mA
Iin: 0.9728 uA ( 1.1051 uA at 400 mA)
Iout: 0.3853 nA ( 0.4377 nA at 400 mA)
Izero: 3.5661 nA ( 4.0587 nA at 400 mA)
Flux = 66.20 uA at 352.092 mA ( 75.21 uA at 400 mA or 1.51e+14 hv/s)
Beam intensity is 100% of maximum
flux.com has internally-stored tables of how much diode current
is possible through a 100um pinhole at each photon energy on each beamline
and will calculate how much it is expected to be reduced by the slit settings
and the ring current. flux.com does not compensate for pinhole
size or attenuator foils.
idle.com
This script checks to see how long the beamline has been idle. It
is useful for checking to see if users are having a problem, or if they
just went home and didn't tell anybody about it.
example: idle.com
returns: 00:06:55 /data/mcfuser/somewhere/test_0_031.img
Sat Jun 21 16:21:55 PDT 2003
This means it has been about seven minutes since the users took their last
snapshot.
caveats:
this script will not work on 8.2.x because the $XFORMSTATUSFILE
variable is not set on the linux machines.
-
overtime.com
-
This script logs just about everything in the beamline every ten seconds.
It is useful for identifying and diagnosing problems that occur on a long
time scale (hours). This information can also be obtained from the
logs on the beamline control computer, so the main utility of overtime.com
is to edit it to execute some kind of repetitive activity in the beamline
(such as opening the shutter and reading the diode current) and logging
the results.
-
usage: overtime.com >&! overtime.log &
-
where:
-
overtime.log is the file you want
to keep the output in.
-
The log generated by overtime.com looks like this:
Jun 21 16:15:22 2003 1056237322 193.457 529.546 11271.3 1.39048 0.20816 1.44883 13417 1.99994 0.349856 3.49586 1.15597 90.119 145.867 29.0267 45.0087 22.6
Date seconds ring monoIn Energy Theta2 monoOut Chi2 M2Tilt Hdiv Vdiv Izero Iend Hcen Vcen Hfwhm Vfwhm temp
If you look inside the overtime.com script itself (toward the
bottom) you will find the gnuplot commands for making nice graphs of all
the data you see in the log.
change.com
This script appends an entry into /data/log/change.log.
It is useful for recording the time when something interesting occurred.
User's phone calls, for example, can be recorded here. Knowing exatly
what time a problem occured makes it a lot easier to figure out when it
happened.
Many other scripts use change.com to record important events:
The tuneup scripts record the new optimised values
of the beamline motors.
find_beam.com records the apparent
pinhole size.
find_axis.com records each new "up"
position for the collimator.
find_direct_beam.com records the new
beam center.
feedback.com records when the feedback
system was enabled/disabled.
nuke records when BLU-ICE/DCSS was restarted.
example: change.com user complained no light
Will append the text:
Jun 20 10:26:24 2003 energy: 11271.3 Hdiv: 2.0 Vdiv: 0.3 Iring: 346.263 Iin: 0.9623 Iout: 0.4372 Izero: 7.1100 bl831 user complained no light
to /data/log/change.log. You
can then "grep pinhole /data/log/change.log"
to see when the pinhole was changed.
Tip:
The change log is useful for when motors get really badly out of alignment.
If, for instance, the feedback system ran away and you have no idea where
the Chi2 and M2 Tilt values are supposed to be, you can
"grep M2 /data/log/change.log" and
see what was the last value for M2 Tilt that gave a decent Iend.
Then use blmotor.com to move it back
to this value. You can do the same for Chi2.
caveats:
the change log for 8.2.x is in ~dcsuser/change.log
on bl82c.
best_chi2.com
characterize.com
Visualization Tools
-
snap.com
-
will grab a jpeg image from the Axis video server. This is a core
utility for all the automated image interpretation programs, but users
will also often want to take a picture of their crystal if it is a particularly
pretty one. This is how you do it.
usage: snap.com [filename.jpg] [camera] [352x240] [-mark] [-nodisplay]
where:
filename.jpg is the name of the image to safe [default: inherited from snapshot run]
camera is the axis camera number to use [default: 1]
352x240 is the desired pixel dimensions of the image [default: 704x480]
-mark will draw a circle indicating the beam profile on the image
-nodisplay do not display the image after capturing it [default: display it]
example: snap.com pretty.jpg -mark
will save the current high-mag camera (#1) video image as "pretty.jpg",
mark it with a circle, and display it.
example: snap.com hutch.jpg 4 -nodisplay
will save the current image from the overhead camera (in 8.3.1) to the
file "hutch.jpg", but will not display it.
Caveats:
snap.com is unreliable on 8.2.# because it needs to ssh into bl82#c in
order to access the Axis server. This will sometimes require a password,
which can get annoying when a lot of pictures need to be taken for programs
like find_beam.com, find_axis.com,
center_wire.com.
the default behavior of naming the *.jpg after the snapshot image will
not work on 8.2.# because dcss_adapter does not provide information
on data collection.
the -mark feature will not work on 8.2.x because
dcss_adapter does not provide information on the beam position.
moviefy
Moviefy is a program intended for sumarizing x-ray image graphics as movies,
but it can be used to convert just about any sequence of graphics images
into a movie. On SGIs, the dmconvert program is used, (and it's
only available on Irix 6.x). However, moviefy can employ ImageMagick
on any unix platform.
usage: moviefy /data/user/frame_???.img
will convert all the frames indicated into an SGI movie. You can also specify
a particular region of the detector face using "-box" and you can also
control the zoom and normalization factors:
usage: moviefy /data/user/frame_???.img -box 100 200 900 1000 -zoom 0.5 -scale 0.2
will convert the area between the pixel coordinates (100,200) and (900,1000)
on all the frames indicated into an SGI movie. The size of the image will
be rescaled (zoomed) so that each pixel on the detector becomes 0.5 pixels
in the movie. Also, the value of the (usually 16-bit) detector pixel will
be multiplied by 0.2 before it is converted to the (8-bit) greyscale movie
file. By default, a zoom of 0.25 is used, and the scale is determined automatically
for each image. To "auto-scale" for only the first image, and keep that
scale for the rest, you would say "-scale same".
The moviefy script is used by the Spotter
Elves to make their movies of important spots. To work quickly, moviefy
requires the image converter binaries adsc2pgm
and osc2pgm (below), but it does contain its own
embedded copies of the binaries and source, so it will always work on a
computer with an ANSI compatible C compiler installed and licenced.
-
xplot
-
Xplot is a short awk program for reformatting a table of numbers to be
displayed in the CCP4 program xloggraph.
-
Files like this:
-
Rcrys Rfree
-
33.23 35.25
-
30.45 33.89
-
25.30 30.21
-
22.18 28.67
-
Become this:
-
27.79 +/- 4.31107
-
32.005 +/- 2.66587
-
$TABLE : - Plots:
-
$GRAPHS:Values by line:A:1, 2, 3:
-
:Values vs. 1st column:A:2, 3: $$
-
line Rcrys Rfree $$
-
$$
-
1 33.23 35.25
-
2 30.45 33.89
-
3 25.30 30.21
-
4 22.18 28.67
-
$$
usage: xplot data.list >! data.xplot ; xloggraph data.xplot
will produce and xloggraph "version" of each column of numbers in data.list.
Building Blocks
blmotor.com
This is a little jiffy for talking to devices in the "beamline" (everything
up to the shutter). You can use this to get motor positons and gauge
readings and to command motors to move to new values.
usage: blmotor.com Motor [destination]
where:
Motor is the motor or gauge name you are interested in
destination is where you want it to go
example: blmotor.com Mono eV
returns: Mono eV is now at 11271.2
will report the current photon energy setting.
example: blmotor.com Iend
returns: Iend is now at 78.476
will report the current signal on the "Iend" channel. This is usually
the photodiode.
example: blmotor.com Mono eV 12398.42
returns: Mono eV is now at 12398.4
will move the photon energy to 12398.42 eV. The final "report" line
will only appear once the motor has actually stopped moving. The
exit status will be non-zero if the motor did not arrive at it's destination.
This is usually because the frontend computer is in "Local control" mode.
Caveats:
blmotor.com will sometimes misreport
a failed move if the motor is already close to 0.
fluorescence.com
reports the number of photons to hit the fluorescence detector for a given
interval. It will open and close the shutter at the appropriate moments
to do this.
usage: fluorescence.com [time]
where:
time is the count time in seconds
example: fluorescence.com 0.5
returns: 12345 fluorescent photons were counted in 0.5 s.
Make sure you use scintilator.com
to insert the fluorescence detector first.
scintilator.com
report or change the fluorescence detector position.
usage: scintilator.com [in|out]
example: scintilator.com
returns: scintilator is out
example: scintilator.com in
returns: scintilator is in
Where "in" is when the scintillator
is close to the beam and "out" is
when it is far away from the beam. The command will return the prompt
once the plunger has finished moving. A non-zero exit $status
means that the plunger failed to move to the desired position.
scintilator.com is used by optimize_fluorescence.com
and scan.com to insert the fluorescence
detector.
shutter.com
report or change the fast shutter position. (That is: last shutter
in the beamline)
usage: shutter.com [open|close]
example: shutter.com
returns: shutter is open
example: shutter.com close
returns: shutter is closed
Where "open" is when the shutter
is allowing the beam to pass and "closed"
is when it is not (in case there was any confusion). The command
will return the prompt once the shutter has finished moving. A non-zero
exit $status means that the shutter failed to move to the desired
position.
diode.com
report or change the PIN diode plunger position.
usage: diode.com [in|out]
example: diode.com
returns: diode is out
example: diode.com in
returns: diode is in
Where "in" is when the diode is reading
to the beam intensity and "out" is
when it is far away from the beam. The command will return the prompt
once the plunger has finished moving. A non-zero exit $status
means that the plunger failed to move to the desired position.
Tip script:
diode.com in
if($status) then
echo "diode failed to
extend"
echo "air pressure might
be too low "
endif
diode.com is used by tuneup.com
, tune_M2.com and tune_chi2.com
to insert the fluorescence detector.
cover.com
report or change the position of the detector's protective cover.
usage: cover.com [on|off]
example: cover.com
returns: cover is off
example: cover.com on
returns: cover is on
Where "on" is when the detector is
protected and "off" is when it is
not. The command will return the prompt once the plunger has finished
moving. A non-zero exit $status means that the plunger failed
to move to the desired position.
Tip script:
# excercise the detector cover
while(1) then
cover.com on
if($status) echo "ERROR:
cover failed to close"
cover.com off
if($status) echo "ERROR:
cover failed to come off"
endif
door.com
report the condition of the hutch door and tray table. Also get/set
the hutch door lock status.
usage: door.com [lock|unlock]
example: door.com
returns: hutch door is closed and locked
example: door.com unlock
returns: hutch door is closed and unlocked
This is useful for diagnostics from home. If the tray table is not
put away properly, the door will register as "open".
You can also use door.com to unlock the hutch door when it undesireably
locked. (such as when you want to adjust the light).
Caveat:
door.com will not work on 8.2.x
because dcss_adapter does not support this functionality.
attenuator.com
report or change foil plunger positions.
usage: attenuator.com [Ee] [in|out]
example: attenuator.com
returns: Al foil is out
example: attenuator.com Se
returns: Se foil is in
example: attenuator.com Se out
returns: Se foil is out
Where "in" is when the metal foil
is blocking the beam and "out" is
when it is far away from the beam. The default foil is "Al"
but you can specify another one on the command line. The command
will return the prompt once the plunger has finished moving. A non-zero
exit $status means that the plunger failed to move to the desired
position.
Tip script:
# recover from fluorescence scan
attenuator.com Al out
attenuator.com Se out
attenuator.com Cu out
divergence.com 2 0.35
sample.com
report or change the crystal position. All distances are in millimeters.
usage: sample.com [x y z]
where:
x is the distance to move in the direction of the x-ray beam
y is the distance to move in the direction of gravity (down)
z is the distance to move in the spindle direction (right-hand-rule)
or: sample.com to [x y z]
to implies that (x,y,z) is an absolute positon of the three sample motors
x is the desired position of the first sample motor
y is the desired position of the second sample motor
z is the desired position of the third sample motor
example: sample.com
returns: sample motors are now -0.623 -0.357 2.088
example: sample.com 0 0.1 0
returns: sample motors are now -0.722 -0.373 2.088
example: sample.com to -0.623 -0.357 2.088
returns: sample motors are now -0.623 -0.357 2.088
Note in the second example that the relative move "down" by 100 microns
changed both the x and y
motors. This is because relative moves are done in the lab frame
(x-ray beam, gravity, and spindle axis) and the motor moves are calculated
with the current value of phi rotation in mind. This way, you can
use the x coordinate to focus the sample in
the mircoscope. Note: this script does work for the kinematic stage
in 8.2.2.
On the other hand, absolute moves are done in the goniometer frame because
you almost always want to return to a particular setting and you don't
really care where the goniometer "origin" is with respect to the sample.
(In the past the absolute move was calculated with a give phi value, but
the "origin" of the sample position would change with phi. Many disasters
convinced me to make the absolute moves phi-independent.)
Tip script:
# take diffraction images of different parts
of the crystal
set start = `sample.com | awk '{print $5,$6,$7}'`
foreach shift ( "0 0" "0.1 0" "-0.2 0" "0.1
0.1" "0 -0.2" )
snapshot.com
snap.com -mark -nodisplay
sample.com 0 $shift
end
sample.com to $start
stage.com
report or change the position of the collimator/backstop vertical stage.
All distances are in millimeters.
usage: stage.com [to|by] [y]
or: stage.com [up|low|down|save|zero]
where:
to implies that y is an absolute positon of the vertical stage motor [default]
by implies that y is a relative move of the vertical stage motor
y is the desired distance in millimeters
up implies an absolute move to put the pinhole in the beam
low implies an absolute move to drop the stage to 1 inch below the beam
down implies an absolute move to drop the stage all the way down
save saves the current position as "up"
zero saves the current position as "up"
example: stage.com up
returns: stage position is now -0.240 mm
example: stage.com 0
returns: stage position is now 0.000 mm
example: stage.com low
returns: stage postion is now -30.000 mm
The "low" position is where the low-mag camera
just barely clears the pinhole. This optimally positions the backlight
foam in 8.3.1 for the low-mag camera.
Caveats:
the "up" position can be unreliable on 8.2.# because dcss_adapter does
not provide information on the currently-stored "in" position.
hstage.com
report or change the position of the collimator/backstop vertical stage.
All distances are in millimeters.
usage: hstage.com [to|by] [y]
where:
to implies that y is an absolute positon of the horizontal stage motor [default]
by implies that y is a relative move of the horizontal stage motor
y is the desired distance in millimeters
example: hstage.com
returns: horizontal position is now 0.123 mm
example: hstage.com 0
returns: horizontal position is now 0.000 mm
distance.com
report or change the sample-to-detector distance. All distances are
in millimeters.
usage: distance.com [to|by] [x]
where:
to implies that x is an absolute detector distance [default]
by implies that x is a relative move of the detector distance [why?]
x is the desired distance in millimeters
example: distance.com
returns: detector distance is now 250.0 mm
example: distance.com 600
returns: detector distance is now 600.0 mm
example: distance.com 2000
returns: detector distance is now 600.0 mm
Note that ridiculous values are filtered out. However, none of these
scripts have access to limits-of-travel information. They all rely
on DCSS, dcss_adapter, or the PMACs to prevent collisions.
twotheta.com
report or change the detector 2theta angle in degrees.
usage: twotheta.com [to|by] [x]
where:
to implies that x is an absolute detector angle [default]
by implies that x is a relative move of the detector angle [why?]
x is the desired angle in degrees
example: twotheta.com
returns: detector 2theta is now 0.0 deg
example: twotheta.com 10
returns: detector 2theta is now 10.0 deg
An attempt is made to keep the distance constant during the 2theta move,
but it is not gaurenteed.
beamstop.com
report or change the position of the backstop stage. All distances
are in millimeters.
usage: beamstop.com [to|by] [right] [up]
where:
to implies a move to an absolute motor positon
by implies a relative move of the backstop motors [default]
right is the desired horizontal distance in millimeters
up is the desired vertical distance in millimeters
example: beamstop.com
returns: beamstop motors are now -1.465 2.673
example: beamstop.com 0.01 -0.02
returns: beamstop motors are now -1.455 2.653
The second example will move the beamstop ten microns to the right and
twenty microns down (looking at the detector image in ADXV). Likewise,
"negative right" is left. In practice, one should bear in mind that
the beamstop is only about 0.3 mm wide, and moves should always be smaller
than that. I recommend 0.01 or 0.02 mm moves at a time.
Caveats:
Picomotors are not exactly reversible, so the absolute moves should
not be trusted too much.
beamstop.com is currently only calibrated for the orthogonal stage
in 8.3.1. The NewFocus stages in 8.2.# will not respond as expected!
wave.com
report or change the sample-to-detector distance. All distances are
in millimeters.
usage: wave.com [energy|wavelength|Ee|element]
where:
energy is
the desired photon energy (in eV)
wavelength is the desired x-ray wavelength
(in Angstroms)
Ee
is the element symbol of the desired edge
Element is the element
name of the desired edge
example: wave.com
returns: Energy:
11271.282 eV
Wavelength: 1.10000 A
example: wave.com 1
returns: Energy:
12398.424 eV
Wavelength: 1.00000 A
example: wave.com Se
returns: Energy:
12660.000 eV
Wavelength: 0.97934 A
Numerical values less that 3 are considered wavelengths. Numerical
values between 3 and 1000 are ignored. If an element symbol or name
is provided, then the lowest-energy accessible edge of that element is
used. This is almost always what you want to use for MAD. The
elements
utility is used to list the edges.
divergence.com
report or change the position of the slits that control the convergance
angle of the x-ray beam. This becomes divergence after the sample
position. These angles are in miliradians.
usage: divergence.com [horizontal] [vertical]
where:
horizontal is the desired horizontal divergence in mrad (millimeters/meter)
vertical is the desired vertical divergence in mrad (millimeters/meter)
example: divergence.com
returns: Beam Divergance: 3.0000 0.3498
example: divergence.com 2
returns: moving slits to 2 x 0.349782 mrad.......
Beam Divergance: 2.0000 0.3498
Note that you don't have to specify the vertical divergence angle.
light.com
report or change the intensity of the frontlight and backlight.
usage: light.com [light] [intensity%]
example: light.com
returns: light #1 is at: 100%
light #2 is at: 0%
example: light.com 2 50%
returns: light
#1 is at: 100%
light #2 is at: 50%
This is useful adjusting the light levels in automated scripts.
For example, you want to make sure the light is turned off before finding
the beam spot in find_beam.com and
you want to make sure it is turned on before centering the crystal in center.com.
Caveat:
light.com will not work on 8.2.x because dcss_adapter does not support
this functionality.
beamline.com
This program simply reports what beamline you are currently controlling.
(This may not be obvious if you are on the bl82c machine), however, the
script is smart enough to see if you ssh-ed in from bl821c or the like
and can almost always figure out which beamline is the appropriate one
to control. beamline.com is mainly used
by other control scripts to decide what hostnames to talk to, etc, but
you can run it by hand to check. You can override any automatic beamline
detection by setting the environment variable: "beamline"
usage: beamline.com
example: beamline.com
returns: 821
This means any other commands you type will try to control devices in 8.2.1.
example: setenv beamline 822
beamline.com
returns: 822
Any commands you type from here on out will apply to 8.2.2, and not 8.2.1.
beam.com
This program reports the currently-stored beam coordinates in the current
video channel. The numbers used are in fractional coordinates (range
[0:1]) to avoid confusion about how many pixels were in the video image.
The first coordinate is right->left and the second in top->bottom on the
video screen.
usage: beam.com [camera] [newx newy]
example: beam.com
returns: beam center in camera 1 is 0.5115 0.4692
example: beam.com 2
returns: beam
center in camera 2 is 0.502841 0.45
example: beam.com 0.5 0.5
returns: updated
beam center in database.
you must restart DCS for changes to take effect.
beam center in camera 1 is 0.5 0.5
This utility is used by find_beam.com in
order to update the various programs about the beam position once the beam
position is found automatically.
Caveat:
As indicated above, MCF/DCS must be restarted before it will update
the beam crosshairs in the display. BLU-ICE will update it immediately.
fov.com
This program reports the field of view (in mm) of the current video channel.
This number is independent of how many pixels were used to sample the video.
The first coordinate is the actual right->left size (in mm) and the second
is the actual top->bottom size (in mm) of the image on the video screen.
Negative numbers indicate mirror flips.
usage: fov.com [camera]
example: fov.com
returns: field of view in camera 1 is 0.586 -0.461
example: fov.com 2
returns: field
of view in camera 2 is 4.365 3.285
This utility is used to relate the video image to motor moves by various
image-iterpretation programs when generating moves for the sample.
Nuts 'n' Bolts
sock_exchange.tcl
is basically a hands-off version of telnet. The unix "standard input"
is sent to the remote computer and whatever comes back from the remote
computer goes to "standard output". Command-line options are used
to specify which computer, which port, etc. An error code is set
in the $status varible if anything goes wrong with the transation.
usage: echo "command" | sock_exchange.tcl computername port lines terminator timeout
where:
command is the text you want to send to the remote computer
computername is the name of the remote computer to connect to (default: localhost)
port is the TCP port to connect on (default: 80)
lines the number of lines you expect back in the reply (default: infinite)
terminator the character sequence used to mark the end of a "line" (default: "\n")
timeout number of seconds to wait for the reply before giving up (default: 30)
example: echo "GET /\r" | sock_exchange.tcl www.als.lbl.gov
returns: the html source of the ALS home page
example: echo -n "M412=1\rM411=1\r" | sock_exchange.tcl pmac-0 14001 2 "\006" 10
returns: two PMAC acknowlege characters: "\006\006"
and opens the x-ray shutter
if the PMAC doesn't respond it ten seconds, $status will be set to 9
example: echo "getpos Iend\r" | sock_exchange.tcl bl821b 10001 1
returns: "76.370239!0\r\n" which is the diode current on 8.2.1
xos_exchange.tcl
is like sock_exchange.tcl, but is specifically designed to deal with
the BLU-ICE/DCSS communication protocol (version 1.0). This protocol
exchanges messages to move motors, etc as 200-byte strings. It can
get a little unweildly to do this with sock_exchange.tcl.
usage: echo "gtos_command" | xos_exchange.tcl computername lines keytext timeout
where:
command is the text you want to send to the remote computer
computername is the name of the remote computer to connect to (default: localhost)
lines the number of "interesting lines" you expect back in the reply (default: infinite)
keytext a character sequence contained by an "interesting line" (default: nothing)
timeout number of seconds to wait for the reply before giving up (default: 30)
example: echo "gtos_set_shutter_state shutter open" | xos_exchange.tcl bl821c 1 "shutter shutter" 10
will: open the x-ray shutter and exit when it sees that the shutter state has changed.
returns:
stoc_send_client_type
stog_update_client_list 1
stog_update_client "alias" "555-5555" "Presidente" 1
stog_become_slave
stog_become_master
stog_configure_shutter shutter hardwareHost registerName 1 1 shutterType description open
stog_configure_real_motor gonio_phi hardwareHost hardwareName 179.807318 0 0 1 0 0 0 0 0 0 0 0 0
stog_configure_real_motor sample_x hardwareHost hardwareName -482.878125 0 0 1 0 0 0 0 0 0 0 0 0
stog_configure_real_motor sample_y hardwareHost hardwareName 345.030014 0 0 1 0 0 0 0 0 0 0 0 0
stog_configure_real_motor sample_z hardwareHost hardwareName -4603.081841 0 0 1 0 0 0 0 0 0 0 0 0
stog_configure_real_motor horizontal_collimator hardwareHost hardwareName -2.500000 0 0 1 0 0 0 0 0 0 0 0 0
stog_configure_real_motor vertical_collimator hardwareHost hardwareName 0.000000 0 0 1 0 0 0 0 0 0 0 0 0
stog_configure_real_motor detector_z hardwareHost hardwareName 301.001000 1000 90 1 0 0 0 0 0 0 0 0 0
stog_configure_real_motor detector_2theta hardwareHost hardwareName -0.001213 20 0 1 0 0 0 0 0 0 0 0 0
stog_configure_real_motor energy hardwareHost hardwareName 12681.058987 18000 2400 1 0 0 0 0 0 0 0 0 0
stog_configure_runs 0 -1 0
stog_configure_run_text run0 0 test /data/dcsuser
stog_configure_run run0 0.000000 1 0 1 1.000000 1.000000 243.000531 0 4 0 0.000000 0 e0 e1 e2 e3 e4 1 0.000000 0.000000 0.000000 0.000000 0.000000
stog_configure_crystal_alignment crystal_alignment 131.243.74.112 16283 173 107 1.700000 -1.900000 2 0 2 99 54
stog_configure_shutter Al hardwareHost registerName 1 1 attenuator description open
stog_configure_shutter Cu hardwareHost registerName 1 1 attenuator description open
stog_configure_shutter Se hardwareHost registerName 1 1 attenuator description open
stog_configure_bistable Diode extended retracted retracted
stog_configure_bistable xtal_illum extended retracted extended
stog_configure_bistable Fluorescence in out out
stog_configure_bistable Det Cover out in out
stog_set_shutter_state shutter open
Which is a lot of information, but you don't have
to look at it. You can just "grep" or "awk" for interesting things.
example: echo "gtos_set_shutter_state shutter open" |\
xos_exchange.tcl bl821c 1 "shutter shutter" 10 |\
grep "shutter_state shutter"
will: open the x-ray shutter and exit when it sees that the shutter state has changed.
returns:
stog_set_shutter_state shutter open
xos3_exchange.tcl
is functionally equivalent to xos_exchange.tcl
except that it speaks the BLU-ICE/DCS protocol version 3.0. This
protocol is a bit more elaborate and requires a challenge-response authentication
for each connection. Therefore, xos3_echange.tcl requres the DCSS
3.0 authentication libraries. Other than the setup, the usage is
basically the same as xos_exchange.tcl:
usage: echo "gtos_command" | xos3_exchange.tcl lines keytext timeout computername
where:
command is the text you want to send to the remote computer
computername is the name of the remote computer to connect to (default: server)
lines the number of "interesting lines" you expect back in the reply (default: infinite)
keytext a character sequence contained by an "interesting line" (default: nothing)
timeout number of seconds to wait for the reply before giving up (default: 30)
example: echo "gtos_set_shutter_state shutter open"
| xos_exchange.tcl 1 "shutter shutter" 10
will: open the x-ray shutter and
returns:
stoc_send_client_type
stog_respond_to_challenge
stog_login_complete 5366
stog_set_permission_level 5
stog_configure_hardware_host simDhs localhost
online
stog_configure_hardware_host pmac1 bl831.als.lbl.gov
online
stog_configure_hardware_host pmac2 bl831.als.lbl.gov
online
stog_configure_hardware_host wago bl831.als.lbl.gov
online
stog_configure_hardware_host beamline bl831.als.lbl.gov
online
stog_configure_hardware_host self localhost online
stog_configure_hardware_host camera sbdr.lbl.gov
offline
stog_configure_hardware_host detector bl831.als.lbl.gov
online
stog_configure_pseudo_motor camera_zoom self
camera_zoom 1.000000 1.100000 -0.100000 100 0 0 0
stog_configure_operation detector_collect_image
detector masterOnly
stog_configure_operation detector_transfer_image
detector masterOnly
stog_configure_operation detector_oscillation_ready
detector masterOnly
stog_configure_operation detector_stop detector
masterOnly
stog_update_client_list 5
stog_update_client 1 self {DCSS} {} {} 4 blctlxx
blctlxx:0 0
stog_configure_operation collectFrame self masterOnly
stog_configure_operation detector_reset_run detector
masterOnly
stog_configure_operation resetRuns self masterOnly
stog_configure_operation collectStillImage self
masterOnly
stog_configure_operation collectRun self masterOnly
stog_configure_operation collectRuns self masterOnly
stog_configure_operation pauseDataCollection
self masterOnly
stog_update_client 2 mcfuser {mcfuser} {486-4587}
{clod} 5 sbdr sbdr.lbl.gov:0 0
stog_update_client 3 mcfuser {mcfuser} {486-4587}
{clod} 5 sbdr sbdr.lbl.gov:0 0
stog_update_client 3446 mcfuser {mcfuser} {486-4587}
{clod} 5 graphics1.bl831.als.lbl.gov :0 1
stog_update_client 5366 jamesh {James Holton}
{486-4587} {super sr. beamline scientist} 5 bl831 bl831.als.lbl.gov:0 0
stog_configure_real_motor
detector_z pmac1 detector_z 350.000000 1000.500000 76.500000 1000.000000
20000 1 -1 0 0 0 1 1 0
stog_configure_pseudo_motor
detector_horz self standardVirtualMotor -2.221170 100.000000 -100.000000
1 1 0 0
stog_configure_pseudo_motor detector_vert self
standardVirtualMotor 8.718170 500.000000 -500.000000 1 1 0 0
stog_configure_real_motor detector_twotheta pmac1
detector_twotheta 0.000000 42.400000 -4.400000 2494.000000 500 50 0 0 0
0 0 1 0
stog_configure_real_motor horizontal_collimator
pmac1 horizontal_collimator -0.156200 -0.500500 0.500500 2000.000000 6000
100 875 0 0 0 0 0 0
stog_configure_real_motor vertical_collimator
pmac1 vertical_collimator -0.234300 9.499600 -194.000400 2000.000000 40000
100 875 0 0 0 0 0 0
stog_configure_real_motor beamstop_horiz pmac1
beamstop_horiz -1.477200 -0.500000 0.500000 -50000.000000 900 100 0 0 0
0 0 1 0
stog_configure_real_motor beamstop_vert pmac1
beamstop_vert 2.721000 -0.500000 0.500000 -143000.000000 900 100 0 0 0
0 0 1 0
stog_configure_real_motor gonio_phi pmac2 gonio_phi
231.980000 0.000000 0.000000 8385.000000 9000000 2500 0 0 0 0 0 1 0
stog_configure_real_motor sample_x pmac2 sample_x
-0.745000 0.000000 0.000000 16968.000000 6000 500 0 0 0 0 0 0 0
stog_configure_real_motor sample_y pmac2 sample_y
0.430000 0.000000 0.000000 16968.000000 6000 500 875 0 0 0 0 0 0
stog_configure_real_motor sample_z pmac2 sample_z
-2.580000 0.000000 0.000000 16968.000000 10000 100 875 0 0 0 0 0 0
stog_configure_pseudo_motor beam_size_x self
beam_size_x 0.801732 20.000000 0.050000 0 0 0 0
stog_configure_pseudo_motor beam_size_y self
beam_size_y 0.222450 20.000000 0.050000 0 0 0 0
stog_configure_shutter shutter pmac2 open
stog_configure_shutter Al wago open
stog_configure_shutter Cu wago open
stog_configure_shutter Se wago open
stog_configure_shutter diode wago open
stog_configure_shutter polarizer wago open
stog_configure_shutter scintillator wago open
stog_configure_shutter cover wago open
stog_configure_shutter door pmac1 closed
stog_configure_shutter door_lock pmac1 open
stog_configure_real_motor frontlight wago frontlight
96.000000 100.000000 -100.000000 1.000000 2000 100 0 0 0 0 0 0 0
stog_configure_real_motor backlight wago backlight
0.000000 100.000000 -100.000000 17500.000000 2000 100 875 0 0 0 0 0 0
stog_configure_pseudo_motor energy self energy_bl11
12000.012365 17000.000000 2000.000000 0 0 0 0
stog_configure_real_motor energy_lv beamline
energy_lv 11111.105411 20000.000000 2000.000000 1.000000 100000 1 0 0 1
0 0 0 0
stog_configure_real_motor attenuator_lv beamline
attenuator_lv 1.000000 100.000000 0.000000 1.000000 100000 1 0 0 0 0 0
0 0
stog_configure_real_motor horizontal_divergence_lv
beamline horizontal_divergence_lv 2.004948 3.500000 -1.000000 1.000000
100000 1 0 0 1 0 0 0 0
stog_configure_real_motor vertical_divergence_lv
beamline vertical_divergence_lv 0.349856 0.400000 -1.000000 1.000000 100000
1 0 0 1 0 0 0 0
stog_configure_real_motor attenuation_lv beamline
attenuation_lv 100.000000 0.000000 0.000000 1.000000 100000 1 0 0 0 0 0
0 0
stog_configure_real_motor m2_tilt beamline m2_tilt
13377.000000 0.000000 0.000000 1.000000 100000 1 0 0 1 0 0 0 0
stog_configure_real_motor chi2 beamline chi2
1.449514 0.000000 0.000000 1.000000 100000 1 0 0 1 0 0 0 0
stog_configure_real_motor theta2 beamline theta2
1.390000 0.000000 0.000000 1.000000 100000 1 0 0 1 0 0 0 0
stog_configure_real_motor m1_tilt beamline m1_tilt
-42700.000000 0.000000 0.000000 1.000000 100000 1 0 0 1 0 0 0 0
stog_configure_real_motor theta beamline theta
8.692675 0.000000 0.000000 1.000000 100000 1 0 0 1 0 0 0 0
stog_configure_real_motor y2 beamline y2 3.499500
0.000000 0.000000 1.000000 100000 1 0 0 1 0 0 0 0
stog_configure_real_motor z2 beamline z2 60.875400
0.000000 0.000000 1.000000 100000 1 0 0 1 0 0 0 0
stog_configure_real_motor m2_bend_up beamline
m2_bend_up 8.212171 100.000000 -100.000000 17500.000000 2000 100 875 0
0 0 0 0 0
stog_configure_real_motor m2_bend_down beamline
m2_bend_down 8.212171 100.000000 -100.000000 17500.000000 2000 100 875
0 0 0 0 0 0
stog_configure_ion_chamber i0 beamline hex1 0
rtc1 clock
stog_configure_ion_chamber i_in beamline hex1
0 rtc1 clock
stog_configure_ion_chamber i1 simDhs hex1 1 rtc1
clock
stog_configure_ion_chamber i2 simDhs hex1 2 rtc1
clock
stog_configure_ion_chamber i_sample simDhs hex1
3 rtc1 clock
stog_configure_ion_chamber i_beamstop simDhs
hex1 4 rtc1 clock
stog_configure_ion_chamber i5 simDhs hex1 5 rtc1
clock
stog_configure_ion_chamber i_fluor pmac2 hex1
6 rtc1 clock
stog_configure_ion_chamber i_mono_In beamline
hex1 7 rtc1 clock
stog_configure_ion_chamber i_mono_Out beamline
hex1 8 rtc1 clock
stog_configure_ion_chamber i_end beamline hex1
9 rtc1 clock
stog_configure_runs 1 1 0 1
stog_configure_run run0 complete 1 0
testytt1 /data/mcfuser 25 gonio_phi 184.01 185.01 1.00 1.0 15.0 350.000
1 11111.11 0 0 0 0 2 0
stog_configure_run run1 collecting 46 1
test-Prset1 /data/mcfuser 25 gonio_phi 185.01 249.01 1.00 1.0 15.0
350.000 1 11111.11 0 0 0 0 2 0
stog_configure_run run2 inactive
0 2 test /data/mcfuser 1 gonio_phi 0.00 1.00 1.00 1.0
1.0 300.000 1 11111.00 0 0 0 0 2 0
stog_configure_run run3 inactive
0 3 test /data/mcfuser 1 gonio_phi 0.00 1.00 1.00 1.0
1.0 300.000 1 11111.00 0 0 0 0 2 0
stog_configure_run run4 inactive
0 4 test /data/mcfuser 1 gonio_phi 0.00 1.00 1.00 1.0
1.0 300.000 1 11111.00 0 0 0 0 2 0
stog_configure_run run5 inactive
0 5 test /data/mcfuser 1 gonio_phi 0.00 1.00 1.00 1.0
1.0 300.000 1 11111.00 0 0 0 0 2 0
stog_configure_run run6 inactive
0 6 test /data/mcfuser 1 gonio_phi 0.00 1.00 1.00 1.0
1.0 300.000 1 11111.00 0 0 0 0 2 0
stog_configure_run run7 inactive
0 7 test /data/mcfuser 1 gonio_phi 0.00 1.00 1.00 1.0
1.0 300.000 1 11111.00 0 0 0 0 2 0
stog_configure_run run8 inactive
0 8 test /data/mcfuser 1 gonio_phi 0.00 1.00 1.00 1.0
1.0 300.000 1 11111.00 0 0 0 0 2 0
stog_configure_run run9 inactive
0 9 test /data/mcfuser 1 gonio_phi 0.00 1.00 1.00 1.0
1.0 300.000 1 11111.00 0 0 0 0 2 0
stog_configure_run run10 inactive
0 10 test /data/mcfuser 1 gonio_phi 0.00 1.00 1.00 1.0
1.0 300.000 1 11111.23 0 0 0 0 2 0
stog_configure_run run11 inactive
0 11 test /data/mcfuser 1 gonio_phi 0.00 1.00 1.00 1.0
1.0 300.000 1 11111.00 0 0 0 0 2 0
stog_configure_run run12 inactive
0 12 test /data/mcfuser 1 gonio_phi 0.00 1.00 1.00 1.0
1.0 300.000 1 11271.23 0 0 0 0 2 0
stog_configure_run run13 inactive
0 13 test /data/mcfuser 1 gonio_phi 0.00 1.00 1.00 1.0
1.0 300.000 1 11271.23 0 0 0 0 2 0
stog_configure_run run14 inactive
0 14 test /data/mcfuser 1 gonio_phi 0.00 1.00 1.00 1.0
1.0 300.000 1 11271.23 0 0 0 0 2 0
stog_configure_run run15 inactive
0 15 test /data/mcfuser 1 gonio_phi 0.00 1.00 1.00 1.0
1.0 300.000 1 11271.23 0 0 0 0 2 0
stog_configure_run run16 inactive
0 16 test /data/mcfuser 1 gonio_phi 0.00 1.00 1.00 1.0
1.0 300.000 1 11271.23 0 0 0 0 2 0
stog_configure_operation initializeCamera camera
masterOnly
stog_configure_operation getLoopTip camera masterOnly
stog_configure_operation centerLoop self masterOnly
stog_configure_operation addImageToList camera
masterOnly
stog_configure_operation findBoundingBox camera
masterOnly
stog_configure_operation normalize self masterOnly
stog_configure_operation expose self masterOnly
stog_configure_operation oscillation self masterOnly
stog_configure_operation requestExposureTime
self masterOnly
stog_configure_operation requestCollectedImage
self passive
stog_configure_operation optimize self masterOnly
stog_configure_pseudo_motor energyOptimizeTolerance
self standardVirtualMotor 0.050000 100.000000 -100.000000 1 1 0 0
stog_configure_pseudo_motor energyOptimizeEnable
self standardVirtualMotor 0.050000 100.000000 -100.000000 1 1 0 0
stog_configure_pseudo_motor energyLastOptimizedTable
self standardVirtualMotor 0.050000 100.000000 -100.000000 1 1 0 0
stog_configure_pseudo_motor energyLastTimeOptimized
self standardVirtualMotor 0.000000 100.000000 -100.000000 1 1 0 0
stog_configure_pseudo_motor energyLastOptimized
self standardVirtualMotor 12000.001736 100.000000 -100.000000 1 1 0 0
stog_configure_pseudo_motor energyOptimizedTimeout
self standardVirtualMotor 120.000000 100.000000 -100.000000 1 1 0 0
stog_configure_pseudo_motor doseStoredCounts
self standardVirtualMotor 186014348.800000 100.000000 -100.000000 1 1 0
0
stog_configure_pseudo_motor doseLastCounts self
standardVirtualMotor 159062934.600000 100.000000 -100.000000 1 1 0 0
stog_configure_pseudo_motor doseStabilityRatio
self standardVirtualMotor 0.050000 1000.000000 -1.000000 0 0 0 0
stog_configure_pseudo_motor doseThreshold self
standardVirtualMotor 200.000001 1000.000000 -1.000000 0 0 0 0
stog_configure_pseudo_motor doseIntegrationPeriod
self standardVirtualMotor 0.100000 1000.000000 -1.000000 0 0 0 0
stog_configure_pseudo_motor maxOscTime self standardVirtualMotor
60.000000 1000.000000 -1.000000 0 0 0 0
stog_configure_operation moveSample self masterOnly
stog_configure_operation prepareForScan self
masterOnly
stog_configure_operation recoverFromScan self
masterOnly
stog_configure_operation acquireSpectrum simDhs
masterOnly
stog_configure_operation excitationScan self
masterOnly
stog_configure_pseudo_motor optimized_energy
self optimized_energy_bl831 11111.105411 16000.000000 6000.000000 0 0 0
0
stog_configure_pseudo_motor zoomMinScale self
standardVirtualMotor 11.234016 100.000000 -100.000000 1 1 0 0
stog_configure_pseudo_motor zoomMedScale self
standardVirtualMotor 6.270053 100.000000 -100.000000 1 1 0 0
stog_configure_pseudo_motor zoomMaxScale self
standardVirtualMotor 2.937147 100.000000 -100.000000 1 1 0 0
stog_configure_pseudo_motor zoomMinXAxis self
standardVirtualMotor 0.511500 100.000000 -100.000000 1 1 0 0
stog_configure_pseudo_motor zoomMinYAxis self
standardVirtualMotor 0.469200 100.000000 -100.000000 1 1 0 0
stog_configure_pseudo_motor zoomMedXAxis self
standardVirtualMotor 0.500000 100.000000 -100.000000 1 1 0 0
stog_configure_pseudo_motor zoomMedYAxis self
standardVirtualMotor 0.500000 100.000000 -100.000000 1 1 0 0
stog_configure_pseudo_motor zoomMaxXAxis self
standardVirtualMotor 0.511500 100.000000 -100.000000 1 1 0 0
stog_configure_pseudo_motor zoomMaxYAxis self
standardVirtualMotor 0.469200 100.000000 -100.000000 1 1 0 0
stog_configure_string stringTest self Hello
stog_set_motor_dependency detector_z
stog_set_motor_dependency detector_twotheta
stog_set_motor_dependency horizontal_collimator
stog_set_motor_dependency vertical_collimator
stog_set_motor_dependency beamstop_horiz
stog_set_motor_dependency beamstop_vert
stog_set_motor_dependency gonio_phi
stog_set_motor_dependency sample_x
stog_set_motor_dependency sample_y
stog_set_motor_dependency sample_z
stog_set_motor_dependency frontlight
stog_set_motor_dependency backlight
stog_set_motor_dependency energy_lv
stog_set_motor_dependency attenuator_lv
stog_set_motor_dependency horizontal_divergence_lv
stog_set_motor_dependency vertical_divergence_lv
stog_set_motor_dependency attenuation_lv
stog_set_motor_dependency m2_tilt
stog_set_motor_dependency chi2
stog_set_motor_dependency theta2
stog_set_motor_dependency m1_tilt
stog_set_motor_dependency theta
stog_set_motor_dependency y2
stog_set_motor_dependency z2
stog_set_motor_dependency m2_bend_up
stog_set_motor_dependency m2_bend_down
stog_report_shutter_state shutter closed
You can read about what all this stuff means in the DCSS
Administration Manual.
example: echo "gtos_set_shutter_state shutter
open" |\
xos3_exchange.tcl 1 "shutter shutter" 10 |\
grep "shutter_state shutter"
will: open the x-ray shutter and exit when it sees
that the shutter state has changed.
returns:
stog_set_shutter_state shutter open
Caveat:
xos3_exchange.tcl will only work
on 8.3.1 because it is the only ALS beamline with DCSS 3.0 installed.
Conversion Tools
-
adsc2pgm
(sgi,
linux,
c
source)
-
Converts an ADSC Quantum 4/210/315
image file (SMV) into a Portable
Greymap image file. Most modern image file converters, such as ImageMagick,
can read PGM, and convert it to something that takes up less space.
The Portable Greymap (PGM) format is the most general kind of greyscale
image format imaginable. Basically, it's a short text header: "P2 <width>
<height> 255", followed by a list of text numbers between 0 and 255,
which are the pixel values.
-
You can specify a region of the detector face by using "-box x1 y1 x2 y2"
on the command line, you can specify the "zoom factor" (size scale) with
"-zoom x", and the intensity scale using "-scale x". The program defaults
to converting the whole detector face, using a zoom factor of 0.25 (4 detector
pixels -> 1 image pixel), and an intensity scale of rms(pixel value)/5,
which, empirically, gives a "nice" looking normalization in the 8-bit output
image.
usage: adsc2pgm input_1_001.img -box 100 100 300 300 -zoom 0.2 -scale 0.1 output.pgm
will take the region between pixels (100,100) and (300,300) (as defined
in ADXV) on
input_1_001.img, multiply the pixel values by 0.1,
and then output every 5th pixel to output.pgm. If you don't specify
an output file name here, it would default to "input_1_001.pgm".
header_edit.com
is a utility written to rewrite the headers of ADSC
Quantum 4/210/315 images (SMV format). The script you find here will
change only the "PHI=x" line and replace x with a number in the
range [-360:360]. However, all you have to do is change the
little awk program a bit and it can do pretty much anything to SMV image
headers.
usage: header_edit.com /data/wrong_phi/input_1_001.img
[/data/wrong_phi/input_1_002.img ...]
where:
/data/wrong_phi/input_1_*.img are
a bunch of images with weird phi values in their headers
produces: ./new_input_1_*.img
with phi values in headers reduced to the range [-360:360]. Note
that the new files are created in the current directory, but the input
files can be anywhere.
example: header_edit.com badphi_1_*.img
edlog2overtime.com
converts the logfile format of the 8.x.x frontend computers (written by
Ed Dommning) into a more gnuplot-readable format.
This page is not finished. It will never be finished, and neither will
yours. Admit it.
James Holton <JMHolton@lbl.gov>