GM/CA @ APS Perl Scripts

The list below describes the majority of GM/CA @ APS scripts including their purpose and call syntax. Unless stated implicitly, the order of command line arguments when calling the scripts is not important. The arguments shown on [..] are optional. The keywords are usually case-tolerant, but the parameters are not. The scripts not included into the list are test scripts (i.e. those written to test certain Perl or beamline control functionality) and the scripts written for a specific task and unlikely to be of general usage. The scripts where a maintainer is not mentioned, are authored by Sergey Stepanov.

A | B | C | D | E | F | G | H | I | J | K | L | M | N | O | Q | P | R | S | T | U | V | W | X | Y | Z


alignMiniBeam.pl
 

Purpose:
Align X-ray beam to the pinhole or guard slits by scanning mirror piezos (DACs) both horizontally and vertically.

GUI:
The GUI frontend alignMiniBeam.tcl is available through the TOOLS menu on EPICS toolbar. The script is also called from JBluIce by pressing on "Optimize Beam" button and after big energy moves.

Syntax:
alignMiniBeam.pl [beamline] [autoPinholeOrGuardSlits] [noKBM|useKBM] [noCRL|useCRL] [noTF|useTF] [align300to10|useGuardSlits[=xx]] [signal=Pin|I0|Beamstop] [countTime=xx] [StepV=xx] [HalfRangeV=xx|HalfRangeVfactor=xx] [StepH=xx] [HalfRangeH=xx|HalfRangeHfactor=xx] [flyscanCorrectionH=xx] [flyscanCorrectionV=xx] [centerH=FWHM|FWHMsmooth|Imax|Gauss|Lorentz|centroid] [centerV=FWHM|FWHMsmooth|Imax|Gauss|Lorentz|centroid] [noCollimatorMove] [noCollimatorRestore] [noPindiodeMove] [ignoreSample|warnSample|moveSample=xx[h|v]|moveSampleNoWarn=xx[h|v]] [fastScan|stepScan] [tryVerticalHWfeedback] [tellBluIce|bluice|nobluice] [medm|nomedm] [gnuplot|gnuplot=image|nognuplot] [displayTime=nn] [optimizeGain[=force|=auto]|skipGain] [useEncoder|noEncoder] [toleranceFactor=xx] [pauseMostab|skipMostab] [pausePostab|skipPostab] [save=prefix] [help|?]

beamline
Beamline specification. Possible values are 23i, 23o, or 23b. The default is current beamline.
autoPinholeOrGuardSlits
Disables using guard slits if current pinhole choice is 10um or 5um; otherwise the script choice depends on the align300to10|useGuardSlits flags: if none or align300to10 is specified, it forces 10um, otherwise uses guard slits.
noKBM|useKBM
Use or not KBM piezo for alignment. The default is to use KBM if available at the beamline unless CRLor TF specified.
noCRL|useCRL
Use or not CRL Z & Y for alignment.
noTF|useTF
Use or not Transfocator Z & Y for alignment.
Align300to10
Requests temporary change of active collimator from 300um to 10um.
useGuardSlits[=xx]
Requests use of guards_slits for alignment. The default size is 0.025mm, unless specified here.
signal=Pin|I0|Beamstop
Requests the intensity source. The default is either pin diode, or I0 when noPindiodeMove is specified.
countTime=xx
Requests count time per point in seconds. The default is 0.1s.
StepV=xx
Requests vertical scan step; the default is 0.02mm.
HalfRangeV=xx
Requests vertical scan +/– range; the default is 0.5mm.
HalfRangeVfactor=xx
Requests a multiplier to the default vertical scan +/– range; the default is 1.
flyscanCorrectionH=xx
Requests correction to found center voltage in the horizontal fly scan
StepH=xx
Requests horizontal scan step; the default is 0.08mm.
HalfRangeH=xx
Requests horizontal scan +/– range; the default is 1mm.
HalfRangeHfactor=xx
Requests a multiplier to the default horizontal scan +/– range; the default is 1.
flyscanCorrectionV=xx
Requests correction to found center voltage in the vertical fly scan
flyscanCorrectionH=xx
Requests correction to found center voltage in the horizontal fly scan
centerV=FWHM|FWHMsmooth|Imax|Gauss|Lorentz|centroid
Provides option to choose vertical center either by peak FWHM (the middle between two half-intensity points searched from tails; default), or FWHMsmooth (the middle between two half-intensity points searched from peak), or at Imax (max intensity point), or at Gaussian or Lorentzian fit, or by centroid.
centerH=FWHM|FWHMsmooth|Imax|Gauss|Lorentz|centroid
Provides option to choose horizontal center either by peak FWHM (the middle between two half-intensity points searched from tails; default), or FWHMsmooth (the middle between two half-intensity points searched from peak), or at Imax (max intensity point), or at Gaussian or Lorentzian fit, or by centroid.
noCollimatorMove
Disables bringing collimator in before scan and out after the scan.
noCollimatorRestore
Disables taking collimator out after the scan (leaves it as is for next operation).
noPindiodeMove
Disables bringing pin diode in before scan and out after the scan.
ignoreSample|warnSample|moveSample=xx[h|v]|moveSampleNoWarn=xx[h|v]
Warn that sample is mounted or warn & shift or shift without warning. Default is warn. If shift is requested, default shift direction is UP for positive xx (in mm) or DOWN with negative xx. If xx is followed by "h", the shift direction is OUTBOARD (positive) or INBOARD (negative).
fastScan|stepScan
Requests using on-the-fly DAC/TF/CRL scan or stepped DAC/TF/CRL scan (default).
tryVerticalHWfeedback
Requests an attempt to optimize beam with lock-in positional feedback. If the attempt fails (intensity does not raise), still runs vertical DAC scan.
tellBluIce|bluice|nobluice
Requests sending messages to JBluIce logs and doing popups via JBluIce or not. The tellBluIce and bluice options are synonyms. The default is no JBluIce reporting.
medm|nomedm
Requests opening scan MEDM screen for on-the-fly scans. The default is yes.
gnuplot|gnuplot=image|nognuplot
Requests plotting scan data with Gnuplot. The default is yes. If gnuplot=image is selected, the plot is also saved as an image file.
displayTime=nn
Requests seconds of displaying plot after the scan is finished. The default is 60s.
optimizeGain[=force|=auto]|skipGain
Requests pre-optimizing Keithley gain on the signal. Unless "force" is present, the default is to optimize the gain only when the previously stored gain was for different energy/attennuation.
useEncoder|noEncoder
Request verifying DAC output during piezo scans with ADC readback (aka "encoder")
toleranceFactor=xx
Sets tolerance for differences between DC output and ADC readback. The default is 0.5, which means a half or scan step.
pauseMostab|skipMostab
Specifies wether intensity feedback should be paused. Default is no.
pausePostab|skipPostab
Specifies wether positional feedback should be paused. Default is no.
save=prefix
prefix for saved scan data. The default is "align_YYYY-MM-DD_hh-mm".
Help|?
Shows all available command-line parameters.

alignYAG.pl

Purpose:
Align beam to hi-res camera crosshair using beam footprint on the YAG crystal. This script makes a snapshot YAG crystal image with hi-res video camera, draws integrated cross-sections of it, finds deviations of peak intensity from image centers and then corrects the beam position with the mirror piezos. Basically it serves the same purpose as alignMiniBeam.pl, but on one hand it is faster and on the other it provides lower beam positioning accuracy.
Execution steps:

  1. Put YAG in (not included)
  2. Pause intensity and positional feedback
  3. Remove collimator
  4. Remember current zoom
  5. Set zoom=12
  6. Loop over optical centering algorithm:
    – Fetch JPEG image from HiRes video camera
    – Digitize JPEG and find integrated cross sections; Optionally plot them with GnuPlot
    – Optionally save the image and the cross sections
    – Recalculate the center deviations from pixels to mm (for given zoom)
    – Apply piezo voltage changes (DAC) to provide necessary corrections
    – Repeat if needed up to 3 times
  7. Store new set points in the positional feedback
  8. Start intensity and positional feedback
  9. Restore zoom
  10. Place back collimator

GUI:
Not available.

Syntax:
alignYAG.pl [beamline] [plot|noplot] [save|nosave] [pauseMostab|skipMostab] [pausePostab|skipPostab]

beamline
Beamline specification. Possible values are 23i, 23o, or 23b. The default is current beamline.
plot|noplot
Requests plotting YAG image cross sections with Gnuplot or not.
save|nosave
Requests saving YAG images and cross sections or not.
pauseMostab|skipMostab
Requests intensity feedback pausing option.
pausePostab|skipPostab
Requests positional feedback pausing option.

allowedremote.pl

Purpose:
This script helps to figure out if a user is allowed to connect to a particular computer (if the SSH server configuration was patched properly by UAP to allow the user). The script displays the AllowUsers string from /etc/ssh/sshd_config. Inspect the output to see if needed username and IP are listed.
NOTE: The script must have the suid privileges and perl-suid RPM package must be installed because by default /etc/ssh/sshd_config is accessible to root only.

GUI:
Not available.

Syntax:
allowedremote.pl [showdomains|skipdomains] [details|short]

allowedremote.pl [showdomains|skipdomains] [details|short] [email] [ndays=n]
showdomains|skipdomains
Show or skip domains corresponding to currently allowed IP ranges. The default is showdomains.
details|short
Show either detailed (with session IDs) or short output. The default is short.
email
Send email (currently to sstepanov@anl.gov) with full script output. By default no email is sent.
ndays=n
Show stats for today + n days. By default only today stats is analyzed.

attenuationDBprint.pl

Purpose:
This routine prints attenuation data (foil types, thicknesses, excluded foils) from both JBluIce mySQL and Acromag-9440 Digital I/O channel descriptions. It can be used for checking the DB consistency.

GUI:
None is available. The script is meant to be used from command line.

Syntax:
attenuationDBprint.pl


attenuationGet.pl

Purpose:
Gets current beam attenuation and prints it on the screen. Can be used by an automation script to fetch the attenuation value. It uses the same attenuation calculation algorithm, as in JBluIce.

GUI:
None is available. The script is meant to be used from command line.

Syntax:
attenuationGet.pl [beamline] [%|x]

beamline
Beamline specification. Possible values are 23i, 23o, or 23b. The default is current beamline.
%|x
Specifies attenuation units. The default is attenuation unit is percent.

attenuationSet.pl

Purpose:
Sets beam attenuation. Can be used by an automation script. It deploys the same attenuation calculation algorithm, as in JBluIce.

GUI:
None is available. The script is meant to be used from command line.

Syntax:
attenuationSet.pl [beamline] attenuation[%|x]

beamline
Beamline specification. Possible values are 23i, 23o, or 23b. The default is current beamline.
attenuation[%|x]
Specified requested attenuation value. Optional parameters "%" or "x" specifies attenuation units. The default is attenuation unit is percent.

attenuationServer.pl
 

Purpose:
Provide EPICS clients with PVs to read and set beam attenuation. Once started, the script works with 23n:attenuationAct, 23n:attenuationRqs, and 23n:attenuationSet PVs, which allow attenuation control from any EPICS client. The script deploys the same attenuation calculation algorithm, as in JBluIce. It was developed because JBluIce does not have attenuation mapping into PVs.

GUI:
Graphical interface is available through the TOOLS menu on EPICS toolbar. It consists of a MEDM screen, which has a button to launch the server. Keep in mind that in order to avoid multiple instances, the server can be started on ws2 only.

Syntax:
attenuationServer.pl [beamline]

beamline
Beamline specification. Possible values are 23i, 23o, or 23b. The default is current beamline.

autocenter_xrec_crystal.pl

Purpose:
This script implements automatic sample centering with video from beamline camera servers and XREC package from Victor Lamzin group. It is maintained and developed by Sudhir.

GUI:
The script is called from JBluIce Hutch and Sample tabs.

Syntax:
autocenter_xrec_crystal.pl [beamline] [bluice|nobluice] [haveringlight|noringlight] [havebacklight|nobacklight] [backlight=x.y] [ringlight=x.y] [lowzoom=x.y] [highzoom=x.y]

beamline
Beamline specification. Possible values are 23i, 23o, or 23b. The default is current beamline.
bluice|nobluice
Requests sending messages to JBluIce logs and doing popups via JBluIce or not.
haveringlight|noringlight
Is ringlight installed? Default depends on beamline
havebacklight|nobacklight
Is backlight installed? Default depends on beamline
backlight=x.y
Backlight intensity (DAC value). Default depends on beamline
ringlight=x.y
Ringlight intensity (DAC value). Default depends on beamline
lowzoom=x.y
Lowres camera zoom
highzoom=x.y
Hires camera zoom

autocenter_xrec_loop.pl

Purpose:
This script implements automatic loop centering with video from beamline camera servers and XREC package from Victor Lamzin group. It is maintained and developed by Sudhir. It is a faster version of autocenter_xrec_crystal.pl since it requires less operations.

GUI:
The script is called from JBluIce Hutch and Sample tabs.

Syntax:
autocenter_xrec_loop.pl [beamline] [bluice|nobluice] [haveringlight|noringlight] [havebacklight|nobacklight] [backlight=x.y] [ringlight=x.y] [lowzoom=x.y] [highzoom=x.y]

beamline
Beamline specification. Possible values are 23i, 23o, or 23b. The default is current beamline.
bluice|nobluice
Requests sending messages to JBluIce logs and doing popups via JBluIce or not.
haveringlight|noringlight
Is ringlight installed? Default depends on beamline
havebacklight|nobacklight
Is backlight installed? Default depends on beamline
backlight=x.y
Backlight intensity (DAC value). Default depends on beamline
ringlight=x.y
Ringlight intensity (DAC value). Default depends on beamline
lowzoom=x.y
Lowres camera zoom
highzoom=x.y
Hires camera zoom

axis_crossection.pl

Purpose:
This script makes a snapshot of given low-res or hi-res beamline video camera and plots a cross-section or an averaged cross section using GnuPlot.
Execution steps:

  1. Fetches JPEG image from video camera.
  2. Digitizes JPEG.
  3. Finds cross section.
  4. Analyzes it and plots with GnuPlot.

GUI:
Not available.

Syntax:
axis_crossection.pl [beamline] [HiRes|LoRes] [H[@v=nnn|first|last|center|integral]] [V[@h=nnn|first|last|center|integral]] [plot|noplot]

beamline
Beamline specification. Possible values are 23i, 23o, or 23b. The default is current beamline.
HiRes|LoRes
Beamline video camera choice
H[@v=nnn|first|last|center|integral]
Do horizontal cross-section at optionally specified vertical position or integral (averaged over all vertical positions). The default is integral.
V[@h=nnn|first|last|center|integral]
Do vertical cross-section at optionally specified horizontal position or integral (averaged over all vertical positions). The default is integral.
plot|noplot
Request showing cross section(s) with GnuPlot or not. The default is showing. The script does not produce data files. So, if noplot is selected, you will only get cross-sections statistics printed on the screen.

If no camera is specified, both HiRes and LoRes cameras are used. If no cross-section is requested, both vertical and horizontal integral cross-sections are built.


axis-movie-mjpg.pl

Purpose:
This script records a Motion JPEG movie of given duration from an Axis video camera. The movie is recorded as a series of JPEG frames. To assemble them back into an AVI file, one has to use either JPGvideo for Windows (http://www.ndrw.co.uk) or mjpegtools for Linux (http://mjpeg.sourceforge.net), which is called automatically. This script needs some work since it uses old style of detecting camera URL (by camera number) and does not support iQeye cameras.

GUI:
Not available.

Syntax:
axis-movie-mjpg.pl


axis-movie-snapshots.pl

Purpose:
This script makes a series of dated snapshots from an Axis video camera. It loops until Ctrl+C is pressed and writes snapshots after fixed sleep time. After the script is executed, the snapshots can be arranged into a movie with the help of JPGvideo for Windows (http://www.ndrw.co.uk) or mjpegtools for Linux (http://mjpeg.sourceforge.net). This script needs some work since it uses old style of detecting camera URL (by camera number) and does not support iQeye cameras.

GUI:
Not available.

Syntax:
axis-movie-snapshots.pl [sleep=seconds]

sleep=seconds
Specifies interval between successive snapshots (can be 0 or non-integer).

axis-presets.pl

Purpose:
This script saves Axis camera presets into a given file. It needs some work since it uses old style of detecting camera URL (by camera number).

GUI:
Not available.

Syntax:
axis-presets.pl [beamline=beamline] [file=presetsFile] [camera=camera]

beamline=beamline
Beamline specification. Possible values are 23i, 23o, or 23b. The default is current beamline.
file=presetsFile
Specifies filename for saving presets. The default is e.g. 23o_camera2.txt.
camera=camera
Specifies camera number from 1 to 4. In the old notation 1 was Hires, and 2 was LoRes and 3 was Hutch camera.

axis-snapshot.pl
 

Purpose:
This script makes a dated one-time snapshot of beamline video cameras. Images are saved in 2 places: for USER and for GMCA. There is no option to convert JPEG to other image formats.

GUI:
The GUI call is available through the TOOLS menu on EPICS toolbar.

Syntax:
axis-snapshot.pl [beamline] [HighRes|HiRes] [LowRes|LoRes] [Hutch] [display]

beamline
Beamline specification. Possible values are 23i, 23o, or 23b. The default is current beamline.
HighRes|HiRes
Requests snapshot for Hi-Res camera.
LowRes|LoRes
Requests snapshot for Low-Res camera.
Hutch
Requests snapshot for Hutch camera. If none cameras are specified, all available are processed.
display
Requests displaying snapshots with eog program.

If none cameras are specified, both HiRes and LowRes are processed. The images are saved in the "axis_snapshots" subdirectory. The filenames are formed as "cameraname_username_datestamp.jpg".


axis-snapshot_v4.pl
 

Purpose:
This script makes a dated one-time snapshot of beamline video cameras. Images are saved in current working directory and can be requested in various formats.

GUI:
The GUI call is available through the TOOLS menu on EPICS toolbar.

Syntax:
axis-snapshot_v4.pl [beamline] [snapFile] [camera(s)] [display] [noninteractive]

beamline
Beamline specification. Possible values are 23i, 23o, or 23b. The default is current beamline.
snapFile
Specifies snap file name nd extension. The extension defines image type (TIF, PNG, BMP). If no extension is given, JPG is used. If no snapfile is specified, the default is "snap_datestamp.jpg". When multiple cameras are requested, the camera name is automatically appended to the filename.
camera(s)
Specifies camera name (HiRes, LoRes or Hutch). Multiple cameras are allowed.
display
Requests displaying snapshots with eog program.
noninteractive
Requests the script to bypass any interaction with user (for batch or GUI calls).

backupLIA.pl

Purpose:
Backup lock-in amplifier settings to a file.

GUI:
This script is called from the Tools section of the EPICS toolbar.

Syntax:
backupLIA.pl snapFile.lia [beamline]

snapFile.lia
Name for backup file (should have .lia extension)
beamline
Beamline specification. Possible values are 23i, 23o, or 23b. The default is current beamline.

beamBack.pl
 

Purpose:
This script sends SMS to user's mobile phone when the beam is back.

GUI:
This script is a GUI.

Syntax:
beamBack.pl

After the GUI is launched, user needs to specify his/her cell phone number and cell phone carrier. The script relies on the carrier's email to SMS service. That means, cell phone carriers assign e-mail addresses to each phone they server. For example, with phone number (630)124-4567 the e-mail address will be 6301244567@txt.att.net if the number is served by AT&T, or 6301244567@vtext.com if the number is served by Verizon, or 6301244567@tmomail.net if the number is served by T-Mobile. The success is dependent on the reliability of the service and user not having SMS to his/hr phone blocked.


bigEnergyMove.pl

Purpose:
This script tunes beamline energy to the requested value. The Insertion Device (ID), if present, is tuned too with the offset interpolated according to mySQL data. If the energy change exceeds 0.5KeV, then mirror lanes and ID harmonic can be switched as needed. Respective thresholds are taken from mySQL. Finally beam optimization script (alignMiniBeam.pl) is called if the energy change involves Bragg angle change by more than 1 degree.
Execution steps:

  1. Note beam attenuation.
  2. Read mySQL data on energy thresholds for mirrors lanes and ID harmonics.
  3. Check pin sensor on the goniometer and if beam optimization is planned, request it to be removed by user.
  4. If any change besides energy or beam optimization is planned, disable beamline feedback(s). This applies to both intensity and positional feedback.
  5. Initiate changing mirrors lanes, if needed.
  6. Run mono and ID (unless disabled) to new energy; also change ID harmonic as needed.
  7. Wait for mirrors to position at new lanes and disable their motions.
  8. Restore beamline feedbacks (turn them ON if initially they were ON). Wait for feedback(s) to lock.
  9. Perform beam optimization if the Bragg angle change was more than 1degr. or mirrors lanes or undulator harmonic were changed.

GUI:
The script is called by JBluIce.

Syntax:
bigEnergyMove.pl RqsEnergy [beamline] [bigEnergyChangeThresholdKeV=xx] [noID] [noSync|multiStep[=nnn]|IDsteps|IDscan] [recoveryTime=xx|auto] [noAlign|autoAlign|forceAlign] [dThetaAutoAlign=xx] [alignWithKBM|alignWithCRL|alignWithTF] [TFshiftAutoAlign=xx] [TFmisalignmentAngleH=xx] [noHFM|useHFM] [noVFM|useVFM] [noHDM|useHDM] [noMirrors|useMirrors] [noshiftCRL|shiftCRL=calc|SQLabs|SQLrel|none] [noTransfocator|useTransfocator] [ignoreSample|warnSample|moveSample=xx[h|v]|moveSampleNoWarn=xx[h|v]] [keepShutter|closeShutter|openShutter] [bluice|nobluice] [medm|nomedm] [gnuplot|gnuplot=image|nognuplot]

RqsEnergy
Requested new energy in KeV.
beamline
Beamline specification. Possible values are 23i, 23o, or 23b. The default is current beamline.
bigEnergyChangeThresholdKeV=xx
The criterion for simple energy change vs advanced. If energy change exceeds this threshold, the script will consider changing harmonics and mirror lanes as needed. The default is 0.5KeV. The maximum is 2KeV and the minimum is 0.
noID
Requests skipping work with the Insertion Device.
noSync|multiStep[=nnn]|IDsteps|IDscan
Requests mono and ID synchronization during energy change. When intensity feedback is in hardware mode and 'honorLockin' is selected, the default is "multiStep" with 0.25 KeV steps; otherwise the default mode is 'noSync'. In the 'IDscan' mode the script uses synchronous scanning capability of ID device.
recoveryTime=xx|auto
Requests the script to sleep after big energy changes before aligning the beam. The default is no sleeping. In the auto mode the sleep is proportional to the Bragg angle change and it is about 150s for going between 12KeV and 6KeV.
noAlign|autoAlign|forceAligh
Controls beam alignment after energy change. The default is autoAign, i.e. align if the Bragg angle change exceeds 1 degr. (or dThetaAutoAlign).
dThetaAutoAlign
The Bragg angle change threshold for the autoAlign option. The default is 1 degr.
TFshiftAutoAlign
The CRL box or Transfocator shift threshold for the autoAlign option. The default is 2mm.
TFmisalignmentAngleH=xx
The misalignment angle in radians of transfocator optical axis and transfocator up/downstream motion axis. Default is 0.
alignWithKBM|alignWithCRL|alignWithTF
Align the beam by scanning KBM piezos (default) or CRL position, or Transfocator position (a flag for alignMiniBeam.pl)
noHFM|useHFM
Enable (default) or disable lane changes in HFM.
noVFM|useVFM
Enable (default) or disable lane changes in VFM.
noHDM|useHDM
Enable (default) or disable lane changes in HDM (if present).
noMirrors|useMirrors
Enable (default) or disable analyzing lanes in all mirrors (can be overwritten for individual mirrors).
noshiftCRL|shiftCRL=calc|SQLabs|SQLrel|none
Shift CRL upstream or downstream to compensate for focus change or not (ignore); "calc" is to use calculated focus change, "SQLabs" is to move CRL to SQL data for new energy, "SQLrel" is to shift focus by difference in SQL data at new and old energies.
noTransfocator|useTransfocator
Use or not Transfocator for refocusing
ignoreSample|warnSample|moveSample=xx[h|v]|moveSampleNoWarn=xx[h|v]
Warn that sample is mounted or warn & shift or shift without warning. Default is warn. If shift is requested, default shift direction is UP for positive xx (in mm) or DOWN with negative xx. If xx is followed by "h", the shift direction is OUTBOARD (positive) or INBOARD (negative).
keepShutter|closeShutter|openShutter
Instructs the script what to do with fast shutter during energy change. The default is to close the fast shutter.
bluice|nobluice
Requests sending messages to JBluIce logs and doing popups via JBluIce or not. The default is no JBluIce reporting.
medm|nomedm
Requests opening scan MEDM screen for on-the-fly scans (parameter passes to alignMiniBeam). The default is yes unless 'bluice' is specified.
gnuplot|gnuplot=image|nognuplot
Requests plotting scan data with Gnuplot (parameter passes to alignMiniBeam). The default is yes unless 'bluice' is specified. If gnuplot=image is selected, the plot is also saved as an image file.

burnProbe.pl

Purpose:
This script provides data collection for microbeam burn-and-probe experiments. It 'burns' the central spot and then shifts the sample left-right and up-down by dx and dy steps respectively and collects diffraction frames to probe for radiation damage. This operation repeats 'probes' times. The frames are collected using the Frame Processing Engine.

GUI:
Not available.

Syntax:
burnProbe.pl [beamline] [prefix=..] [dx=[+-]..] [dy=[+-]..] [burns=Nburns] [probes=Nprobes] [burnexposure=..] [burndelta=..] [focus=stepfocus:nfocus]

beamline
Beamline specification. Possible values are 23i, 23o, or 23b. The default is current beamline.
prefix=..
Specifies prefix for saving data. The probe files will be named as "prefix_l(r,d,u)dx(dy).probeNo" () and burn files as "prefix_burn.probeNo.burnNo". Here dx(dy) are the values of respective shifts. If line focus is simulated (see the focus option), the burn files are named as "prefix_burn_focusoffset_No.probeNo.burnNo".
dx=[+-]..
Specifies horizontal steps off the burn point to do probing. If +- steps are specified, the probes are taken at both sides. At least dx= or dy= must be specified.
dy=[+-]..
Specifies vertical steps off the burn point to do probing. If +- steps are specified, the probes are taken at both sides. At least dx= or dy= must be specified.
burns=Nburns
Specifies the number of burn shots for each probe.
probes=Nprobes
Specifies the number of probes (how many times the whole experiment is repeated.)
burnexposure=..
Specifies burn exposure in seconds (must be between 0.1s and 60s). By default (i.e. if not specified) burn exposure equals probe exposure. The later is entered on the FPE MEDM screen.
burndelta=..
Specifies burn frame delta in degrees (must be between 0 and 20degr.). By default (i.e. if not specified) burn delta equals probe delta. The later is entered on the FPE MEDM screen.
focus=stepfocus:nfocus
Species vertical shift and step of burn points to simulate line focus. nfocus must be odd since central burn is taken and (nfocus-1) burns are taken in the up and down directions. Not compatible with dy=.

calibrateFoils.pl

Purpose:
This is a script for calibrating attenuation foils. It implements the following actions:

  1. Closes the shutter and measures scaler darks at all keithley gains.
  2. Measures I0 at no attenuation with proper keithley gain.
  3. Measures I0 after throwing in one foil at a time with proper keithley gain.
  4. Calculates foil thickness.
  5. If multiple energies are specified, avarages data taken at different energies and checks for alternative foil material

GUI:
Not available.

Syntax:
calibrateFoils.pl [beamline] [file=filename] [energy=E1,E2,...] [include=F1,F2,...] [exclude=F1,F2,...] [signal=I0|Pin|Beamstop] [normalizerInput=n|SRcurrent] [counting=seconds] [measureDarks|useExistingDarks|darksAuto]

beamline
Beamline specification. Possible values are 23i, 23o, or 23b. The default is current beamline.
file=filename
Specifies output file name. The default name is auto-generated with current date.
energy=E1,E2,...
Specifies at what energies to do the measurements. The default is current energy.
include=F1,F2,...
Specifies what foils to include. The default is all.
exclude=F1,F2,...
Specifies what foils to exclude. The default is none.
signal=I0|Pin|Beamstop
Specifies input channel for measuring intensity (mySQL naming). The default is I0.
normalizerInput=n|SRcurrent
Scaler input for intensity normalizer. The default is "9", the input for DCM-VSUM.
counting=seconds
Specifies scaler counting time in seconds. The default is 1s.
measureDarks|useExistingDarks|darksAuto
Specifies darks measuring option. The default is auto: measure darks if they are older than 2 hours.

calibrateMono.pl
 

Purpose:
This script calibrates monochromator energy offset. It is based on a fast hardware-synchronized scan of monochromator with an optional sync-scan of undulator (currently turned off). The scan is done around an absorption edge of a foil. Then, the script calculates the first derivative of intensity around the edge and calculates the edge position. At the end the script displays the plot showing the deviation of the edge from the tabulated value and asks the user if he/she wants to correct the monochromator calibration offset parameter to bring the edge to the tabulated position.

GUI:
The GUI frontend calibrateMono.tcl is available through the MOTION menu on EPICS toolbar.

Syntax:
calibrateMono.pl Edge i1=nn [i0=nn] [fluorescence|transmission] [beamline=...] [gnuplot|gnuplot=image|nognuplot] [medm|nomedm] [autoset] [ignoremostab|skipFeedback|pausemostab|pauseFeedback] [speedFactor=xx] [idOffset=xxeV|current|mySQL|skipID|noID] [foilIn=xx|none|bpm] [cutEnds=xx] [nostartasking] [GUImode] [recoveryTime=xx] [useCAEN|noCAEN]

Edge
Specifies absorption edge, e.g. 'Au-L3'.
i1=nn
Specifies Struck scaler input for measuring intensity after the foil.
i0=nn
Specifies Struck scaler input for I0 (for normalizing intensity after the mono. If the input is not specified, intensity is not normalized.
fluorescence|transmission
Specifies whether measured intensity is fluorescence or transmition. The two sources produce vertically mirrored plots. The default is transmission.
beamline=...
Beamline specification. Possible values are 23i, 23o, or 23b. The default is current beamline.
gnuplot|gnuplot=image|nognuplot
Turns on/off plotting. The default is "on". If gnuplot=image is selected, the plot is also saved as an image file.
medm|nomedm
Turns on/off MEDM display of scan.
autoset
Requests automatic mono calibration correction (no user prompt).
ignoremostab|skipFeedback|pausemostab|pauseFeedback
Requests pausing/restoring or ignoring beamline intensity feedback.
speedFactor=xx
Specifies speed at which the scan can run as a share of maximum monochromator gonio speed. The default is 0.2. Increasing speed may save time, but reduce accuracy.
idOffset=xxeV|current|mySQL|skipID|noID
Specifies ID offset with respect to mono. The default is to take the ID offset data from MySQL. Unless ID is scanned with the mono (currently off), the ID preset at the higher end of scan interval plus idOffset.
foilIn=xx|none|bpm
Specifies digital I/O channel bringing the foil IN/OUT. If "none" is selected, the foil is assumed to be in the beam. If "bpm" is selected, the script brings into the beam a foil mounted on mono BPM. Also, in this case the white beam slits are closed to 0.5mm x 0.5mm.
cutEnds=xx
Specifies how much data to trim at each end of the scan interval to avoid false derivative spikes from noise at motor start/stop. The default is 20eV.
nostartasking
Skip prompt to continue before proceeding to the scan
GUImode
Use Zenity popups instead of printing to terminal for all essential messages and dialogs
recoveryTime=xx
Waiting time for mono to settle thermo stability after the scan. The default is no waiting.
useCAEN|noCAEN
Use CAEN instead of UDT for i0. In the CAEN mode the i0 input is ignored and the script uses CAEN inputs 5,6,7,8. The default is to use UDT.

canberra_roi2tca.pl

Purpose:
This script converts Canberra MCA ROI to Canberra TCA discrimination.

GUI:
Not available.

Syntax:
canberra_roi2tca.pl [beamline] [medm] [reset]

beamline=...
Beamline specification. Possible values are 23i, 23o, or 23b. The default is current beamline.
medm
Instructs the script to open the MCA and TCA MEDM screens.
reset
Instructs the script to reset the TCA to full range (from 5% to 100%).

canberra_roi2tca2.pl

Purpose:
This script converts Canberra MCA ROI to Canberra TCA discrimination. Unlike the canberra_roi2tca.pl script, this is a minimum version without command line parameters.

GUI:
Not available.

Syntax:
canberra_roi2tca2.pl


centerMirror_v1.pl

Purpose:
This is a mirror centering script based on FAST scan record scan. It implements the following actions:

  1. Moves mirror out of the beam (up or down).
  2. Reads I0.
  3. Runs fast scan on mirror position until it touches the beam.
  4. Runs two fast scans on mirror angle in both directions to find I0/2.
  5. Runs mirror to the determined center angle where it is parallel to the beam.
  6. Runs fast scan on mirror position until it gives I0/2.
  7. Repeats two fast scans on mirror angle in both directions to find I0/4.
  8. Runs the mirror to the determined center angle.

GUI:
Not available.

Syntax:
centerMirror_v1.pl mirrorAssembly [Struck|Joerger] input [positionPV=...] [anglePV=...] [outOfBeamDirection=positive|negative] [positionScanLowLimit=...] [positionScanHighLimit=...] {angleScanLimit=...] [positionScanStep=...] {angleScanStep=...] [speedFactor=...] [touchingI0=...] [showMedm|noMedm] [useShutter|noShutter] [beamline=...]

mirrorAssembly
Specifies mirror assembly, e.g. 23n:KB:Hy, 23n:KB:Vz, 23n:HD:Up 23n:HD:Dn.
Struck|Joerger
Specifies Struck or Joerger scaler to be used for measuring intensity. The default is 'struck'.
input
Specifies scaler input for measuring intensity.
positionPV and anglePV
Specifies Mirror Position and Angle axes PVs (overwrites defaults)
outOfBeamDirection
Specifies in what Mirror Position direction (positive|negative) the mirror is moved out of the beam PVs (overwrites defaults)
positionScanLowLimit and positionScanHighLimit
Specifies scan limits for mirror Position (overwrites defaults)
angleScanLimit
Specifies scan limit for mirror Angle (overwrites defaults)
positionScanStep
Specifies Position scan step (overwrites defaults)
angleScanStep
Specifies Angle scan step (overwrites defaults)
speedFactor
Specifies scan speed as a share of the maximum speed (default=maximum=1)
touching
Specifies the intensity level when the mirror should be considered "touching" the beam (default=0.8)
showMedm|noMedm
Instructs the script to popup MEDM screens to watch the scans progress (default=showMedm)
useShutter|noShutter
Specifies if fast shutter should be used during operations (default=useShutter)
beamline
Allows to specify alternative beamline and thus run the script cross beamlines

centerMirror_v2.pl

Purpose:
This is another mirror centering script based on FAST scan record scan. Compared to v.1, it implements an alternative centering algorithm per Derek's suggestion:

  1. Sets mirror to the Silicon lane
  2. Reads current beam energy
  3. Sets mirror angle roughly (since we do not know it!) to twice critical angle in order to ensure there is no reflected beam.
  4. Moves mirror out of the beam (up or down)
  5. Reads I0
  6. Runs fast scan on mirror position until it intersects 50% of the beam
  7. Moves mirror angle to expected angle=0.
  8. Scans mirror from angle=0 to negative angle until it gives 50% of the beam again.
  9. Determines the middle between the above two angles as zero angle.
  10. Runs mirror to the determined center angle where it is parallel to the beam
  11. Runs fast scan on mirror position until it gives I0/2

GUI:
Not available.

Syntax:
centerMirror_v2.pl mirrorAssembly [Struck|Joerger] input [positionPV=...] [anglePV=...] [outOfBeamDirection=positive|negative] [positionScanLowLimit=...] [positionScanHighLimit=...] {angleScanLimit=...] [positionScanStep=...] {angleScanStep=...] [speedFactor=...] [showMedm|noMedm] [useShutter|noShutter] [beamline=...]

mirrorAssembly
Specifies mirror assembly, e.g. 23n:KB:Hy, 23n:KB:Vz, 23n:HD:Up 23n:HD:Dn.
Struck|Joerger
Specifies Struck or Joerger scaler to be used for measuring intensity. The default is 'struck'.
input
Specifies scaler input for measuring intensity.
positionPV and anglePV
Specifies Mirror Position and Angle axes PVs (overwrites defaults)
outOfBeamDirection
Specifies in what Mirror Position direction (positive|negative) the mirror is moved out of the beam PVs (overwrites defaults)
positionScanLowLimit and positionScanHighLimit
Specifies scan limits for mirror Position (overwrites defaults)
angleScanLimit
Specifies scan limit for mirror Angle (overwrites defaults)
positionScanStep
Specifies Position scan step (overwrites defaults)
angleScanStep
Specifies Angle scan step (overwrites defaults)
speedFactor
Specifies scan speed as a share of the maximum speed (default=maximum=1)
showMedm|noMedm
Instructs the script to popup MEDM screens to watch the scans progress (default=showMedm)
useShutter|noShutter
Specifies if fast shutter should be used during operations (default=useShutter)
beamline
Allows to specify alternative beamline and thus run the script cross beamlines

centerMirror_v3.pl
 

Purpose:
This is another mirror centering script based on FAST scan record scan. It centers either vertical or horizontal KBM based on a rectangular reflected intensity profile when the mirror is scanned through a narrow beam:

  1. Closes respective monochromatic beam slit to about 0.1mm
  2. Uses GS BPM for detection
  3. Removes all attenuation
  4. Adjust the Keithley gain on respective GS BPM to get the intensity readings in the linear range
  5. Sets mirror angle to 3mrad
  6. Scans mirror position +-2mm from the current position
  7. One expects a step profile spanning the footprint of the mirror which will be length of the mirror times the mirror angle
  8. Sets mirror position to the centre
  9. Restores mirror angle, attenuation, monochromatic beam slits size, and Keithley gain on GS BPM

GUI:
The script can be called for both HFM and VFM ftom the TOOLS menu on EPICS toolbar.

Syntax:
centerMirror_v3.pl mirrorAssembly HFM|VFM [signal=...] [scanHalfRange=...] [scanPts=...] [speedFactor=...] [showMedm|noMedm] [useShutter|noShutter] [beamline=...]

HFM|VFM
Specifies the mirror to center
signal
Refers to the GS BPM registration channel (scaler input, Keithley, and etc.): usually Top, Bottom, In, or Out
scanHalfRange
Specifies scan limits for mirror Position, i.e. +-scanHalfRange from the initial position (overwrites defaults)
scanPts
Specifies number of scan points (overwrites defaults, should not exceed scan record capacity of 2000)
speedFactor
Specifies scan speed as a share of the maximum speed (default=maximum=1)
showMedm|noMedm
Instructs the script to popup MEDM screens to watch the scans progress (default=showMedm)
useShutter|noShutter
Specifies if fast shutter should be used during operations (default=useShutter)
beamline
Allows to specify alternative beamline and thus run the script cross beamlines

centerSlits.pl

Purpose:
This is a generic slits centering script based on FAST scan record scan. It implements the following algorithm:

  1. Closes the slits to 'closedSize'.
  2. Runs fast scan on slits center in the [-centerScanLimit,centerScanlimit] range.
  3. Analyzes the scan data to find the peak of intensity (by FWHM).
  4. Moves slits center to the determined peak position.
  5. Opens slits to maximum.
  6. Measures I0.
  7. Runs fast scan on slits size until I0 drops to I0 * 'touching'.

GUI:
Not available.

Syntax:
centerSlits.pl assemblyPV struck|joerger inputNr [centerPV=...] [sizePV=...] [centerScanLimit=...] {scanStep=...] [speedFactor=...] [closedSize=...] [touchingI0=...] [showMedm|noMedm] [useShutter|noShutter] [beamline=...]

assemblyPV
Specifies slits assembly PV, e.g. 23n:GS:Av.
struck|joerger
Specifies Struck or Joerger scaler to be used for measuring intensity.
inputNr
Specifies scaler input for measuring intensity.
centerPV=...
Specifies slits center PV, e.g. 23n:GS:ZC.
sizePV=...
Specifies slits size PV, e.g. 23n:GS:ZS.
centerScanLimit=...
Specifies slits center scan limit (mm): the center will be scanned in the [-centerScanLimit,centerScanlimit] range.
scanStep=...
Specifies scan step (mm) for both center and size scans.
speedFactor=...
Specifies speed at which the scans can run as a share of the maximum speeds. The default is 1. Decreasing speed may improve centering accuracy.
closedSize=...
Specifies the size (mm) to which the slits are closed initially. The default is the lower soft limit of slits size plus 5um.
touchingI0=...
Specifies the intensity drop factor when the slits are considered 'touching' the beam. The allowed range is 0.05 to 0.95 and the default is 0.8.
useShutter|noShutter
Specifies whether to use fast shutter or not. The default is useShutter.
showMedm|noMedm
Requests opening or not MEDM screens of the scans.
beamline=...
Beamline specification. Possible values are 23i, 23o, or 23b. The default is current beamline.

centerSlits_GS.pl
 

Purpose:
This is a slits centering script for guard slits (Huber-type slits, i.e. having individual blades). It is based on a combination of: FAST HD-synchronized scans (individual blades) and FAST ScanRec-synchronized scans (slit size). The script implements the following algorithm:

  1. Fully opens the slit and measure I0.
  2. Scans "jaw1" towards closing until intensity drops to I0/2, then opens it back.
  3. Scans "jaw2" towards closing until intensity drops to I0/2.
  4. Moves the slits center to the middle between the two I0/2 points and the slits size to the maximum opening.
  5. Closes the slits size until the intensity drops to touching*I0 (the 'touching' parameter can be specified)
  6. Optionally can re-calibrate slit width by symmetrically changing offsets on both jaws

GUI:
The script can be called through the TOOLS menu on EPICS toolbar.

Syntax:
centerSlits_GS.pl slit=V|H [beamline] [slight] [touching=xxx] [fast] [noStartAsking] [useShutter|noShutter] [calibrateSize=skip|warn|ask|auto]

slit=V|H
Specifies centering of vertical or horizontal slit.
beamline
Specifies beamline. Possible values are 23i, 23o, or 23b. The default is current beamline.
slight
Requests initial slits opening slightly bigger than the beamsize instead of running to the full-open limits. Currently 3mm slit size is hardcoded.
touching=xxx
Specifies at what part of intensity slits are 'touching'. Must be in 0.1-0.9 range. The default is 0.9.
fast
Request calculation of 'touching' slit size by interpolating data from scanning individual blades instead of doing an extra slit closing scan at the end.
noStartAsking
Skip confirmation to continue at start
useShutter|noShutter
Specifies whether to use fast shutter or not. The default is useShutter.
calibrateSize=skip|warn|ask|auto
Specifies slit width calibration mode. Skip: do nothing; Warn: raise popup and skip; Ask: raise popup with the question; auto: run automatically without popup (risky!). The calibration is considered needed when the measured slit size is off by more than 2 scan steps, which is currently 8 micron.

Some parameters are currently hardcoded:

stepH=0.004mm
Step on Horizontal GS slits fast scans
stepV=0.004mm
Step on Vertical GS slits fast scans
speedFactor=1.
Share of maximum speed during fast scans (0:1)
input=18
Struck input for intensity monitoring (normally for I0)
touching=0.75
At what fraction of beam intensity slits are considered 'touching' the beam
showMedm=yes
Show or not scan MEDM screen
optimizeGain=yes
Optimize keithley gain on I0 before scanning or not.

centerSlits_MB.pl
 

Purpose:
This is a slits centering script for monochromatic beam (Piggy-back type) slits. It is based on FAST scan record scan and implements the following algorithm:

  1. Fully opens the slit and measures I0.
  2. Scans slit center in '+' direction until intensity drops to I0/2.
  3. Scans slit center in '-' direction until intensity drops to I0/2.
  4. Moves slit center to the middle between the two I0/2 points.
  5. Closes slit size until I0 drops to touching*I0 (the 'touching' parameter is hardcoded).

GUI:
The script can be called through the TOOLS menu on EPICS toolbar.

Syntax:
centerSlits_MB.pl slit=V|H [beamline] [input=NNN] [speed=XXX] [touching=XXX] [step=XXX] [useShutter|noShutter] [noStartAsking]

slit=V|H
Specifies centering of vertical or horizontal slit.
beamline
Specifies beamline. Possible values are 23i, 23o, or 23b. The default is current beamline.
input=NNN
Specifies scaler input for intensity monitoring (normally for BPM-sum after the slits). The default is 20.
speed=XXX
Specifies share of maximum speed during fast scans [0:1]. The default is 1.
touching=XXX
Specifies the intensity drop factor when the slits are considered 'touching' the beam. The allowed range is 0.1 to 0.9 and the default is 0.8.
step=XXX
Specifies scan step in mm. The default is 0.03mm for vertical scans and 0.05mm for horizontal scans.
noStartAsking
Skip confirmation to continue at start
useShutter|noShutter
Specifies whether to use fast shutter or not. The default is noShutter.

centerSlits_WB.pl
 

Purpose:
This is a slits centering script for OLD-STYLE (before 2020) white beam (Huber-type) slits. It is based on FAST scan record scan and implements the following algorithm:

  1. Fully opens the slit and measures I0.
  2. Scans jaw1 towards closing until intensity drops to I0/2, then opens it back.
  3. Scans jaw2 towards closing until intensity drops to I0/2.
  4. Moves slits center to the middle between the two I0/2 points and size to max opening.
  5. Closes slits size until I0 drops to touching*I0 (unless instructed to keep or set slit size).

GUI:
The script can be called through the TOOLS menu on EPICS toolbar and through user_setup3.pl.

Syntax:
centerSlits_WB.pl slit=V|H [beamline] [input=NNN] [speed=XXX] [touching=XXX|XXXmm|memory|initial] [step=XXX] [ignoremostab|skipFeedback|pausemostab|pauseFeedback] [showSteeringOnly] [noStartAsking] [useShutter|noShutter]

slit=V|H
Specifies centering of vertical or horizontal slit.
beamline
Specifies beamline. Possible values are 23i, 23o, or 23b. The default is current beamline.
input=NNN
Specifies scaler input for intensity monitoring. The default is 9.
speed=XXX
Specifies share of maximum speed during fast scans [0:1]. The default is 1.
touching=XXX|XXXmm|memory|initial
Specifies the intensity drop factor when the slits are considered 'touching' the beam. The allowed range is 0.1 to 0.9 and the default is 0.8. If the value is given in mm, the script closes the slit to specified value. If touching=memory, the final size is taken from the MemPos PV. If touching=initial, at the end the slit is closed to the initial size.
step=XXX
Specifies scan step in mm. The default is 0.03mm for vertical scans and 0.05mm for horizontal scans.
ignoremostab|skipFeedback|pausemostab|pauseFeedback
pause monoStabilizer if running or not. The default is "pauseMostab" (pauseFeedback).
showSteeringOnly
Instruct the script to preserve slits center and olny show needed steering; also the slit size is not measureds or changed.
noStartAsking
Skip confirmation to continue at start
useShutter|noShutter
Specifies whether to use fast shutter or not. The default is noShutter.

Some parameters are currently hardcoded:

scaler=Struck
Scaler options are 1=Struck, 3=Joerger.
showMedm=yes
Show or not scan MEDM screen.

centerSlits_WB2.pl
 

Purpose:
This is a slits centering script for the 2020 APS-design white beam slits. It is based on FAST scan record scan and implements the following algorithm:

  1. Closes slit to a small closedSize.
  2. Scans the slit from limit to limit and fits data with Gaussian or optionally fully opens the slit, measures I0, and then drives each jaw until intensity drops by half.
  3. Drives the slit to the center found with Gaussian fit
  4. Fully opens the slit and measures I0.
  5. Closes slits size until I0 drops to touching*I0 (unless instructed to keep or set slit size).
  6. Optionally requests beam steering

GUI:
The script can be called through the TOOLS menu on EPICS toolbar or through user_setup3.pl.

Syntax:
centerSlits_WB.pl slit=V|H [beamline] [input=NNN] [speedFactor=XXX] [touching=XXX|XXXmm|memory|initial] [step=XXX] [closedSize=XXX] [centerScanLimit=XXX] [ignoremostab|skipFeedback|pausemostab|pauseFeedback] [showSteeringOnly] [noStartAsking] [useShutter|noShutter] [medm|nomedm] [gnuplot|gnuplot=image|nognuplot] [GUImode|noGUI] [searchMode=fullscan|I0/2] [directory=dirname4savingGnuPlots]

slit=V|H
Specifies centering of vertical or horizontal slit.
beamline
Specifies beamline. Possible values are 23i, 23o, or 23b. The default is current beamline.
input=NNN
Specifies scaler input for intensity monitoring. The default is 9.
speedFactor=XXX
Specifies share of maximum speed during fast scans [0:1]. The default is 1.
touching=XXX|XXXmm|memory|initial
Specifies the intensity drop factor when the slits are considered 'touching' the beam. The allowed range is 0.1 to 0.9 and the default is 0.8. If the value is given in mm, the script closes the slit to specified value. If touching=memory, the final size is taken from the MemPos PV. If touching=initial, at the end the slit is closed to the initial size.
step=XXX
Specifies scan step in mm. The default is 0.03mm for vertical scans and 0.05mm for horizontal scans.
closedSize=XXX
Small size for center scans. Default is 0.1 mm.
centerScanLimit=XXX
+- range for center scans. Default is DRVH.
ignoremostab|skipFeedback|pausemostab|pauseFeedback
pause monoStabilizer if running or not. The default is "pauseMostab" (pauseFeedback).
showSteeringOnly
Instruct the script to preserve slits center and olny show needed steering; also the slit size is not measureds or changed.
noStartAsking
Skip confirmation to continue at start
useShutter|noShutter
Specifies whether to use fast shutter or not. The default is noShutter.
medm|nomedm
Show medm screens or not. Default is to show.
gnuplot|gnuplot=image|nognuplot
Gnuplot option for Gaussian fits. Default is no GnuPlot.
GUImode|noGUI
Prompt mode (GUI or text) for printing GnuPlot. Default is GUI.
searchMode=fullscan|I0/2
Center scan mode: wide range (default) or close jaws to I0/2
directory=dirname4savingGnuPlots
Directory where to save plots if gnuplot=image. Default is current dir.

Some parameters are currently hardcoded:

scaler=Struck
Scaler options are 1=Struck, 3=Joerger.
showMedm=yes
Show or not scan MEDM screen.

changeBeamlineUser.pl
 

Purpose:
This script sets new beamline user and clears all JBluIce data of the previous user. It must be executed on a Linux computer.

GUI:
The script frontend changeBeamlineUser.tcl is called through the TOOLS menu on EPICS toolbar.

Syntax:
changeBeamlineUser.pl [newJBluiceUser] [--force] [--clearRunsOnly|--clearOnly] [--prompt] [--tab0only] [--autodetectNruns][--slow|--fast] [beamline] [--?|--help]

newJBluiceUser
Specifies new JBluIce user. By default script process owner is used.
--force
Forces cleaning JBluIce data even if new JBluIce user is the same as current JBluIce user.
--clearRunsOnly|--clearOnly
Instruct the script to keep old users; just clear the runs.
--prompt
If specified, the script will request confirmation when Tabs may be cleared without changing user.
--tab0only
Requests to clear Tab-0 only.
--autodetectNruns
Requests automatic determination of the number of available collect and raster runs (tabs) by increasing run number until hitting non-existing PV.
--slow|--fast
Selects that PV puts should be grouped for speed (default) or sent individually for reliability.
beamline
Specifes beamline. This program cannot run across beamlines and the beamline parameter is solely for checking.
--?|--help
Prints command line syntax and exits.

checkdetectorconnections.pl

Purpose:
This script checks /var/log/messages on the Pilatus and Eiger control computers for today's failed interfaces between the computer and the detector. It needs to be called via sudo on the Pilatus or Eiger control computers. If not called via sudo, the script attempts to do it on its own.

GUI:
Not available.

Syntax:
checkdetectorconnections.pl


checkGripper.pl

Purpose:
This script checks the Cartesian automounter gripper for deviations from homing. After work is done, gripper position is rerstored. The results are displayed on the screen and also stored in the 23x:RB:Gr:Sync.DESC PV.

GUI:
Not available.

Syntax:
checkGripper.pl [beamline] [popup|nopopup]

beamline
Specifes beamline (23i,23o,23b,23d). The default is current beamline.
[popup|nopopup]
Specifes whether the results should be presented as a popup (default). Disabling popup is intended when calling the script from other software and reading the results back from the 3x:RB:Gr:Sync.DESC PV.

checkMotorsHealth.pl

Purpose:
This script checks all beamline motors for amplifier faults or disabled, hit limits, fatal following errors, not being homed, and etc. The results are displayed in a popup window.

GUI:
The script can be called through the MOTION menu.

Syntax:
checkMotorsHealth.pl [beamline]

beamline
Specifes beamline (23i,23o,23b,23d). The default is current beamline.

chooch_wrapper.pl

Purpose:
This script wraps around the CHOOCH program replacing the CHOOCH dispersion correction plotting capability with that of GnuPlot. The matter is tha CHOOCH uses an obsolete and no longer maintained package "cgraph" to produce plots. The later is incompatible with LDAP users accounts (can only work with /etc/passwd) and therefore crashes CHOOCH (produces core dumps) on LDAP accounts if CHOOCH is called with an option to produce the plots. One way to work around that problem is to use Linux nscd daemon that emulates the old system functions getpwnam and getpwuid working with /etc/password. Another way is to use this wrapper.

GUI:
Not available. The script can be called from JBluIce instead of CHOOCH.

Syntax:
chooch_wrapper.pl element=XX edge=XX data=file

element
Specifies the absorption edge element, e.g. 'element=Se'.
edge=XX
Specifies the absorption edge itself, e.g. 'edge=K'.
data=file
Specifies the scan data file, e.g. 'data=/Data/Se_1G11_chooch.dat'. From that name, the script will construct the '.efs' and '.ps' filenames.

cleanupJBluice.pl

Purpose:
By default, this script cleans up the JBluIce Clients database by erasing all orphan records referring to longer running instances of JBluIce. However, if called with the "forceKill" switch, it also attempts to kill all running versions of JBluIce and then erase their records from the Clients DB. The script relies on passwordless SSH between beamline machines and perl-sudo package used by the killPID.pl script, which it calls in order to kill JBluIce (see below).

GUI:
Not available. The script can be called from the "JBluIce Clients" MEDM screen.

Syntax:
cleanupJBluice.pl [forceKill]

forceKill
requests to kill all running instances of JBluIce on all accessible computers by sending them SIGKILL.

collimatorCtrl.pl
 

Purpose:
This script is called by JBluIce and safely controls sample environment (collimator, pin diode, beamstop, backlight, and ringlight) to avoid collisions and exposing the CCD to direct beam. The script performs the following actions:

  • Normal operation ('IN'):
    1. Closes fast shutter (unless neither collimator nor pin diode is moved).
    2. Puts collimator IN.
    3. Puts backlight out (if requested or conditioned by collision with beamstop).
    4. Flips beamstop IN.
    5. Does nothing to pindiode, but may optionally move pindiode IN or OUT.
    6. Does nothing to ringlight brightness, but may optionally do whatever requested.
    7. Does nothing to backlight brightness, but may optionally do whatever requested.
  • Reverse operation ('OUT'):
    1. Closes fast shutter.
    2. Puts collimator OUT.
    3. Flips beamstop OUT (if requested or conditioned by collision with backlight).
    4. Puts backlight IN.
    5. Does nothing to pindiode, but may optionally move pindiode IN or OUT.
    6. Does nothing to ringlight brightness, but may optionally do whatever requested.
    7. Does nothing to backlight brightness, but may optionally do whatever requested.

GUI:
The script is called from JBluIce and from JBluIce Assistant MEDM screen. Since 2013/06 it is expected to be superseded by sampleEnv.pl that introduces collision matrix and additionally handles SONICC.

Syntax:
collimatorCtrl.pl IN|OUT [beamline] [help|?] [noBeamstop|beamstopOUT] [noBacklight|backlightOUT] [noCollimator] [pindiodeIN|pindiodeOUT] [ringlight=on|ringlight=value|ringlight=off|ringlight=skip] [backlight=on|backlight=value|backlight=off|backlight=skip] [handleGS|skipGS] [bluice|nobluice]

IN|OUT
Specifies operation type (see the script purpose).
help|?
Prints command line syntax.
noBeamstop|beamstopOUT
Specifies options to either skip flipping beamstop or flip beamstop OUT. The default is flip IN for IN operation and flip OUT for OUT operation.
noBacklight|backlightOUT
Specifies options to either skip moving backlight or move backlight OUT. The default is OUT for IN and IN for OUT.
noCollimator
Specifies option to skip moving collimator. The default is IN for IN and OUT for OUT.
pindiodeIN|pindiodeOUT
Specifies options to move pin diode IN or OUT of the beam. The default the pin diode is not moved.
ringlight=on|ringlight=value|ringlight=off|ringlight=skip
Specifies options of changing ring light brightness. When the light is requested OFF, the last ON value is backed up. When the light ON is requested, the backed brightness is used. The value is on the DAC scale. The default is skip changing brightness.
backlight=on|backlight=value|backlight=off|backlight=skip
Specifies options of changing back light brightness. When the light is requested OFF, the last ON value is backed up. When the light ON is requested, the backed brightness is used. The value is on the DAC scale. The default is skip changing brightness.
handleGS|skipGS
Specifies if the guard slits should be opened to a minimum size specified on the JBluIce config MEDM screen when 20um, 10um or 5um collimator is moved IN. The default handle the guard slits, but if the guard slits are wider than those minimum values, they are not touched. Also, they are not touched on collimator OUT operation.
bluice|nobluice
Requests sending messages to JBluIce logs and doing popups via JBluIce or not. The default is to send the messages.

corrOffset.pl

Purpose:
This script corrects 128 count loss on monochromator Bragg axis motor and sends email to Derek. The correction is applied to the mono Bragg axis calibration offset.

GUI:
Not available.

Syntax:
corrOffset.pl

The script asks for confirmation before proceeding with the change.


displayer.pl

Purpose:
This script displayes passed text in a scrollable window (similar to Zenity). It was originally created for user_setup3.pl to display non-blocking popup dialogs, but can have a wider usage. The text can be multi-line, but cannot contain special characters, especially the quote symbol (").

GUI:
The script is a GUI.

Syntax:
displayer.pl "text" ["title_of_window_to_close_on_closing_displayer"] ["displayer_window_title"]

"text"
Specifiers text to display. If the text is multi-line or contains spaces, it needs to be placed in "..".
"title_of_window_to_close_on_closing_displayer"
Optionally specifiers a title of another window to close once user presses OK and the dialog closes. This uses the X11 "wmctrl" utility and hence works on Linux only. If the title contains spaces, it needs to be placed in "..". If the title is specified as "none" or not specified, no window is closed.
"displayer_window_title"
Optionally specifies the displayer window title.

edgeScan.pl

Purpose:
This script implements three-band on-the-fly energy scan with fluorescence detector. (the scan over energy by moving mono and undulator). It supports multiple options of working with fluorescence detector and multiple algorithms of scanning (hardware-synchronized on-the-fly scans, scan record table scans, internal step scans, and etc) and the adaptive scanning option (automatic shift of scan interval based on the first coarse run). Scan ranges, edge energies and fluorescent peak energies are taken from JBluIce mySQL table. The details of this program are described in Stepanov et.al. J. Appl. Crystallogr., v.44, No 4, p.772-778 (2011).

GUI:
The script is called from JBluIce.

Syntax:
edgeScan.pl.pl Element-Edge [beamline] [i0=name|none] [flu=nn|struckFlu=nn] [count=N] [mca=optimize|ready|auto] [logfile|nologfile] [gnuplot|nognuplot] [medm|nomedm] [chooch|nochooch] [moveID|noID] [bluice|nobluice] [fileroot=name] [scan=step|scanrecTBL|scanrecTBLdiscr|fly|auto] [fake|nofake] [gotoEdge|gotoEdgeSmall|gotoEdgeNone] [edgeShift=none/adaptive/user] [edgeShiftMax=value(eV)] [pauseFeedback|ignoreFeedback] [[no]waitFeedBackrestore] [bringPinDiode|bringBeamStop]

Element-Edge
Specifies absorption edge, e.g. 'Se-K'.
beamline
Beamline specification. Possible values are 23i, 23o, or 23b. The default is current beamline.
i0=name|none
Specifies name of intensity channel used for normalizing fluorescence yield to incident intensity; normally 'I0' (default). If 'none' is specified, the fluorescence is not normalized to incident intensity.
flu=nn|struckFlu=nn
Specifies struck input for fluorescence (used in fast scans only). The two keywords are synonyms. The default is 24.
count=N
Specifies count time per scan point in seconds; expected value should be in [0.1:30] range. The default is 2s.
mca=optimize|ready|auto
Specifies option to optimize MCA Region Of Interest (ROI) for tabulated fluorescence peak before starting the scan. In the auto mode MCA is optimized if it has no ROI set (NOTE: there might be a risk of using old irrelevant ROI).
logfile|nologfile
Requests writing scan log into fileroot.log.
gnuplot|nognuplot
Requests plotting scan data with GnuPlot.
medm|nomedm
Requests showing scan progress MEDM screens (for hardware-synchronized and scan record scans only).
chooch|nochooch
Requests calling Chooch for analyzing data after scan.
moveID|noID
Requests moving ID to the upper scan range plus respective ID-to-mono offset before starting the scan. During the scans ID is not moving.
bluice|nobluice
Request sending log messages, popups and scan data to JBluIce. Scan data is sent via EPICS array while the scan is progressing.
fileroot=name
Specifies root name for all scan files (.dat, .ps, .log). The default is Element-Edge_YYYY-MM-DD_hh-mm
scan=step|scanrecTBL|scanrecTBLdiscr|fly|auto
Specifies scan type. Step scans are done internally. In the scanrecTBL mode the scan is controlled by EPICS scan record, which reads fluorescence yield data from MCA, which provides integral over the ROI. In the scanrecTBLdiscr mode the scan is controlled by EPICS scan record, which reads fluorescence yield data from Struck scaler counting data from the fluorescence discriminator set according to the ROI and Derek's calibration of ROI to discrimination. In the fly mode the scan runs in the on-the-fly hardware-synchronized mode reading fluorescence from the Struck as in the scanrecTBLdiscr mode. In the auto mode the scan chooses scanrecTBLdiscr if the count time per point exceeds 1.67s (the Struck restriction); otherwise the fly mode is chosen.
fake|nofake
Requests to produce simulated scan data (for JBluIce debugging).
gotoEdge|gotoEdgeSmall|gotoEdgeNone
Requests to tune beamline to the absorption edge before the scan. The default ia gotoEdge, when bigEnergyMove.pl is called with possible change of mirrors lanes, undulator harmonic and beam alignment. In the gotoEdgeSmall mode only monochromator and the ID are moved. in the gotoEdgeNone mode this step is skipped.
edgeShift=none/adaptive/user
Specifies how to center the scan interval around the theoretical edge. In the 'none' mode the interval is centered around the theoretical absorption edge. In the adaptive mode the edge position is roughly determined from the course scan. In the 'user' mode the edge energy entered by user in JBluIce is used (actually that is 23n:bi:SCAN:scanCenter PV). The default is 'none'.
edgeShiftMax=value(eV)
Specifies the maximum allowed chemical shift of the edge from a tabulated value. The default is 20eV.
pauseFeedback|ignoreFeedback
Request to pause beamline intensity feedback during the scan.
[no]waitFeedBackrestore
Wait or no till feedback is restored at the end. The default is wait.
bringPinDiode|bringBeamStop
Requests to bring beamstop or pindiode IN using sample environment service. The default is to bring IN beamstop.

eigerfix.pl
 

Purpose:
Provide various fixes to communication with EIGER detector when it fails. The most common use is to press the "Fix Eiger" button which initiates a sequence of actions. The buttons below are individual steps. FPE must be stopped during the script operation. If the script does not help, additional steps not included into the script are power-cycling the EIGER detector and rebooting the DCU computer (the EIGER control computer). DCU can be rebooted via the web interface or by login to DCU as "gmca". You will need to rerun the script after that.

GUI:
The script is a GUI by itself. It is available through the TOOLS menu on EPICS toolbar in the JBluIce Configuration -> JBluIce Frame Server (Eiger) section.

Syntax:
eigerfix.pl


EPS_monitor_email.pl

Purpose:
This script monitors the DirectNet IOC (the GMCA Equipment Protection system) and sends e-mais to the list of interested paties in case of a problem. This script normally runs all the time along with the directNet IOC on the directnet computer.

GUI:
Not available.

Syntax:
EPS_monitor_email.pl [EPS] [P] [T] [Valves] [LN2]

EPS
request to monitor EPS
P
request to monitor pressures
T
request to monitor temperatures
Valves
request to monitor cryo valves
LN2
request to monitor cryo flows in monochromators, LN2 levels and the APS LN2 valve state

When called without arguments, the script monotors everything.

The script records a log in /home/gmca/logfiles/EPS_monitor_error_log.txt. The e-mail list is hardcoded.


filesCentroid.pl

Purpose:
This script takes a fileglob as a command line argument and then opens each file in the list and finds centroid on a given pair of columns Xcol,Ycol corresponding to X,Y (the default is 1,2). The results are saved in the output centroidFile as filename-centroid.

GUI:
Not available.

Syntax:
filesCentroid.pl fileglob [OUT=centroidFile] [BKG=bkgFile] [Xcol] [Ycol] [DISCR=xxx]

fileglob
Specifies a group of data files, e.g. 'xxx*.dat' on which centroids will be calculated.
OUT=centroidFile
Specifies output centroid file. The default is 'centroid.ctd'.
BKG=bkgFile
Specifies the background file to be subtracted from each data file. The default is none.
Xcol
Specifies the column number in the data files, which corresponds to X data. All files are expected to have the same X data.
Ycol
Specifies the column number in the data files, which corresponds to Y data.
DISCR=xxx
Specifies discrimination level for discarding data when calculating the centroid on data each file. The level must be in range [0-1] and the default is 0. The program calculates maximum Y on each file and then discards all data lines where Y < discrimination * Ymax.

The output file contains N lines (N is the number of files corresponding to fileglob), each line containing file name and calculated centroid.


filesCentroidAndMax.pl

Purpose:

GUI:
Not available.

Syntax:
filesCentroidAndMax.pl fileglob [OUT=centroidAndMaxFile] [BKG=bkgFile] [X=Xcol] [Y=Ycol] [DISCR=xxx]

fileglob
Specifies a group of data files, e.g. 'xxx*.dat' on which centroids will be calculated.
OUT=centroidFile
Specifies output centroid file. The default is 'centroid.ctd'.
BKG=bkgFile
Specifies the background file to be subtracted from each data file. The default is none.
Xcol
Specifies the column number in the data files, which corresponds to X data. All files are expected to have the same X data.
Ycol
Specifies the column number in the data files, which corresponds to Y data.
DISCR=xxx
Specifies discrimination level for discarding data when calculating the centroid on data each file. The level must be in range [0-1] and the default is 0. The program calculates maximum Y on each file and then discards all data lines where Y < discrimination * Ymax.

The output file contains N lines (N is the number of files corresponding to fileglob), each line containing file name, calculated centroid, the X-coordinated of maximum Y in the file and the maximum Y itself.


filesMatrix.pl

Purpose:
This script takes a fileglob as command line argument and then opens each file in the glob and compiles data matrix from all files:

 #    file1  file2  file3  .....  fileM
 x1    y11    y21    y31   .....   yM1
 x2    y12    y22    y32   .....   yM2
 x3    y13    y23    y33   .....   yM3
 ..    ..     ..     ..    .....   ..
 xN    y1N    y2N    y3N   .....   yMN

Here all the files in the glob are expected (and verified) to have the same X coordinates.

GUI:
Not available.

Syntax:
filesMatrix.pl fileglob fileMatrix [Xcol] [Ycol]

fileglob
Specifies a group of data files, e.g. 'xxx*.dat' on which matrix will be composed.
fileMatrix
Specifies output matrix file.
Xcol
Specifies the column number in the data files, which corresponds to X data. All files are expected to have the same X data.
Ycol
Specifies the column number in the data files, which corresponds to Y data.

findhfs.pl

Purpose:
Finds HFS/HFS+ partitions on the attached drives. See also veifyhfs.pl

GUI:
Not available.

Syntax:
findhfs.pl


findPeak.pl

Purpose:
This script scans a servo motor in a given range, attempts to find a FWHM-defined peak of intensity and, if succeeds, moves the motor to the peak center. The scanning algorithm is fast on-the-fly scan based on EPICS scan record.

GUI:
Not available.

Syntax:
findPeak.pl Assembly Axis start end step joerger|struck input

Assembly
Specifies EPICS name of motor assembly.
Axis
Specifies EPICS name of motor axis.
start
Specifies scan start coordinate.
end
Specifies scan end coordinate.
step
Specifies scan step.
joerger|struck
Specifies whether Struck or Joerger scaler should be used for recording intensity.
input
Specifies scaler input for recording intensity.

The scan attempts to run at the maximum motor speed unless the time per point becomes less that 0.25s, which is comparable with EPICS channel access latencies. In the later case the speed is reduced to maintain at least 0.25s time per point. If there is a background (dark) file in the current working directory, the background is subtracted from the scaler data. Some parameters are currently hardcoded:


fixPCS.pl
 

Purpose:
This script attempts to fix (reset) PMAC motors assembly if it is stuck in a "Moving" state. It loops over all motors, finds which one gives the problem and then kills/enables/stops it.

GUI:
The GUI call is available through the MOTION menu on EPICS toolbar.

Syntax:
fixPCS.pl Assembly

Assembly
Specifies EPICS name of motor assembly.

fluoRaster.pl

Purpose:
This script implements 2D fluorescence rastering of sample crystal in focused X-ray beam. The aim is to locate a small crystal(s) by mapping florescence yield depending on 2D position. Depending on command-line options, the script uses different scanning algorithms including step scanning over 2D grid, step scanning over specified set of polygons (2D grid with excluded spots), fly scanning with EPICS scan record or hardware-synchronized fly scanning. The scans are always done in horizontal direction by moving gonio support, while in the vertical direction the sample is shifted step-wise with XY positioner (both X and Y motors are involved to keep the sample in the focal plane). Any horizontal scanning option can be combined with shuttle scanning when the sample is alternatively moved left to right on one pass and right to left on the next one. The details of this program are described in Stepanov et.al. J. Appl. Crystallogr., v.44, No 4, p.772-778 (2011).

GUI:
Not available.

Syntax:
fluoRaster.pl [beamline] [file=xxx] [mcaROI=ready|BluIce|auto|Element-Edge|EeVmin:EeVmax|rough] [mcaTime=xx] [offsetH=min:max:npts] [offsetV=min:max:npts] [flu=nn|struckFlu=nn] [gnuplot=y|n|png|ps|pdf] [gnulog=y|n] [medm=[y|n] [bluice|nobluice] [phiOffset=xx] [shuttle=y|n] [scan=flyHD|flySR|stepMCA|stepDiscr|polygonMCA|polygonDiscr|auto] [interpolate=y|n]

beamline
Beamline specification. Possible values are 23i, 23o, or 23b. The default is current beamline.
file=xxx
Specifies prefix for output files. The default is 'fluoraster_YYYY.MM.DD_hh.mm' and the main data file produced by the script will be 'file.dat'. Also, the script may create Gnuplot data files named as 'file_nnn'.
mcaROI=ready|BluIce|auto|Element-Edge|EeVmin:EeVmax|rough
Specifies how the script should handle MCA ROI. The 'ready' option instructs the script to expect that ROI, gain, and offset are preset by the caller (e.g. by JBluIce). The 'BluIce' option instructs the script to take Element-Edge data from the JBluIce xxx:bi:SCAN:edge PV and then to optimize MCA for respective mySQL data of the element and edge. The 'auto' option instructs the script to behave as 'ready' if ROI is set and otherwise as in the 'BluIce' mode. The 'Element-Edge' option instructs the script to read these given element and edge and then to optimize MCA for respective mySQL data. The 'EeVmin:EeVmax' option instructs the script to read expected fluorescence peak E_eV_min and E_eV_max and then to optimize MCA for this peak. The 'rough' option instructs the script to set MCA ROI for all fluorescence below X-ray energy, i.e. from 50eV to E(incident)-100eV. The default is 'auto'.
mcaTime=xx
Specifies measurement time per point. Note that hardware-synchronized on-the fly scans cannot be performed if the time exceeds 1.67s (Struck scaler restriction). The default is 0.5s.
offsetH=min:max:npts
Specifies offsets (in mm) of horizontal scan limits from the current (central) sample position and the number of points in the horizontal scan. The defaults are -.3:.3:13.
offsetV=min:max:npts
Specifies offsets (in mm) of vertical scan limits from the current (central) sample position and the number of points in the vertical scan. The defaults are -.15:.15:6.
flu=nn|struckFlu=nn
Specifies Struck scaler input for fluorescence (only for scan using discriminating capability of fluorescence signal amplifier instead of MCA). The default is 24.
gnuplot=y|n|png|ps|pdf
Specifies plot option with GnuPlot. When 'y' is chosen, the script plots each horizontal plot and the final contour map on the screen. When 'png', 'ps', or 'pdf' is chosen, only final contour map is produced and saved in respective image file. The default is no gnuplots since normally the script is called by JBluIce.
gnulog=y|n
Specifies if Gnuplot should use log or linear scale for fluorescence intensity. The default is linear scale.
medm=y|n
Specifies if hardware-synchronized scans or those based on EPICS scan record should open respective MEDM plots. The default is yes.
bluice|nobluice
Specifies option to send log messages, popup requests and scan data to JBluIce. The default is yes.
phiOffset=xx
Specifies angular offset in degrees between phi and omega. The default is 0.
shuttle=y|n
Specifies shuttle scanning option when the sample is alternatively moved left to right on one horizontal pass and right to left on the next one.
scan=flyHD|flySR|stepMCA|stepDiscr|polygonMCA|polygonDiscr|auto
Specifies type of horizontal scan (in the vertical direction the scanning is always step-wise). The 'flyHD' option requests hardware-synchronized on-the-fly scanning (the fastest). Note that time per point should be less than 1.67s. The 'flySR' option requests on-the-fly scanning using EPICS scan record. This is less accurate in terms of position, especially at small times per point. Therefore, it should only be used with 1.67s or higher times per scan point. The 'stepMCA' option requests the most conservative step scanning option where fluorescence intensity is read from the MCA ROI sum. The 'stepDiscr' option requests step scanning option where fluorescence intensity is read from discriminating amplifier feeding the Struck scaler (same as in the fly scans). The 'polygonMCA' option requests polygon scanning option with MCA ROI. It is similar to 'stepMCA', but the script reads an array of points to skip from a PV set by JBluIce. Thus, grid scanning becomes polygon scanning. The 'polygonDiscr' option requests polygon scanning option with discriminating amplifier. It is similar to 'stepDiscr', but the script reads an array of points to skip from a PV set by JBluIce. Thus, grid scanning becomes polygon scanning. The 'auto' option requests fly scanning option over rectangular area (no polygons). It applies 'flyHD' or 'flySR' depending on whether the scan time per point is larger or smaller that 1.67s.
interpolate=y|n
Requests interpolating on-the-fly scan data to evenly-spaced horizontal coordinates. The default is yes. The matter is that due to on-the-fly scanning nature the data points coordinates may deviate (especially at the beginning and the end of scan interval) from an evenly-spaced positions in step scans. Interpolating fixes this issue.

frameAudit.pl
 

Purpose:
This script interacts with GMCA frame server in order to record I0 profile and integral I0 during the frame acquisition. It works as follows:

  1. The frame monitoring is initiated by the frame start PV.
  2. As soon as the monitoring is initiated, it starts the Struck scaler integration for the duration of frame exposure time plus an overhead time.
  3. The script waits for the events of shutter closing or CCD readout.
  4. On receiving any of the above events, the script verifies that the Struck scaler is still counting; otherwise generates warning.
  5. The scripts aborts the Struck scaler.
  6. The scripts reads I0 and active beamstop intensities from the Struck scaler, subtracts backgrounds and integrates them over the frame acquisition time.
  7. The scripts calculates the real duration of shutter opening.
  8. Both integral I0 and beamstop intensities along with the real frame duration are posted for JBluIce as PVs.
  9. If a deviation of real exposure time from requested exposure time is detected, an e-mail with frame profile is sent to the host of current user and others who are subscribed on the list.
  10. In addition the script plots the profile of either gonio speed or shutter speed and correct Keithley amplifier gains on both I0 and BS when detects too low signal or signal saturation.

GUI:
The GUI frontend frameAudit.tcl is available through the TOOLS menu on EPICS toolbar.

Syntax:
frameAudit.pl [threshold=5%|0.005s|5ms] [log=file] [i0=name] [beamstop=name] [keepStruck] [saveStruck] [useGnuplot] [debug] [stopBluIce|reportOnly] [check4sequence] [check4files] [trackGonio|trackShutter] [ignoreMBSH] [overhead=N] [medm|nomedm] [nocamonitor|camonitor[=tee|hidden|screen|none]] [checkattenuation|noattenuation] [noemail|email|emailadd[=name,name,...]|emailonly[=name,name,...]] [maxMails=...] [killPrevious]

threshold=5%|0.005s|5ms
Specifies a threshold for frame exposure deviation when error should be reported. The threshold can be given in percent of frame exposure, seconds or milliseconds. The default is 5%.
log=file
Specifies log filename. The default is 'frameAudit_YYYY-MM-DD_hh-mm.log'.
i0=name
Specifies intensity channel name for I0 in mySQL. The default is 'I0'. Under the channel name the mySQL DB contains the Struck scaler input number, Keithley amplifier number, darks for all Keithley gains and the timestamp when they were measured.
beamstop=name
Specifies intensity channel name for active beamstop in mySQL. The default is 'BeamStop'. Under the channel name the mySQL DB contains the Struck scaler input number, Keithley amplifier number, darks for all Keithley gains and the timestamp when they were measured.
keepStruck
Requests keeping Struck data, so one can inspect the plot. script will prompt the operator before erasing the Struck. This is for debugging only. The default is to erase Struck immediately after reading.
saveStruck
Requests saving Struck data after each frame in a separate file. The filename will be 'framename.dmp'.
useGnuplot
Requests plotting each frame with Gnuplot. Temp files named 'framename.gnu' will be produced.
debug
Requests printing extra statements about script progressing.
stopBluIce|reportOnly
Specifies whether JBluIce data collection should be stopped on discovering failed frame.
check4sequence
Requests checking frames for sequence: that frames are incremented by '+1'.
check4files
Requests checking that files are really written to disk: the script will check that the previous file is OK after the current is acquired.
trackGonio|trackShutter
Requests tracking gonio speed or shutter speed during frame acquisition. Respective axis will be linked to PMAC virtual motor (may slow down gonio as speed 90degr/s or more). By default motors are not tracked.
ignoreMBSH
Request skipping check for opened Monochromatic Beam Shutter.
overhead=N
Specifies how many seconds more than expected frame duration should the Struck scaler keep counting if the script does not detect end of frame. The default is 4s.
medm|nomedm
Request opening an MEDM screen with Struck plots. By default MEDM is not displayed.
nocamonitor|camonitor[=tee|hidden|screen|none]
Requests launching EPICS camonitor program that will be monitoring and logging a set of PVs related to data collection. The 'tee' option corresponds to printing camonitor output in a separate terminal window and saving it into 'logfile_camon'. The 'hidden' option corresponds to saving camonitor output into 'logfile_camon'. The 'screen' option corresponds to printing camonitor output in a separate terminal window. The 'nocamonitor' and 'camonitor=none' disable starting the camonitor program. The default is 'tee'.
checkattenuation|noattenuation
Requests checking for beam attenuation change during frame acquisition. The default is to monitor the attenuation.
noemail|email[add][=name,name,...]|emailonly[=name,name,...]
Request sending e-mail on discovered frame error. The e-mail is sent to a host of the group doing experiment (being read from the UAP data files) plus those who signed on the list. This option allows to add recipients for current frameAudit run (email= or emailadd=) or replace the default list (emailonly=).
maxMails=...
Specifies maximum number of emails the script should send on bad frames before stopping e-mail reporting. The default is 10. The messages resume after the rate of bad frame drops under 10%.
killPrevious
Requests the script to attempt killing the previous instance, if present on the same workstation. The default is exit if the previous instance is found. To avoid multiple instances of the script working with the same Struck scaler, it only runs on ws3.

frameAudit_helper.pl

Purpose:
This script is used by frameAudit to process bad frames. It produces a PNG file with a plot of bad frame and sends the frameAudit message by e-mail to given recipients. Basically, it serves as a replacement of separate frameAudit thread allowing frameAudit to proceed to monitoring next frame faster.

GUI:
There is no GUI frontend.

Syntax:
frameAudit_helper.pl dumpfile 'msg' 'title' 'mailList' mailCount maxMails trackGonio trackShutter

dumpfile
Specifies a name of dump file containing intensity profile recorded by the Struck scaler. May also contain gonio or shutter speed profile. The script will produce 'dumpfile.png'.
'title'
Specifies a title for the dump plot.
'mailList'
Specifies a list of email recipients.
mailCount
Specifies current mail count (number of already sent emails since last counter reset).
maxMails
Specifies a threshold of maximum e-mails that can be sent before stopping error reporting by email.
trackGonio
Specifies that the dump file contains gonio speed profile.
trackShutter
Specifies that the dump file contains shutter speed profile.

geoip.pl

Purpose:
This script determines a geographical location of an IP using Geo::IP version-1. The version-1 free DB files produced by maxmind.com are no longer available.

GUI:
Not available.

Syntax:
geoip.pl IP

IP
Specifies the IP address in question.

geoip2.pl

Purpose:
This script determines a geographical location of an IP using Geo::IP version-2. It requires GeoIP2 and MaxMind::DB::Reader::XS Perl modules which are available at CPAN, but hard to install. Better see geoip2a.pl which does not require these modules.

GUI:
Not available.

Syntax:
geoip2.pl IP

IP
Specifies the IP address in question.

geoip2a.pl

Purpose:
This script determines a geographical location of an IP using Geo::IP version-2. It parses the output of mmdblookup program and unlike the sister geoip2.pl script does not require installing additional Perl modules.

GUI:
Not available.

Syntax:
geoip2a.pl IP

IP
Specifies the IP address in question.

getlink32.pl

Purpose:
This script determins if a virtual motor (typically motor 32) is linked to any assembly in given PMAC.

GUI:
The GUI call is available through the MOTION menu on EPICS toolbar.

Syntax:
getlink32.pl pmac [beamline]

pmac
Specifies EPICS name of pmac, e.g. 'pmac20' or '23i:pmac20'. In the later case the name specifies beamline, which cannot be combined with separate beamline specification.
beamline
Specifies beamline name. Possible values are 23i, 23o, or 23b. The default is current beamline.

getMonoHKL.pl

Purpose:
This script displays currently used monochromator Bragg reflection, either 111 or 333.

GUI:
Not available.

Syntax:
getMonoHKL.pl [beamline] [bluice|nobluice]

beamline
Beamline specification. Possible values are 23i, 23o, or 23b. The default is current beamline.
bluice|nobluice
Requests sending messages to JBluIce logs and doing popups via JBluIce or not.

home23_v2.pl
 

Purpose:
This script homes any beamline motors assembly specified in the command line.

GUI:
The GUI frontend homing_v3.tcl is available through the MOTION menu on EPICS toolbar.

Syntax:
home23_v2.pl assembly [assembly ...] [beamline] [nominal=snapfile] [noMedmHome] [noMedmMove] [noUnlink32] [noMacroReset|askMacroReset|waitMacroReset|autoMacroReset] [runNominal|startNominal|skipNominal] [parallel|sequential]

assembly
Specifies EPICS name for PMAC motors assembly, e.g. WS:Av. One or more assemblies can be specified.
[beamline]
Beamline specification. Possible values are 23i, 23o, or 23b. The default is current beamline.
[nominal=snapfile]
Specifies a snapshot file containing nominal motors positions. The file should be in format produced by mtrPositionsBackup.pl. The default is '/home/gmca/fastscans/data/nominal_beamline.snap'.
[noMedmHome]
Requests to bypass opening homing MEDM screen for each motor.
[noMedmMove]
Requests to bypass opening moving MEDM screen for each assembly.
[noUnlink32]
Requests to bypass unlinking virtual motor from any PMAC motor assembly.
[noMacroReset|askMacroReset|waitMacroReset|autoMacroReset]
Specifies PMAC Macro stations resetting option. The 'waitMacroReset' flag forces the script to wait until Macro stations are reset by something else (e.g. by another instance of the script). The 'autoMacroReset' flag forces the script to reset the Macro automatically without asking, if needed. The default is 'askMacroReset' i.e. ask for resetting permission if the script detects that resetting is required.
[runNominal|startNominal|skipNominal]
Specifies if the script should run the motors assembly to nominal positions after homing is finished. The 'runNominal' flag requests running to the nominal positions with motion tracking. The 'startNominal' flag requests starting motion to the nominal positions, but without tracking. The default is 'runNominal'.
[parallel|sequential]
Tells the script whether it is called in a parallel of sequential homing context. The default is sequential. This option is currently not used and introduced for future developments.

image_crossection.pl

Purpose:
This script takes an JPEG (GIG, TIF, ...) image passed as a command line argument, and then:

  1. Converts it into gray-scale using Perl-Magick library.
  2. Digitizes it with Perl-Magick.
  3. Finds cross H or V section at given position.
  4. Analyzes it and plots with GnuPlot.

GUI:
Not available.

Syntax:
image_crossection.pl image [H@v=nnn|first|last|center|integral] [V@h=nnn|first|last|center|integral] [save]

image
Specifies image to be processed.
[H@v=nnn|first|last|center|integral]
Requests horizontal cross section. The section can be taken at vertical pixel 'nnn', first, last, or center vertical pixel or integrated over all vertical pixels. The default is integrated cross section.
[V@h=nnn|first|last|center|integral]
Requests vertical cross section. The section can be taken at horizontal pixel 'nnn', first, last, or center horizontal pixel or integrated over all horizontal pixels. The default is integrated cross section.
[save]
Requests to save cross section(s) in file(s). The files will be named imagename_hsec.dat and imagename_vsec.dat.

By default the program plots both horizontal and vertical cross sections, but does not save them.


ionChamber.pl

Purpose:
This script is for testing the linearity of Ion Chamber or other type of detector (pin diode, and etc.). It changes beam attenuation in wide range (from 1 to 1e+10) and records detector count rate with a scaler. The results are saved in file and presented with GnuPlot.

GUI:
Not available.

Syntax:
ionChamber.pl [struck|joerger] [min=attn_factor] [max=attn_factor] [npts=attn_pts] input [input ... input]

[struck|joerger]
Specifies scaler to be used. The default is 'struck'.
min=attn_factor
Specifies minimum attenuation factor. The default is 1.
max=attn_factor
Specifies maximum attenuation factor. The default is 1E10.
npts=attn_pts
Specifies number of attenuation steps. The default is 101.
input [input ... input]
Specifies scaler input number(s). At least one should be given. The plot shows data for the first input only.

Some parameters are hardcoded and can be modified by editing the script:

datfile = 'ionChamber'
Specifies prefix for output file. The file will be named 'datfile_YYYY_MM_DD_hhmm.dat'.
gnuplot = 1
Requests plotting data on the screen.

Some facts to consider:

  • The script uses scaler background file 'scalerN_Bkg.dat' if available in current working directory. The file can be produced by joergerBkg.pl.
  • The Keithley gains are not changed during measurements.
  • The script relies on the accuracy of the calibration of attenuation foils and tabulated foil absorption coefficients.

ip4nx.pl

Purpose:
This script is called by https://www.gmca.aps.anl.gov/remote/index.php and checks if remote IP falls into a range of acceptable IPs in /usr/NX/etc/htd_require_ip.cfg. If it does, the web page shows a link to NoMachine Cloud Server login. The script returns (prints to STDOUT) either 1 or 0.

GUI:
Not available.

Syntax:
ip4nx.pl ip

ip
remote IP address to check.

ip4nx2.pl

Purpose:
This script is called by https://www.gmca.aps.anl.gov/remote/index.php and checks if remote IP falls into a range of acceptable IPs in /usr/NX/etc/htd_require_ip.cfg and access to what beamline is allowed. If it finds access to any beamline, the web page shows a link to NoMachine Cloud Server login. The script returns (prints to STDOUT) either 1 or 0 and one of BL1|BL2|BL3|ALL

GUI:
Not available.

Syntax:
ip4nx2.pl ip

ip
remote IP address to check.

iqeye-snapshot.pl

Purpose:
This script makes a dated one-time snapshot of IQeye video camera. It deploys PERL LWP library to fetch JPEG images from video camera and then Perl-Magick library to convert JPEG into another format. The images can be saved as TIF, PNG, BMP, and etc. Optionally, the script may take multiple successive snapshots in infinite loop until Ctrl+C is pressed.

GUI:
Not available.

Syntax:
iqeye-snapshot.pl [snapFile] [beamline] [jpg|png|tif] [zoom=N] [sleep=seconds] [display] [help]

snapFile
Provides name for image to save (no extension or extension will be ignored). The default is 'snap_YYYY-MM-DD_hh-mm'.
beamline
Beamline specification. Possible values are 23i, 23o, or 23b. The default is current beamline.
jpg|png|tif
Requests type for image to save. Respective extension is added to the filename.
zoom=N
Specifies digital zoom in range [1:4]. The default is 1.
sleep=seconds
Specifies interval between successive snapshots (can be 0). If this parameter is specified, the script will take multiple successive snapshots in infinite loop until Ctrl+C is pressed.
display
Requests displaying the snapshot with external program ('eog' on Linux and Picture Viewer on Windows).
help
Requests printing the list of command line arguments.

joergerBkg.pl

Purpose:
This script measures background (dark) intensity in Joerger scaler inputs 1-16 (1-32 for newer models or Struck working as Joerger). The intensity is measured with closed shutter and recorded into joergerN_Bkg.dat, where N=1,2,3, or 4 depending on the scaler number at the beamline. The darks file produced by the script is used by many older-style scripts to subtract background from the signal. However, the file must be present in their current working directory and there is no check that it was produced with the same Keithley amplifier gain. To overcome these limitations, newer scripts use darks recorded at all Keithley gains and stored in mySQL. See measureDark1.pl and measureDarks.pl, which produce more modern darks data.

GUI:
Not available.

Syntax:
joergerBkg.pl joerger_scaler_number

joerger_scaler_number
Specifies scaler number at the beamline. Although the acceptable range is from 1 to 4, at the GM/CA beamlines '1' corresponds to Struck scaler and '3' to rarely used Joerger scaler.

kill_kbm.pl
 

Purpose:
This script kills or enables PID loop on all KBM (and HDM) motors. It provides better beam positional stability since when motors are in the PMAC PID loop, it introduces small motors fluctuations and consequent beam positional noise.

GUI:
Graphical interface is available through the TOOLS menu -> Minibeam Tools on EPICS toolbar. It consists of a MEDM screen, which has buttons to launch the script.

Syntax:
kill_kbm.pl [beamline] [reverse]

beamline
Beamline specification. Possible values are 23i, 23o, or 23b. The default is current beamline.
reverse
Requests reverse operation, i.e. restoring the PID loops and enabling motors amplifiers.

killgnome.pl

Purpose:
This script attempts to kill all Gnome-related processes for current user. It is intended to kill stalled gnome sessions. Expected use:

  1. Ctrl+Alt+Backspace to kill current Gnome session (optional; also can be achieved with 'gnome-session-save --kill' on Step-4 before executing the script).
  2. Ctrl+Alt+F1 to switch to a terminal window.
  3. Login as the same user.
  4. Execute this script.
  5. Login back via normal graphical login.

GUI:
Not available.

Syntax:
killgnome.pl


killPID.pl

Purpose:
This script attempts to kill requested PID on Linux. To work fully for regular users, the script owner should be changed to "root", the execution mode set as "chmod a+s...". Aslo, "perl-suidperl" RPM should be installed.

GUI:
Not available. The script is called from cleanupJBluice.pl

Syntax:
killPID.pl [--checkonly] PID

checkonly
requests that the script should only check if the process exist instead of trying to kill it. The output is parsed by cleanupJBluice.pl.

mapDPRAM.pl

Purpose:
This script produces DPRAM map files of M3300 and Q70 variables from the map of PMAC Coordinate Systems (PCS). It is used for automating PMAC configuration when setting new coordinate systems of motors.

GUI:
Not available.

Syntax:
mapDPRAM.pl pcsMapFilename

pcsMapFilename
Specifies the name of input file mapping PMAC coordinate systems. A typical file has the following format:
undef all	; clear all coordinate systems
; (1) -------------------- CCD:Lp:
&1
#1->X  ; CCD:ml:
; (2) -------------------- CCD:St:
&2
#2->X  ; CCD:md:
#3->Y  ; CCD:mus:
#4->Z  ; CCD:mds:
; (3) -------------------- GO:Om:
&3
#5->X  ; GO:mom:
.............................

mcaAutoEdge.pl

Purpose:
This script automatically sets MCA for expected fluorescence edge. It uses data from JBluIce mySQL database to optimize MCA gain/offset and set MCA ROI based on the DB values of the fluorescence peak energy and width.

GUI:
Not available.

Syntax:
mcaAutoEdge.pl [Element-Edge] [beamline] [setDiscrimination] [runMCA]

Element-Edge
Specifies Element and absorption edge for which the MCA gain and offset should be tuned and MCA ROI set (e.g Se-K). If this parameter is not present, it is taken from the current JBluIce selection.
beamline
Beamline specification. Possible values are 23i, 23o, or 23b. The default is current beamline.
setDiscrimination
Requests setting Triple Channel Amplifier (TCA) discrimination according to the MCA ROI. When TCA output is connected to the Struck scaler, setting discrimination prepares TCA for fast scans recording fluorescence peak without MCA.
runMCA
Requests opening fast shutter and running MCA for 1s (a hardcoded parameter) to record the spectrum with selected ROI (selected fluorescence peak).

mcaOptimize.pl

Purpose:
This script optimizes MCA gain and offset for specified energy range E1:E2 or according to the MCA bars set by JBluIce. For optimizing MCA to theoretical fluorescence peaks see mcaAutoEdge.p.

GUI:
Not available.

Syntax:
mcaOptimize.pl [E1:E2] [beamline] [setDiscrimination] [runMCA]

E1:E2
Specifies energy range in eV for which MCA gain and offset should be tuned and MCA ROI set (e.g Se-K). If E1:E2 (eV) are not specified, they are taken from the BluIce MCA spectrum bars (the bars positions are mapped to EPICS).
beamline
Beamline specification. Possible values are 23i, 23o, or 23b. The default is current beamline.
setDiscrimination
Requests setting Triple Channel Amplifier (TCA) discrimination according to the MCA ROI. When TCA output is connected to the Struck scaler, setting discrimination prepares TCA for fast scans recording fluorescence peak without MCA.
runMCA
Requests opening fast shutter and running MCA for 1s (a hardcoded parameter) to record the spectrum with selected ROI (selected fluorescence peak).

mcaPlot.pl

Purpose:
This script uses Gnuplot to plot MCA spectrum on the energy scale instead of MCA channels. It works with both Canberra and Falcon and uses respective CALO and CALS parameters for the the channel to energy conversion. The script also displays characteristic fluorescence lines and it can be useful for calibrating the detector (determining the CALO and CALS soft calibration parameters).

GUI:
Not available.

Syntax:
mcaPlot.pl [beamline] [runMCA]

beamline
Beamline specification. Possible values are 23i, 23o, or 23b. The default is current beamline.
runMCA
Requests opening fast shutter and running MCA to acquire new spectrum. By default the script only reads already acquired spectrum.

mcaR2D.pl

Purpose:
This script sets ADC and TCA discriminations based on current MCA ROI. It is used for testing the ROI-to-discrimination calibration parameters and in conjunction with on-the-fly fluorescence scans bypassing MCA for speed and using TCA output fed into Struck scaler.

GUI:
Not available.

Syntax:
mcaR2D.pl [beamline] [rerunMCA]

beamline
Beamline specification. Possible values are 23i, 23o, or 23b. The default is current beamline.
rerunMCA
Requests opening fast shutter and re-running MCA to test new TCA settings. One is expected to see MCA signal within the ROI only.

mcaR2Drestore.pl

Purpose:
This script restores ADC and TCA discriminations of fluorescence analyzer to their defaults.

GUI:
Not available.

Syntax:
mcaR2Drestore.pl [beamline] [rerunMCA]

beamline
Beamline specification. Possible values are 23i, 23o, or 23b. The default is current beamline.
rerunMCA
Requests opening fast shutter and re-running MCA to test new TCA settings.

mcaReset.pl

Purpose:
This script restores all Canberra MCA, ADC and TCA settings to their defaults, removes MCA ROI and sets MCA count time to 1s. It sets the MCA gain to the minimum value of 256 and the MCA offset to 0, so that MCA should show the whole fluorescence spectrum.

GUI:
Not available.

Syntax:
mcaReset.pl [beamline] [rerunMCA]

beamline
Beamline specification. Possible values are 23i, 23o, or 23b. The default is current beamline.
rerunMCA
Requests opening fast shutter and re-running MCA to test new TCA settings.

measureDark1.pl
 

Purpose:
This script closes the shutters and measures scaler darks for all Keithley gains on one 'signal', which is a named intensity measurement pipeline involving a Struck scaler input connected via a Keithley amplifier. The data is stored in the 'struckDarks4KeithleyGains' table on respective mySQL server for future use by various programs. The record must be already present in mySQL (new records are not created).

GUI:
The script can be accessed through the TOOLS menu on EPICS Toolbar.

Syntax:
measureDark1.pl signalName [beamline] [skipHutchShutter|closeHutchShutter] [writelog|nolog] [interactive|noninteractive] [zero|fake|real]

signalName
Specifies 'signal' name. This name must correspond to a keyword in mySQL database defining intensity pipeline, i.e. the Keithley amplifier and the Struck scaler input. If this argument is not specified, the script will print the list of signals available in mySQL.
beamline
Beamline specification. Possible values are 23i, 23o, or 23b. The default is current beamline.
skipHutchShutter|closeHutchShutter
Specifies whether endstation shutter should be closed during dark measurements. The default is yes.
writelog|nolog
Requests log file with measured darks. The file will be named 'beamline_struckDarks_signalName_YYYY-MM-DD_hh-mm.dat'. By default the log is not created.
interactive|noninteractive
Requests interactive or noninteractive mode for the script in case it needs to report an error. This option is required for GUI calls. The default is interactive.
zero|fake|real
Requests either measuring real darks or zeroing the darks database (fake measurements, 'fake' is a synonym). The default is real measurement.

Some parameters are hardcoded:

cnt_time = 1
Specifies how many seconds to count dark signal.
gainMin = 1e+3
Specifies minimum keithley amplifier gain.
gainMax = 1e+10
Specifies maximum keithley amplifier gain.
scalerModel = 'struck'
Specifies name of scaler (could be 'struck' or 'joerger').
logfile = 'struckDarks'
Specifies prefix for log file.

measureDarks.pl
 

Purpose:
This script closes the shutters (fast shutter and endstation shutter) and measures scaler darks for all Keithley gains on those Struck scaler inputs, which are connected via Keithley amplifiers. Then data is stored in the 'struckDarks4KeithleyGains' table on respective mySQL server for future use by various programs. If mySQL records do not exist, they are created; otherwise overwritten.

GUI:
The script can be accessed through the TOOLS menu on EPICS Toolbar.

Syntax:
measureDarks.pl [beamline] [writelog|nolog] [interactive|noninteractive] [zero|fake|real]

beamline
Beamline specification. Possible values are 23i, 23o, or 23b. The default is current beamline.
writelog|nolog
Requests log file with measured darks. The file will be named 'beamline_struckDarks4KeithleyGains_YYYY-MM-DD_hh-mm.dat'. By default the log is not created.
interactive|noninteractive
Requests interactive or noninteractive mode for the script in case it needs to report an error. This option is required for GUI calls. The default is interactive.
zero|fake|real
Requests either measuring real darks or zeroing the darks database (fake measurements, 'fake' is a synonym). The default is real measurement.

Some parameters are hardcoded:

cnt_time = 1
Specifies how many seconds to count dark signal.
gainMin = 1e+3
Specifies minimum keithley amplifier gain.
gainMax = 1e+10
Specifies maximum keithley amplifier gain.
scalerModel = 'struck'
Specifies name of scaler (could be 'struck' or 'joerger').
logfile = 'struckDarks4KeithleyGains'
Specifies prefix for log file.
signals = (Top, Out, Pin, Bottom, In, I0, BeamStop)
Specifies list of signals for Keithley amplifiers 1 to 7.
inputs = ( 13, 15, 17, 14, 16, 18, 19)
Specifies list of Struck inputs for Keithley amplifiers 1 to 7.

measureMiniBeam.pl
 

Purpose:
This script measures beam size in horizontal and vertical directions profiling it with 5um pinhole. The operation consists of the following steps:

  1. Changing active collimator to 5um.
  2. Disabling intensity feedback.
  3. Calling alignMiniBeam.pl to align the beam to 5um collimator.
  4. Optimizing Keithley gains for whatever is used for intensity measurements (PinDiode or Beamstop).
  5. Profiling the beam with the 5um collimator in both horizontal and vertical by directions by means of HD-synchronized scans.
  6. Posting beam sizes to EPICS PVs and saving them along with scan data into H-log and V-log files.
  7. Restoring intensity feedback.
  8. Restoring active collimator to the initial setting.

GUI:
The GUI frontend measureMiniBeam.tcl is available through the TOOLS menu on EPICS toolbar.

Syntax:
measureMiniBeam.pl [beamline] [halfV=xxx] [stepV=xxx] [halfH=xxx] [stepH=xxx] [dwell=xxx] [signal=Pin|Beamstop] [medm|nomedm] [flyAlign|stepAlign|noAlign] [noninteractive|interactive] [optimizeGain|skipGain] [prefix=fileprefix]

beamline
Beamline specification. Possible values are 23i, 23o, or 23b. The default is current beamline.
halfV=xxx
Specifies half-range (i.e. +- deviation from the central position) for vertical scanning of pinhole. The default is 0.250mm.
stepV=xxx
Specifies step for vertical scanning of pinhole. The default is 0.001mm.
halfH=xxx
Specifies half-range (i.e. +- deviation from the central position) for horizontal scanning of pinhole. The default is 0.500mm.
stepH=xxx
Specifies step for horizontal scanning of pinhole. The default is 0.003mm.
dwell=xxx
Specifies time per point for scans (cannot exceed 1.67s). The default is 0.1s.
signal=Pin|Beamstop
Specifies 'signal' (a reference to mySQL DB of beamline signals) for measuring intensity during scans. The default is 'Pin' (pin diode).
medm|nomedm
Specifies whether scan MEDM should be displayed. The default is 'yes'.
flyAlign|stepAlign|noAlign
Specifies beam aligning option before profiling the beam. With the 'flyAlign' option, alignMiniBeam.pl will perform on-the-fly DAC scans. With 'noAlign', the alignMiniBeam.pl script will not be called. The default is to do step scans for beam aligning.
noninteractive|interactive
Requests interactive or noninteractive mode for the script in case it needs to report an error. This option is required for GUI calls. The default is noninteractive.
optimizeGain|skipGain
Specifies the option of optimizing Keithley gain before doing the scan. The default is to optimize Keithley gain.
prefix=fileprefix
Specifies prefix for log files. The default is 'beam_YYYY.MM.DD_hh.mm'. The log files will be named 'fileprefix_H.dat' and 'fileprefix_V.dat'.
history=auto|add|skip|overwrite
Specifies how measured FWHM should be added to history. The default is add if the prevous result is older than 15minutes, otherwice overwrite the latest result.

mirrorBimorph_PVstart.pl
 

Purpose:
This script sets up scan periods for all bimorph mirror PVs. By default, when the SY900 controller (the bimorph mirror high voltage power supply controller) starts, all PVs are set to passive and as so, they do not read the controller voltages. The PVs SCAN field needs to be changed to a periodic read (typically 5s) in order to start reading voltages.

GUI:
The GUI call is available through the TOOLS menu on EPICS toolbar.

Syntax:
mirrorBimorph_PVstart.pl mirror [nChannels] [scanTime]

mirror
Specifies the mirror: either 'VFM' or 'HFM'; can also be '23x:VFM' or '23x:HFM'.
nChannels
Specifies the number of channels (high-voltage segments) in the mirror. The default is 16.
scanTime
Requests PV refresh rate. Can be 'Passive', '10 second', '5 second', '2 second', '1 second', '.5 second', '.2 second', '.1 second', 0., 10., 5., 2., 1., 0.5, '0.2', 0.1. Note that when specifying the rate as a number (without the word 'second'), it must contain '.' in order to be distinguished the number of channels. The default is '5 second' and higher rates are not recommended since the controller is not capable of maintaining them reliably. Specifying 'Passive' or 0., turns the PVs update off.

mirrorMatrix.pl
 

Purpose:
This script collects data on mirror focusing at different voltages. It uses narrow monochromatic beam slit to illuminate narrow segments of the mirror and then profiles reflection with an analyzer slit, video camera or BPM. Then, voltage of one electrode is incremented and the procedure is repeated. The results is a series of scan files, which are processed to build the mirror response matrix and calculate the corrections needed to bring reflections from all segments to the same focal place. The calculations can be done either by uploading scan data into the SY900 controller (if the controller has respective capability provided by so-called 'firmware+') or by the script itself. In the former case the script calls mirrorMatrixUpload.pl and in the later mirrorMatrixCalc.pl.

GUI:
The graphical frontend mirrorMatrix.tcl can be accessed through the TOOLS menu on EPICS Toolbar.

Syntax:
mirrorMatrix.pl HFM|VFM focus=gonio|XYpos|BPM|video [mirrorAngle=xx|auto] [segmentSampling=nn] [edgeBeamlets=nn] [pulse=xx] [afterPulseDelay=nn] [corrmatrix=SY900|internal|none] [outFilesPrefix=name] [centroidDiscriminator=xx] [XYpos=nn] [i0=nn] [useAttenuation|noAttenuation] [attenuationSrc=I0-firstTime|I0-eachTime|video-firstTime|video-eachTime] [scanType=SR|HD] [i1=nn] [analyzerTimePPT=xx] [analyzerStep=xx] [analyzerHalfRange=xx] [showMedm|noMedm] [i2=nn] [scalerCountBPM=xx] [saveImages|noImages] [beamline]

HFM|VFM
Specifies whether the script should work with vertical or horizontal mirror.
focus=gonio|XYpos|BPM|video
Specifies focus analyzer:
  • 'gonio' tells the script to profile the reflected beam in the focal plane with analyzing slit mounted on the goniometer. The goniometer support motors will be used for scanning the slit.
  • 'XYpos' tells the script to profile the reflected beam in the focal plane with analyzing slit mounted on a dedicated XY positioner given by XYpos=nn.
  • 'BPM' tells the script that the positions of reflected beamlets in the focal plane should be detected with two BPM readings i1 and i2 as (i2-i1)/(i2+i1).
  • 'video' tells the script to determine the positions of reflected beamlets in the focal plane by analyzing screenshots of beamline hi-resolution video camera. For this purposed a YAG crystal should be placed in the focal plane (typically YAG is mounted on the goniometer).
mirrorAngle=xx|auto
Specifies mirror angle to the beam. If set to 'auto', the angle is read from respective EPICS PVs. The angle in combination with mirror length (hardcoded values of 1050mm and 600mm are used for horizontal and vertical mirrors respectively) is used to calculate the shift of monochromatic beam slits necessary for illuminating different mirror segments.
segmentSampling=nn
Specifies the number of data samplings per segment. This value should be in range 1-5 and a good default is 2.
edgeBeamlets=nn
Specifies how many beamlets should be ignored beamlets at each end of the mirror. The default is 0. The idea is that the quality of mirror at the edges is typically worse than in the middle and therefore it is better not to illuminate the edges with X-ray when trying to achieve a good focus. Keep in mind that (nSegments*segmentSampling - 2*edgeBeamlets) should not be less than nSegments; otherwise the task would be undersampled.
pulse=xx
Specifies a pulse (a voltage increment) consecutively applied to each segment when studying mirror focus response to voltage changes. The default is 15 volts.
afterPulseDelay=nn
Specifies a delay in seconds between applying the pulse and starting to collect data. This delay is supposed to let mirror settle after applying the pulse. The default is 300 seconds.
corrmatrix=SY900|internal|none
Specifies the option for calculating mirror response matrix from collected data:
  • 'SY900' instructs the script to upload data into SY900 controller using the mirrorMatrixUpload.pl script. Only 'firmware+' controllers are equipped with this functionality. At GM/CA CAT, this is 23ID-in controller (kbm1.gmca.aps.anl.gov) and therefore when requesting this method of matrix calculations for 23ID-out, keep in mind that data will be uploaded cross-beamline to kbm1 and the kbm1 matrix will be overwritten. Because of this potentially unsafe effect, it is recommended to use the 'internal' method for all response matrix calculations of bimorph focusing mirrors at 23ID-out. Nevertheless, this option remains default since historically it was the first.
  • 'internal' instructs the script to calculate the mirror response matrix from the scan data using the mirrorMatrixCalc.pl script.
  • 'none' requests skipping mirror matrix calculation and just collecting and saving scan data about positions of reflected beamlets in the focal plane.
outFilesPrefix=name
Specifies prefix for output filenames. The default is 'focus'. The prefix is transformed as e.g. '23i_prefixVFM_YYYY-MM-DD_hh-mm' and the files created may be
  • prefix.weight - weight file containing centroids weights (integral intensity under the peak)
  • prefix_pp.ctd - centroid files for each pulse.
  • prefix_pp.lst - debug files for each pulse.
  • prefix_centroids_matrix.cmx - centroids matrix displayed with GnuPlot.
  • prefix_pp-bb.jpg - camera screenshots for each pulse and beamlet.
  • prefix_dark.jpg - camera dark screenshot taken with beam off.
  • prefix_pp-bb.sec - cross section of camera screenshots for each pulse and beamlet.
  • prefix_dark.xxx - cross section of camera dark screenshot taken with beam off.
  • prefix_pp-bb.slt - 'slit' files for each pulse and beamlet containing individual slit scan data.
  • prefix.bmtx - mirror correction matrix file as calculated by mirrorMatrixCalc.pl.
centroidDiscriminator=xx
Specifies what level below the scan or image cross section peak to be considered noise and to be ignored when calculating the centroids (the weighted average positions of beamlets in the focal plane). The default is 0.2, i.e. everything with intensity 20% below maximum should be ignored.
XYpos=nn
Specifies XY positioner number when focus=XYpos. The default is 6.
i0=nn
Specifies Struck input for measuring I0, the intensity used for normalizing scan data. The default is 18. If i0=0 is specified, the normalization as well as changing beam attenuation are disabled.
useAttenuation|noAttenuation
Specifies whether attenuation should be reduced when I0 drops. The intensity may drop when monochromatic beam slit shifts towards mirror edges because in these cases it shifts off the incident beam center and picks its less intensive tails. When 'useAttenuation' is selected, the script measures I0 before starting any operations when everything is centered. Then, at each monochromatic beam position (i.e. when selecting each beamlet) the script re-measures I0, compares it to the center value and attempts to compensate attenuation accordingly. It is recommended to set initial attenuation to 10x - 100x, so that the script has room to decrease it. The default is to use attenuation.
attenuationSrc=I0-firstTime|I0-eachTime|video-firstTime|video-eachTime
Specifies the mode of measuring I0 when changing the attenuation. Available I0 sources can be Struck counts at i0 input or the maximum on the cross of video snapshots. If 'firstTime' option is specified, then for speed considerations, I0 measurements are carried out at the first pass only (when no pulse is applied) and then cached. Otherwise the are carried after each shift of monochromatic beam slit. The default is 'I0-firstTime'.
scanType=SR|HD
Specifies analyzing slit scan type: scan record scan or hardware synchronized scan. The default is 'HD'. This option has no effect in 'BPM' and 'video' modes.
i1=nn
Specifies Struck input for measuring beamlet intensity or I- intensity in the BPM mode. The default is 17.
analyzerTimePPT=xx
Specifies time per point for analyzer scans. The default is 0.02s (20ms).
analyzerStep=xx
Specifies analyzer scan step. The default is 0.005mm (5um) for HFM and 0.001mm (1um) for VFM.
analyzerHalfRange=xx
Specifies analyzer scan +- ranges from the central position. The default is 0.4mm for HFM and 0.1mm for VFM.
showMedm|noMedm
Specifies option to show scan MEDM screen. The default is yes.
i2=nn
Specifies input for measuring for measuring I+ intensity in the BPM mode.
scalerCountBPM=xx
Specifies scaler counting time in the BPM mode. The default is 1s.
saveImages|noImages
Requests saving camera snapshots in 'video' mode. The default is no.
beamline
Beamline specification. Possible values are 23i, 23o, or 23b. The default is current beamline.

mirrorMatrixCalc.pl

Purpose:
This script attempts to reproduce the 'Calculate Correction Matrix' functionality provided by the 'firmware+' version of SY900 bimorph mirrors controller. As an input, it uses the centroids files (or, as Ricardo Signorato calls them, 'pulse files') produced by mirrorMatrix.pl. Based on these data, it calculates the respective correction matrix using SVD method and records it into a '.bmtx' file. Finally, the last centroid in the group is used to generate the corrections and apply to the controller using the EPICS interface.
When pulse=0 and only one centroids file ('pulse file') is given, the script will look for the latest correction matrix file produced by its previous run (or for the one specified in the cmdline) and use it to generate the corrections for the given centroids file and then apply them to the controller using the EPICS interface.

GUI:
Not available.

Syntax:
mirrorMatrixCalc.pl mirror [pulse=pulse] [cormatrixfile=cormatrixfile] [weight=ask|auto|yes|no] centroidFilesGlob

mirror
Specifies mirror. Can be VFM, HFM, 23x:VFM, or 23x:HFM.
pulse=pulse
Specifies 'pulse' (voltage increment) applied to the mirror when the mirror matrix data was collected. The default is 0, which corresponds to a special mode when the script should calculate voltage corrections with already available matrix. In this case only one centroids file is expected.
cormatrixfile=cormatrixfile
Specifies file name of correction matrix. The default is 'mirror_YYYY-MM-DD_hh-mm.bmtx'. When pulse#0, the file will be produced, otherwise it is expected to exist.
weight=ask|auto|yes|no
Specifies whether the calculation of correction matrix should take into account weights of centroids (integral intensity under the intensity peak for given centroid). The weights file is produced by mirrorMatrix.pl and if the centroids are named prefix_nn.ctd, the weights file is expected to be named prefix.weight. The 'auto' option forces the script to use the file only if it exists, the 'yes' option will demand the file and generate error if it is not present, the 'no' option will ignore the file even if it is present, and with the 'ask' option the script will prompt user when it finds the file. The default is 'ask'.
centroidFilesGlob
Specifies fileglob for centroids, typically 'prefix_??.ctd' or 'prefix_*.ctd'. This parameter must be placed last in the command line.

mirrorMatrixCalc_generic.pl

Purpose:
This script attempts to reproduce the 'Calculate Correction Matrix' functionality provided by the 'firmware+' version of SY900 bimorph mirrors controller. As an input, it uses the centroids files (or, as Ricardo Signorato calls them, 'pulse files') produced by mirrorMatrix.pl. Based on these data, it calculates the respective correction matrix using SVD method and records it into a '.bmtx' file. Finally, the last centroid in the group is used to generate the corrections. As distinct from mirrorMatrixCalc.pl, this script only prints the corrections, but does not apply them to the bimorph controller: it is only a calcularor not working with any controller.
When pulse=0 and only one centroids file ('pulse file') is given, the script will look for the latest correction matrix file produced by its previous run (or for the one specified in the cmdline) and use it to generate the corrections for the given centroids file.

GUI:
Not available.

Syntax:
mirrorMatrixCalc_generic.pl electrodes=NN [pulse=pulse] [cormatrixfile=cormatrixfile] [weight=ask|auto|yes|no] [maxVdiff=value] centroidFilesGlob

electrodes=NN
Specifies number of electrodes in the mirror. Must be a positive number.
pulse=pulse
Specifies 'pulse' (voltage increment) applied to the mirror when the mirror matrix data was collected. The default is 0, which corresponds to a special mode when the script should calculate voltage corrections with already available matrix. In this case only one centroids file is expected.
cormatrixfile=cormatrixfile
Specifies file name of correction matrix. The default is 'mirror_YYYY-MM-DD_hh-mm.bmtx'. When pulse#0, the file will be produced, otherwise it is expected to exist.
weight=ask|auto|yes|no
Specifies whether the calculation of correction matrix should take into account weights of centroids (integral intensity under the intensity peak for given centroid). The weights file is produced by mirrorMatrix.pl and if the centroids are named prefix_nn.ctd, the weights file is expected to be named prefix.weight. The 'auto' option forces the script to use the file only if it exists, the 'yes' option will demand the file and generate error if it is not present, the 'no' option will ignore the file even if it is present, and with the 'ask' option the script will prompt user when it finds the file. The default is 'ask'.
maxVdiff=value
Specifies maximum allowed voltage (correction) difference between the neighbouring electrodes. The default is 600. This parameters is only used for generating warnings.
centroidFilesGlob
Specifies fileglob for centroids, typically 'prefix_??.ctd' or 'prefix_*.ctd'. This parameter must be placed last in the command line.

mirrorMatrixUpload.pl

Purpose:
This script automates interaction with the 'Calculate Correction Matrix' interface of the 'firmware+' version of SY900 bimorph mirrors controller by emulating how users upload their data into the controller using a web browser. It uploads the centroids produced by mirrorMatrix.pl into the KBM controller using the controller web interface, reads back the corrections and optionally applies them to the controller.

GUI:
Not available.

Syntax:
mirrorMatrixUpload.pl mirror pulse=pulse centroidsFileglob

mirror
Specifies mirror. Can be VFM, HFM, 23x:VFM, or 23x:HFM.
pulse=pulse
Specifies 'pulse' (voltage increment) applied to the mirror when the mirror matrix data was collected. When pulse=0 is specified, it corresponds to a special mode when the script should calculate voltage corrections with a matrix already stored in the controller. In this case only one centroids file is expected. Please use with caution because there is no way to check what matrix is stored in the controller and whether it belongs to the current beamline (because only one of SY900 controllers at GM/CA CAT has firmware+, we may do cross-beamline calculations).
centroidFilesGlob
Specifies fileglob for centroids, typically 'prefix_??.ctd' or 'prefix_*.ctd'. This parameter must be placed last in the command line.

NOTE: All parameters must be placed in the specified order.


mirrorsBackup.pl
 

Purpose:
This script makes a snapshot of current KB mirrors voltages in the SY900 controller at a given beamline into a named SY900 file. Later on the voltages can be restored with mirrorsRestore.pl.

GUI:
The GUI call is available through the TOOLS menu on EPICS toolbar.

Syntax:
mirrorsBackup.pl snapFile.sy900 [beamline] [noninteractive]

snapFile.sy900
Specifies filename where the voltages should be saved. Both mirrors data will be saved.
beamline
Beamline specification. Possible values are 23i, 23o, or 23b. The default is current beamline.
noninteractive
Disables any dialogs.

mirrorsRestore.pl
 

Purpose:
This script drives all voltages of KBM mirrors controlled by SY9000s to the values stored in a SY900 file previously recorded with mirrorsBackup.pl.

GUI:
The GUI call is available through the TOOLS menu on EPICS toolbar.

Syntax:
mirrorsRestore.pl snapFile HFM|VFM|ALL [beamline]

snapFile.sy900
Specifies filename where the voltages should be saved. Both mirrors data will be saved.
HFM|VFM|ALL
Specifies what mirror should be controlled. 'All" applies to both HFM and VFM.
beamline
Beamline specification. Possible values are 23i, 23o, or 23b. The default is current beamline.

monitorJoerger.pl

Purpose:
This script is a representative of a 'monitor' group of scripts, which record various PVs in a measure-sleep, measure-sleep, ... mode. Those scripts should be considered as templates for editing since all of their parameters are embedded. This particular script is a PV monitor without any motion. It records a file with data measured on specified Joerger scaler inputs as a function of time (measure-sleep, measure-sleep,....).

GUI:
Not available.

Syntax:
monitorJoerger.pl


monoMismatch.pl

Purpose:
This script shows if mono and ID are currently matched in energy. It can optionally print mono-ID calc strings for feedback_23x.adl or even update feedback_23x.adl and feedback_23x.ui with new calc string according to the current mono-ID offsets in SQL.

GUI:
Not available.

Syntax:
monoMismatch.pl [beamline] [tolerance_keV] ["printcalc|print_calc"] ["updatemedm|update_medm"] ["debug"]

beamlne
specifies destination beamline (23i or 23o). Can be used for cross-beamline calls.
tolerance
Maximum acceptable difference in keV between the mono energy and ID readouts. The default is 0.02.
printcalc|print_calc
requests printing the mono-ID calc strings for feedback_23x.adl.
updatemedm|update_medm
requests updating feedback_23x.adl and feedback_23x.ui with new mono-ID mismatch calc.

mostab.pl
 

Purpose:
This script provides beam intensity feedback. It can be paused and resumed by other scripts and JBluIce via a set of EPICS PVs. This script is written and being maintained by Derek Yoder.

GUI:
The graphical frontend mostab.adl can be accessed through the TOOLS menu on EPICS Toolbar.

Syntax:
mostab.pl


moveMotor.pl

Purpose:
This script moves any PMAC motor to a coordinate specified in the command line.

GUI:
Not available.

Syntax:
moveMotor.pl Assembly Axis destination

Assembly
Specifies motor assembly, 23i:GS:Av
Axis
Specifies motor axis, 23i:GS:ZC
destination
Specifies destination coordinate.

NOTE: All parameters must be placed in the specified order.


mtrIvarsBackup.pl

Purpose:
This script dumps into a file the values of all important I-variables for motors of specified PMAC.

GUI:
Not available.

Syntax:
mtrIvarsBackup.pl pmac [nMotors] [NONINTERACTIVE] [outfile]

pmac
Specifies EPICS name of PMAC to be dumped, e.g. '23i:pmac20'.
nMotors
Specifies the number of motors to be saved. The default is 32.
NONINTERACTIVE
Disables any dialogs.
outfile
Specifies output file for saving data. The default is 'MtrIvarsBackup-pmac-YYYY-MM-DD_hhmm.pmc'.

mtrParams.pl

Purpose:
This script records the values of all important parameters for PMAC-1 motors at an ID beamline into 'MotParam-YYYY-MMM-DD-hhmm.dat. The script is maintained by Derek Yoder.

GUI:
Not available.

Syntax:
mtrParams.pl


mtrPositionsBackup.pl
 

Purpose:
This script makes a snapshot of current motors positions at a given beamline into a SNAP file. The list of axes and assemblies is generated from config23x.tcl. Later on, the positions can be restored with mtrPositionsRestore.pl.

GUI:
The graphical frontend can be accessed through the MOTION menu on EPICS Toolbar.

Syntax:
mtrPositionsBackup.pl snapFile [beamline] [noninteractive]

snapFile
Specifies the filename for saving positions. There is no default.
beamline
Beamline specification. Possible values are 23i, 23o, or 23b. The default is current beamline.
noninteractive
Disables any dialogs.

mtrPositionsRestore.pl

Purpose:
This script drives all beamline motors to the positions stored in a SNAP file recorded with mtrPositionsBackup.pl. It differs from mtrPositionsRestore2.pl by the way the data is supplied to the script: this script reads the name of snap file from the command line, while in the case of mtrPositionsRestore2.pl an external GUI pre-parses the snap file and sends all motors names and requested positions to the script via the command line. Per user request, the script may write a log file into '/home/gmca/shared/logfiles/23n_mtrPosRestore_YYYY-MM-DD_hh-mm.log'.

GUI:
Not available.

Syntax:
mtrPositionsRestore.pl snapFile [beamline]

snapFile
Specifies a snap file previously recorded by mtrPositionsBackup.pl.
beamline
Beamline specification. Possible values are 23i, 23o, or 23b. The default is current beamline.

mtrPositionsRestore2.pl
 

Purpose:
This script drives all beamline motors to the positions stored in a SNAP file recorded with mtrPositionsBackup.pl. It differs from mtrPositionsRestore.pl by the way the data is supplied to the script: here no input file is specified, and instead all assemblies and positions are supplied via the command line. Normally, this script is supposed to be called from a GUI called MtrPositionsRestore.tcl. Per user request, the script may write a log file into '/home/gmca/shared/logfiles/23n_mtrPosRestore_YYYY-MM-DD_hh-mm.log'.

GUI:
The graphical frontend MtrPositionsRestore.tcl can be accessed through the MOTION menu on EPICS Toolbar.

Syntax:
mtrPositionsRestore2.pl beamline "nAxis assembly axis pos [axis pos]" ...

beamline
Beamline specification. Possible values are 23i, 23o, or 23b. The default is current beamline.
"nAxis assembly axis pos [axis pos]"
Specifies number of axes in PMAC assembly, assembly name and nAxis groups of axis name and axis position. The argument must be enclosed in quotes or {}. The command line may contain multiple instances of the argument.

mxshell.pl
 

Purpose:
This script starts shells with environment sourced for various crystallographic programs (Phenix, DIALS, CCTBX, ...). If the command line does not specify what programs to start, the script opens a GUI dialog.

GUI:
This script is a GUI by itself.

Syntax:
mxshell.pl [program program ...] [bash|csh] [help|?] [simple|advanced]

program
Name of crystallographic program(s) to start. Type "help" to see the list. If at least one program is specified, the script starts respective shell(s) and exits. if only one program is specified, the environment for that program is sourced in the same shell.
bash|csh
Shell to open the default is bash
help|?
Print command line syntax and exit.
simple|advanced
Setting for GUI mode. If "advanced" is specified, the GUI offers choice of shells. Otherwise, the shell button is not shown and the GUI uses the default shell or the shell specified in the command line.

nomarccdepics.pl

Purpose:
In spite of its weird name (which appeared historically), this script starts MAR and Pilatus detector programs and respective IOCs (Frame Processing Engines, FPEs).

GUI:
The script is a GUI by itself (the GUI mode starts for MAR detectors only). It is called from desktop panel on 1st day beamline computers. For Pilatus detectors, it may execute prepare_pilatus_fpe.pl to patch and recompile the Pilatus FPE as needed.

Syntax:
nomarccdepics.pl [external_enable|internal_advance]

external_enable|internal_advance
This option applies to Pilatus only. The FPE source is automatically patched to enable or disable the EXTERNAL_ENABLE mode of shutterless data collection. Then, the source is recompiled as needed.

nxallowedcheck.pl

Purpose:
This script is triggered by the "UserScriptAfterLogin" parameter in /usr/NX/etc/server.cfg. It receives two command line arguments: $1 is username and $2 is remote IP (works correctly even in case of webplayer) and checks if login of given user from given IP is allowed. If the script exits with non-zero status, the session is terminated.

GUI:
Not available.

Syntax:
nxallowedcheck.pl


nxclients.pl

Purpose:
This script reports reports what NX clients versions and on what platform were used in the past (as long as NX DB is preserved). It can be called by GMCA staff on ws2, ws5 and ws6 and re-launches itself via sudo which is only allowed for the GMCA staff.

GUI:
Not available.

Syntax:
nxclients.pl


nxdb.pl

Purpose:
This script displays NX session information for given session number. It needs to run as root or be included in sudo. The script can be called by GMCA staff on ws2, ws5 and ws6. It re-launches itself via sudo which is only allowed for the GMCA staff on these computers.

GUI:
Not available.

Syntax:
nxdb.pl sessionId [running|closed|failed]

sessionId
ID of NOMACHINE session.
running|closed|failed
NOMACHINE folder filter. If not specified, the script looks for sessionId in all folders.

nxversion.pl

Purpose:
This script reports to NOMACHINE user on login when an outdated NX player is used.

GUI:
The script is called at a startup of remote MATE session and uses Zenity to displaying an outdated NX player warning.

Syntax:
nversion.pl


omegaReset.pl

Purpose:
This script attempts to fix Omega jittering (to bring Omega to the 'Positioned' state by consecutively trying the following actions:

  1. pausing data collection, aborting Omega,
  2. restoring Omega high speed,
  3. trying to tweak Omega by +-1degr,
  4. trying to kill/restore Omega motor,

It also collects all possible omega status information and emails this information to the recipients of hardcoded mailing list (currently Oleg and Sergey).

GUI:
Not available.

Syntax:
omegaReset.pl [beamline] [nomedm|medm] [nomail|mail]

beamline
Beamline specification. Possible values are 23i, 23o, or 23b. The default is current beamline.
nomedm|medm
Specifies whether the script should open various MEDM screen show Omega status (program execution status, motor servo status, and etc). By default the screens are popped up.
nomail|mail
Specifies whether the script should email collected log about Omega status. By default the log is emailed.

optimizeFluorescence.pl
 

Purpose:
This script attempts to optimize fluorescence signal by finding correct attenuation and moving the fluorescence detector in/out. It also optimizes I0 signal by setting appropriate gain on the Keithley amplifier. If the detector was originally in parked position (given by 23x:bi:SCAN:fluParkDistance), the script records initial beamline energy and attenuation as well Keithley gain that can be later restored with parkFluoDetector.pl.

GUI:
The script is called from the JBluIce Scan tab when pressing 'Optimize fluor. signal' button and from the TOOLS menu on EPICS Toolbar.

Syntax:
optimizeFluorescence.pl [beamline] [noMCA] [noI0] [deadtime=xx] [gotoEdge|gotoEdgeSmall|gotoEdgeNone] [i0=name] [countTime=xx] [bluice|nobluice] [powercycle|nopowercycle] [bringPinDiode|bringBeamStop] [aboveEdgeEV=xx] [attenuationStart=nn] [attenuationMax=nn] [MCAmin=xx] [I0min=xx]

beamline
Beamline specification. Possible values are 23i, 23o, or 23b. The default is current beamline.
noMCA
Disables fluorescence signal optimization. With this option only I0 signal is optimized. The default is to optimize fluorescence signal
noI0
Disables I0 optimization. With this option the script will not be trying to find optimal Keithley amplifier gain for I0. The default is to optimize I0.
deadtime=xx
Sets MCA deadtime target for optimizing fluorescence signal. The default is 10%.
gotoEdge|gotoEdgeSmall|gotoEdgeNone
Specifies if the script should change beamline energy to the absorption edge chosen in JBluIce before starting the optimization. The default is 'gotoEdgeNone', which means not doing any energy change. The 'gotoEdge' requests pre-tuning beamline to the edge using bigEnergyMove.pl, which may involve invoking beam re-alignment with alignMiniBeam.pl. The 'gotoEdgeSmall' allows only small energy changes when the Bragg angle would not alter by more than 1 degr. This guarantees that beam re-alignment will not be invoked. If the beamline needs a large energy change to get to the absorption edge, the script will report an error.
i0=name
Specifies I0 signal name as per mySQL table of beamline signals. Possible values could be 'I0', 'Pin', 'Beamstop', and etc. The default is 'I0'.
countTime=xx
Specifies Struck scaler and MCA counting time when doing intensity measurements in the course of optimizations. The default is 0.5s.
bluice|nobluice
Specifies option of reporting script progress to JBluIce. The default is 'yes'.
powercycle|nopowercycle
Specifies whether the Ketek detector should be power cycled before starting optimization. The default is 'no'.
bringPinDiode|bringBeamStop
Requests to bring beamstop or pindiode IN using sample environment service. The default is to bring IN beamstop.
aboveEdgeEV=xx
Specifies how far above the edge should we set X-ray energy before optimizing the detector. Acceptable values are 10-200 eV and the defaults are 50eV for 23IDD and 150eV for the rest.
attenuationStart=nn
Specifies starting beam attenuation when doing fluorescence signal optimization. The default is 100x (may depend on beamline).
attenuationMax=nn
Specifies maximum beam attenuation when doing fluorescence signal optimization. The default is 100x (may depend on beamline).
MCAmin=nn
Specifies minimum acceptable MCA count rate. The default depends on MCA: 100 for Canberra and 4000 for Falcon. When count rate is below the MCA threshold, the dead time increases up to 100%, which is counter-intuitive (we decrease count rate to decrease dead time).
I0min=nn
Specifies minimum acceptable I0 count rate. The default is 1000x.

parkFluoDetector.pl
 

Purpose:
This script moves fluorescence detector back to parking position and restores original beam energy and attenuation and Keithley amplifier gain from the values before fluorescence works, as recorded by optimizeFluorescence.pl in the 23x:bi:SCAN:nonFluLastEnergy, 23x:bi:SCAN:nonFluLastAttenu and 23x:bi:SCAN:nonFluLastGainI0 EPICS PVs, respectively.

GUI:
The script is called from the JBluIce Scan tab when pressing 'Done with fluorescence' button.

Syntax:
parkFluoDetector.pl [beamline] [restoreEnergy|keepEnergy]

beamline
Beamline specification. Possible values are 23i, 23o, or 23b. The default is current beamline.
restoreEnergy|keepEnergy
Specifies in beamline energy should be restored to the value before starting fluorescence works (at the time of calling optimizeFluorescence.pl when the fluorescence detector was parked). The default is to keep current energy.

peakfit.pl

Purpose:
This script displays a plot of data in a given file along with respective Gaussian and Loretzian fits and prints fitting parameters. respective. It deploys the 'peakFit' function provided by common_PDL.pl. The later makes use of the Perl PDL lmfit function implementing the Marquardt-Levenberg non-linear least squares fitting algorithm.

GUI:
Not available.

Syntax:
peakfit.pl file [X] [Y1] [IMG|PNG|PS|PDF]

file
Specifies data file, an ASCII file where each line contains data as 'X1 [X2...] Y1 [Y2...]'.
X
Specifies the file column containing X data. The default 1.
Y
Specifies the file column containing Y data. The default 2.
IMG|PNG|PS|PDF
Request the plot to be saved in an image file. The 'IMG' and 'PNG' keywords are synonyms. The name of output file will be constructed as file.png or file.ps or file.pdf.

plot.pl
 

Purpose:
This script is a frontend to GNUplot. Depending on command line switches, it either plots specified file on the screen, or creates the plot as PNG or postscript file. The X-Y columns in the file are selectable via command line arguments. For plotting multiple files together on single screen, see plt.pl

GUI:
There is no graphical frontend, but there is a similar (although less flexible) GUI frontend to GNUplot called plot.tcl.

Syntax:
plot.pl file [X] [Y1,Y1,Y1...] [Y2,Y2,Y2...] [IMG|PNG|PS|PDF[batch]] ['title']

file
Specifies data file. This parameter should be the first in command line.
X
Specifies the X column number. The default is 1.
Y1,Y1,Y1...
Specifies the Y column(s) to be displayed normalized with respect to the left Y-axis of the plot. Multiple comma-separated numbers can be specified. The default is 2.
Y2,Y2,Y2...
Specifies the Y column(s) to be displayed normalized with respect to the right Y-axis of the plot. Multiple comma-separated numbers can be specified. The default is none.
IMG|PNG|PS|PDF[batch]
Specifies if the plot should be saved as image instead of being displayed on the screen. The 'IMG' and 'PNG' keywords are synonyms. The name of output file will be constructed as file.png or file.ps or file.pdf. After the file is produced, it is displayed with an external program like eog, gv or acroread. This can be suppressed by appending 'batch' to the image type (eg. 'PNGbatch').
'title'
Specifies title to the plot. The default is no title.

plt.pl

Purpose:
This script is a frontend to GNUplot. It plots specified file(s) on screen. The script can plot multiple files on the same screen or a series of screens. For plotting multiple columns of the same file on one plot and producing plots as images, see plot.pl.

GUI:
Not available.

Syntax:
plt.pl [-pause] [-delay=nn] [-singles] [-lines] [x:y] fileglob [fileglob] ...

-pause
Requests the script to display "Hit key to continue" button before plotting each next data file. The default is 'no'.
-delay=nn
Requests the script to wait nn seconds before plotting each next data file. The default delay is 1s.
-singles
Requests the script to plot each file separately. The default is to display files on the same plot with the previous files.
-lines
Requests the script to plot data files with lines instead of lines+boxes, which are the default.
x:y
Specifies X and Y column numbers in the files. The default is 1:2.
fileglob
Specifies fileglob for input files. Multiple fileglobs are allowed, but all fileglobs should be placed at the end of command line.

pmacBackup.pl

Purpose:
This script gets PMAC request file from command line and based on the requests contained in that file, dumps PMAC variables into a dump file. Later on, the variables can be restored with pmacRestore.pl.

GUI:
Not available.

Syntax:
pmacBackup.pl pmac requestFile dumpFile [NONINTERACTIVE]

pmac
Specifies EPICS name of pmac, e.g. 'pmac10' or '23i:pmac20'. In the later case may request cross-beamline operation.
requestFile
Specifies the name of request file. The format of file must be compatible with PMC files produced by Delta Tau PeWin. Here is an example file structure:
; These are requests of motor-1 speed:
i116			; program speed
i122			; jog speed
i123			// home speed
dumpFile
Specifies the name of file to save PMAC data. The output file will be produced in a form compatible with PMC files of PeWin.
NONINTERACTIVE
Disables any dialogs.

NOTE: The order of first three command line arguments is mandatory.


pmacReset.pl

Purpose:
This script resets all macros in given PMAC. After that all motors controlled by that PMAC should be re-homed.

GUI:
Not available.

Syntax:
pmacReset.pl pmac

pmac
Specifies EPICS name of pmac, e.g. 'pmac10' or '23i:pmac20'. In the later case may request cross-beamline operation.

pmacRestore.pl

Purpose:
This script uploads given PMC file into given PMAC. It was written to work in pair with pmacBackup.pl, but should also upload any PMC files produced by Delta Tau PeWin.

GUI:
Not available.

Syntax:
pmacRestore.pl pmac pmcFile [notest]

pmac
Specifies EPICS name of pmac, e.g. 'pmac10' or '23i:pmac20'. In the later case may request cross-beamline operation.
pmcFile
Specifies the name of request file. The format of file must be compatible with PMC files produced by Delta Tau PeWin. Here is an example file structure:
; These are requests of motor-1 speed:
i116=14			; program speed
i122=14			; jog speed
i123=4			// home speed
notest
Disables testing that parameters were uploaded successfully. The default is to test. An example of testing: when processing the line 'i116=14', the script first uploads 'i116=14', then uploads 'i116', reads the response and compares it to '14'.

NOTE: The order of first two command line arguments is mandatory.


pointclickserver.pl

Purpose:
This script is a 'state-notation-like' server handling motion of Gonio head for JBluIce. The server receives three parameters via an auxiliary string PV:

  1. cameraNr (0=lowres 1=hires)
  2. required x in pixels
  3. required y in pixels

It also reads current camera zoom and gonio omega that are involved into calculating pixels->mm and geometry transformations respectively.
In case of problems the script aborts motion and sends error to JBluIce

GUI:
The script automatically started within VNC server on keithley computers. Then, it is interfaced via EPICS PV from JBluIce when an operator clicks on the hi- or low-resolution camera image.

Syntax:
pointclickserver.pl [beamline] [watchrobot|norobot]

beamline
Beamline specification. Possible values are 23i, 23o, or 23b. The default is current beamline.
watchrobot|norobot
Specifies whether sample automounter status should be watched when processing the click. When watching is on (the default behavior), the clicks are ignored if the robot is not in 'ready', 'paused' or 'warm_up' state.

NOTE: to avoid multiple instances, the script can only be started on keithley computers.


postab500.pl

Purpose:
This script provides beam positional feedback. It can be paused and resumed by other scripts and JBluIce via a set of EPICS PVs. This script is written and being maintained by Derek Yoder. At present it is not actively used due to lack of reliable BPM. See mostab.pl for actively use intensity feedback.

GUI:
Not available.

Syntax:
postab500.pl


ppuCheckSpeed.pl

Purpose:
This script measures PPU speed and sends out email if the speed gets slow It is supposed to be executed by cron every 10 minutes.

GUI:
Not available.

Syntax:
ppuCheckSpeed.pl


prepare_pilatus_fpe.pl

Purpose:
This script patches and recompiles the Pilatus FPE as needed.

GUI:
The script is called from marccdepics.pl.

Syntax:
prepare_pilatus_fpe.pl [external_enable|internal_advance]

external_enable|internal_advance
The Pilatus FPE source is automatically patched to enable or disable the EXTERNAL_ENABLE mode of shutterless data collection. Then, the source is recompiled as needed.

PVrestore.pl

Purpose:
This script reads PV names and values from a snap file and them loads them into EPICS. It takes two command line parameters: beamline and snap file. Any lines that are not understood in the snap file or do not start with the beamline name are ignored. The expected format of lines in the snap file is: PV N VALUES (only N=1 corresponding to scalar PVs is currently supported). That should be compatible with most snap files produced by EPICS BURT utility except for those containing snapshots of array PVs.

GUI:
Not available.

Syntax:
PVrestore.pl snapFile [beamline]

snapFile
Specifies a snapshot file in a format compatible with EPICS BURT with the exception it cannot contains array PV snapshots.
beamline
Beamline specification. Possible values are 23i, 23o, or 23b. The default is current beamline.

readmarlog.pl

Purpose:
This script tries to read MARCCD log file '/home/marccd/log/stdouterr.log' in real time and reports MAR errors whenever found (whenever it finds a line containing 'STATUS_CSV').

GUI:
Not available.

Syntax:
readmarlog.pl

NOTE: the script can only work on MAR computer where MAR log file is located.


readMCA.pl

Purpose:
This script reads reads either Canberra or Falcon (whatever is intalled at the beamline) MCA plot data stores it into a data file.

GUI:
Not available.

Syntax:
readMCA.pl outfile

outfile
Specifies output files.

readScanRecord.pl

Purpose:
This script reads EPICS Scan Record data and saves it in a file given as a command line argument. The scan record is the one defined as beamline default record in beamline.pl (usually '23x:1:scan1'). For option to specify scan record name, see 'readScanRecord2.pl'.

GUI:
Not available.

Syntax:
readScanRecord.pl dumpfile

dumpfile
Specifies dump file name. The file will have the following structure:
# date stamp
# scanrecord = record name
# npts = number of data lines
X1 [... Xn] Y1 [... Ym]
where 'n' and 'm' are the numbers of positioners and detectors set in the scan record. Those must be contiguous: for example, if the record is set with detectors 1, 2, and 4, the script will dump only detectors 1 and 2 since 3 is not set.

readScanRecord2.pl
 

Purpose:
This script reads EPICS Scan Record given as a command line argument and saves record data in a file given as the second command line argument.

GUI:
The GUI call is available through the SCANS menu on EPICS toolbar.

Syntax:
readScanRecord2.pl scanrec dumpfile

scanrec
Specifies EPICS scan record to be read. The name may or may not have beamline prefix and the prefix may refer to a beamline different from the one where the script is running.
dumpfile
Specifies dump file name. The file will have the following structure:
# date stamp
# scanrecord = record name
# npts = number of data lines
X1... [Xn] Y1.... [Ym]
where 'n' and 'm' are the numbers of positioners and detectors set in the scan record.

readStruck.pl

Purpose:
This script reads Struck scaler data from one input and stores it into a data file.

GUI:
Not available.

Syntax:
readStruck.pl input points outfile

input
Specifies Struck input to read
points
Specifies number of data points to read
outfile
Specifies output files.

NOTE: The order of input parameters in mandatory.


restoreLIA.pl

Purpose:
Restore lock-in amplifier settings from a file.

GUI:
This script is called from the Tools section of the EPICS toolbar.

Syntax:
restoreLIA.pl snapFile.lia [beamline]

snapFile.lia
Name of backup file (should have .lia extension)
beamline
Beamline specification. Possible values are 23i, 23o, or 23b. The default is current beamline.

robot_fix_gripper.pl

Purpose:
This script fixes gripper of the ALS-style automounter. The script works when:

  1. Robot is paused and robot's latest message is 'paused'
  2. The last-but-one robot message is 'ERR: check_empty:pin' or 'ERR: recover:pin'
  3. Robot gripper long is down

Under these conditions, the script does up to 3 times the following sequence of actions:

  1. Moves gripper short down
  2. Ungrips
  3. Moves gripper short up
  4. Grips (in case the pin is attached)
  5. Moves gripper long up
  6. Checks with laser sensor if pin is still stuck in gripper
  7. If the sensor shows no pin, ungrips and sets robot status to 'ready'
  8. If the pin is still stuck, move gripper long down and repeats the cycle

GUI:
Not available.

Syntax:
robot_fix_gripper.pl [beamline]

beamline
Beamline specification. Possible values are 23i, 23o, or 23b. The default is current beamline.

robot_test1.pl

Purpose:
This script tests ALS-style automounter by loading a set of pins for a set of cassettes of specified style in an infinite cycle until Ctrl+C is pressed. All these parameters are hardcoded and need to be edited for the test.

GUI:
Not available.

Syntax:
robot_test1.pl [beamline]

beamline
Beamline specification. Possible values are 23i, 23o, or 23b. The default is current beamline.

robot_test2.pl

Purpose:
This script tests ALS-style automounter by either sequentially or randomly loading ALL pins for ALL cassettes of specified style in an infinite cycle.

GUI:
Not available.

Syntax:
robot_test2.pl R[igaku]|A[LS] [random|sequential] [beamline]

R[igaku]|A[LS]
Specifies puck type: either ALS or Rigaku.
random|sequential
Specifies random or sequential loading order. The default is sequential.
beamline
Beamline specification. Possible values are 23i, 23o, or 23b. The default is current beamline.

robotWarmup.pl

Purpose:
NOTE: This script is obsolete!
This script can be called by MEDM screen or JBluIce in order to initiate manual warmup of robot gripper for a given period of time. It:

  1. Checks that warmup is not yet running.
  2. Reads duration of warmup from robot 'warmup_duration' PV
  3. Move gripper to dryer
  4. Starts drier and updates dryer countdown PV while warmup is in progress
  5. Parks gripper

GUI:
Not available.

Syntax:
robotWarmup.pl [beamline]

beamline
Beamline specification. Possible values are 23i, 23o, or 23b. The default is current beamline.

save_transfocator_state.pl

Purpose:
Save curent Transfocator state (date, position, energy, focal distance) in a waveform PV 23x:focusPositionHistory.

GUI:
Not available.

Syntax:
save_transfocator_state.pl


saveCRL.pl
 

Purpose:
Save good-focus CRL positions in mySQL table and display already saved positions. Data can be used by the bigEnergyMove.pl script for automated retuning the CRLs to new energy. That is why it is important that only good positions are stored.

GUI:
The script is a GUI by itself. It is available through the staff MOTION menu on EPICS toolbar in the CRL positioners section.

Syntax:
saveCRL.pl


sampleEnv.pl
 

Purpose:
This script (now obsolete in favor of sampleEnvSrv.pl) was used to be called by JBluIce in order to safely control sample environment (collimator, pin diode, beamstop, backlight, ringlight, and SONICC) and to avoid collisions and exposing the CCD to direct beam. It uses the "collision matrix" concept to resolve possible collision situations.

GUI:
The script was called (not anymore) from JBluIce and from JBluIce Assistant MEDM screen. It superseded the collimatorCtrl.pl script that had been lacking the collision matrix concept and did not handle SONICC.

Syntax:
sampleEnv.pl [beamline] [help|?] [printCollisions] [IN|OUT] [noCollimator|collimatorIN|collimatorOUT] [noBeamstop|beamstopIN|beamstopOUT] [noBacklight|backlightIN|backlightOUT] [nopindiode|pindiodeIN|pindiodeOUT] [noSonicc|soniccIN|soniccOUT] [ringlight=on|ringlight=value|ringlight=off|ringlight=skip] [backlight=on|backlight=value|backlight=off|backlight=skip] [handleGS|skipGS] [bluice|nobluice]

beamline
Beamline specification. Possible values are 23i, 23o, or 23b. The default is current beamline.
help|?
Prints command line syntax and exits.
printCollisions|?
Prints collision matrix and exits.
IN|OUT
Specifies combined operations: IN=collimatorIN,beamstopIN,backlightOUT; OUT=collimatorOUT,beamstopOUT,backlightIN. These key are processed first and can be overwritten by IN/OUT keys for individual elements.
noCollimator|collimatorIN|collimatorOUT
Specifies moving options for collimator.
noBeamstop|beamstopIN|beamstopOUT
Specifies moving options for beamstop.
noBacklight|backlightIN|backlightOUT
Specifies moving options for backlight.
nopindiode|pindiodeIN|pindiodeOUT
Specifies moving options for pin diode.
ringlight=on|ringlight=value|ringlight=off|ringlight=skip
Specifies options of changing ring light brightness. When the light is requested OFF, the last ON value is backed up. When the light ON is requested, the backed brightness is used. The value is on the DAC scale. The default is skip changing brightness.
backlight=on|backlight=value|backlight=off|backlight=skip
Specifies options of changing back light brightness. When the light is requested OFF, the last ON value is backed up. When the light ON is requested, the backed brightness is used. The value is on the DAC scale. The default is skip changing brightness.
handleGS|skipGS
Specifies if the guard slits should be opened to a minimum size specified on the JBluIce config MEDM screen when 20um, 10um or 5um collimator is moved IN. The default handle the guard slits, but if the guard slits are wider than those minimum values, they are not touched. Also, they are not touched on collimator OUT operation.
bluice|nobluice
Requests sending messages to JBluIce logs and doing popups via JBluIce or not. The default is to send the messages.

sampleEnvSrv.pl
 

Purpose:
This script runs on Keithley computers as a server reading commands from the "23x:bi:sampleEnv" PV (x=i,o,b). The server is interfaced from JBluIce and JBluIce Assistant MEDM screen to safely control sample environment (collimator, pin diode, beamstop, backlight, ringlight, and SONICC) by avoiding their collisions and eliminating the CCD expose to direct beam. It uses the "collision matrix" concept to resolve possible collision situations. It supercedes sampleEnv.pl and collimatorCtrl.pl used in the past.

GUI:
The script is a server interfaced from JBluIce and from JBluIce Assistant MEDM screen as well as from any beamline software needing to control sample invironment.

Syntax:
sampleEnvSrv.pl [beamline]

beamline
Beamline specification. Possible values are 23i, 23o, or 23b. The default is current beamline.

Acceptable commands:
[help|?] [printCollisions] [getStates] [IN|OUT]'."\n"; [noCollimator|collimatorIN|collimatorOUT] [noBeamstop|beamstopIN|beamstopOUT] [noBacklight|backlightIN|backlightOUT] [noPindiode|pindiodeIN|pindiodeOUT] [noSonicc|soniccIN|soniccOUT] [ringlight=on|ringlight=value|ringlight=off|ringlight=skip] [backlight=on|backlight=value|backlight=off|backlight=skip] [handleGS|skipGS]

help|?
Prints list of acceptable commands on the Keithley screeen and a JBluIce popup
printCollisions|?
Prints collision matrix on the Keithley screeen and a JBluIce popup.
getStates
Returns a list of all sample environment states in the form e.g. "; Collimator=in Beamstop=in Pindiode=out Backlight=out SONICC=out". The states string is returned in the "23x:bi:sampleEnv" PV.
IN|OUT
Specifies combined operations: IN=collimatorIN,beamstopIN,backlightOUT; OUT=collimatorOUT,beamstopOUT,backlightIN. These key are processed first and can be overwritten by IN/OUT keys for individual elements.
noCollimator|collimatorIN|collimatorOUT
Specifies moving options for collimator.
noBeamstop|beamstopIN|beamstopOUT
Specifies moving options for beamstop.
noBacklight|backlightIN|backlightOUT
Specifies moving options for backlight.
nopindiode|pindiodeIN|pindiodeOUT
Specifies moving options for pin diode.
ringlight=on|ringlight=value|ringlight=off|ringlight=skip
Specifies options of changing ring light brightness. When the light is requested OFF, the last ON value is backed up. When the light ON is requested, the backed brightness is used. The value is on the DAC scale. The default is skip changing brightness.
backlight=on|backlight=value|backlight=off|backlight=skip
Specifies options of changing back light brightness. When the light is requested OFF, the last ON value is backed up. When the light ON is requested, the backed brightness is used. The value is on the DAC scale. The default is skip changing brightness.
handleGS|skipGS
Specifies if the guard slits should be opened to a minimum size specified on the JBluIce config MEDM screen when 20um, 10um or 5um collimator is moved IN. The default handle the guard slits, but if the guard slits are wider than those minimum values, they are not touched. Also, they are not touched on collimator OUT operation.

sampleEnvWrapper.pl
 

Purpose:
This script is a command line interface to Sample Environment Server (sampleEnvSrv.pl). It can be used by software which lacks EPICS interface or cannot send commands via "23x:bi:sampleEnv" PV for some other reason.

GUI:
None.

Syntax:
sampleEnvWrapper.pl [cmd1] [cmd2] [cmd3] ...

cmd1, cmd2, cmd3, ...
are any commands acceptable by sampleEnvSrv.pl (see above). The script forwards them to the server without syntax checking. In case one of commands is "getStates" it is sent last after all execution commands and the response is parsed and printed to STDOUT.

saveMaxSpeeds2sql.pl

Purpose:
This script calculates maximum speeds of Gonio Omega and Crystal XYZ and saves them in the Config table of mySQL for JBluIce. The script is normally called by user_setup.pl.

GUI:
Not available.

Syntax:
saveMaxSpeeds2sql.pl [beamline]

beamline
Beamline specification. Possible values are 23i, 23o, or 23b. The default is current beamline.

selectMono.pl

Purpose:
This script written for BioCAT Sector 18ID beamline selects active beamline monochromator (1 or 2):

  1. The shutter is disabled.
  2. The selected mono is enabled and moved to the nominal position.
  3. The other mono is moved to the through position.
  4. The shutter is disabled.

GUI:
Not available.

Syntax:
selectMono.pl [mono_number]

mono_number
Specifies monochromator number to become active (1 or 2). If this parameter is not given, the active monochromator is swapped.

set_inposband.pl

Purpose:
This script reads the JBluIce 'PmacMotorAssembly' table in mySQL and fills it with InPos band data for most of motors used by JBluIce except for complex ones (detector and mono energy). The script has two hardcoded parameters:

  1. The list of exceptions (skipped axes), which currently contain detector two-theta and mono energy.
  2. A factor to set InPos data for JBluIce a bit higher than in EPICS. Currently set to 1.5.

GUI:
Not available.

Syntax:
set_inposband.pl [beamline]

beamline
Beamline specification. Possible values are 23i, 23o, or 23b. The default is current beamline.

setMonoHKL.pl

Purpose:
This script sets monochromator to a specified Bragg reflection, either 111 or 333.

GUI:
Not available.

Syntax:
setMonoHKL.pl hkl [beamline] [bluice|nobluice]

hkl
Requested indices of Bragg reflection, 111 or 333. If the indices coinside with currently used, the script does nothing.
beamline
Beamline specification. Possible values are 23i, 23o, or 23b. The default is current beamline.
bluice|nobluice
Requests sending messages to JBluIce logs and doing popups via JBluIce or not.

setTransfocatorLabelsFromSQL.pl

Purpose:
This script fills EPICS DESC fields for transfocator lense groups from respective SQL labels. Only non-existing EPICS labels are filled unless "force" or "overwrite" is specified in the command line.

GUI:
Not available, but may be called from the Transfocator MEDM screen.

Syntax:
setTransfocatorLabelsFromSQL.pl [beamline] [force|overwrite]

beamline
Beamline specification. Possible values are 23i, 23o, or 23b. The default is current beamline.
force|overwrite
Instructs the script to overwrire EPICS labels (the DESC fields) even if the are not empty.

SONICCdisplay.pl
 

Purpose:
This script reads a TXT-formatted SONICC image, converts it into PNG, displays on the screen and shows mouse coordinates in pixels.

GUI:
This script is a GUI by itself.

Syntax:
SONICCdisplay.pl [TXTimage] [scale=log|scale=linear]

TXTimage
Specifies TXT image produced by the SONICC instrument. If the image is not specified, the script popups a file selection dialog.
dumpFile
Specifies intensity scale for displaying the image. The default is 'log'.

SONICCscan.pl
 

Purpose:
This script implements SONICC scan by sending commands to the SONICC instrument via EPICS, then reads the TXT-formatted SONICC images produced by the scan, converts them into PNG, displays on the screen and sends mouse click on the image to the GM/CA point&click server.

GUI:
This script is a GUI by itself.

Syntax:
SONICCdisplay.pl


SRbackup.pl

Purpose:
This script backups all Scan Record parameters to a file given as a command line argument. It is not saving record name, so that later on the data can be loaded into another scan record. This script is complemented with SRrestore.pl.

GUI:
Not available.

Syntax:
SRbackup.pl scanRecord dumpFile

scanRecord
Specifies full EPICS name of scan record.
dumpFile
Specifies name of file to save scan record parameters.

SRrestore.pl

Purpose:
This script restores all Scan Record parameters from a file given as a command line argument and previously created by SRbackup.pl. The backups produced by SRbackup.pl do not contain record name, so that SRrestore can load data into another scan record. At that point, beamline prefix is checked in the string data and replaced when data is moved to a different beamline.

GUI:
Not available.

Syntax:
SRrestore.pl scanRecord dumpFile

scanRecord
Specifies full EPICS name of scan record.
dumpFile
Specifies name of file with saved scan record parameters.

sshdconf2requireip.pl

Purpose:
This script converts AllowedUsers from /etc/ssh/sshd_config to /mnt/software/http_require.cfg. It runs daily on px0 and compiles list of staff IP addresses for accessing www:/local.

GUI:
Not available.

Syntax:
sshdconf2requireip.pl


struckBkg.pl

Purpose:
This script measures background intensity in Struck scaler inputs 1 to 32. The intensity is measured with closed shutter and recorded into 'struck_Bkg.dat'. The darks file produced by the script is used by many older-style scripts to subtract background from the signal. However, the file must be present in their current working directory and there is no check that it was produced with the same Keithley amplifier gain. To overcome these limitations, newer scripts use darks recorded at all Keithley gains and stored in mySQL. See measureDark1.pl and measureDarks.pl, which produce more modern darks data.

GUI:
Not available.

Syntax:
struckBkg.pl


syncFoilsDB.pl

Purpose:
This script compares attenuation foils data in MySQL EpicsShutter database and in the EPICS PV descriptions and asks to update the PV data if a difference is found.

GUI:
Not available.

Syntax:
syncFoilsDB.pl [beamline] [backup|backup=filename] [noninteractive]

beamline
Beamline specification. Possible values are 23i, 23o, or 23b. The default is current beamline.
backup|backup=filename
Request to backup EPICS data to a file. If filename is not specified, it is takes as beamline_foils_YYYY_MM_DD.sav
noninteractive
Instruct the script to skip any dialogs.

syncSampleNumber.pl

Purpose:
This script corrects the bi:scr:sampleNumber PV if it contains a number less than in the SQL table. It is called at startup of Keithley IOC to correct possible errors due to EPICS save/restore having not the latest number.

GUI:
Not available.

Syntax:
syncSampleNumber.pl [beamline]

beamline
Beamline specification. Possible values are 23i, 23o, or 23b. The default is current beamline.

tclconfig2axes.pl

Purpose:
This script parses config23x.tcl, finds all PMAC axes available at beamline and stores their list in '/home/gmca/epics/fastscans/data/axes_23x.dat'.

GUI:
Not available.

Syntax:
tclconfig2axes.pl [beamline]

beamline
Beamline specification. Possible values are 23i, 23o, or 23b. The default is current beamline.

timeslice.pl

Purpose:
This script implements a time-slicing scan. It uses Struck scaler to record fast evolving processes with up to 5 microsecond resolution. The start of Struck scaler is triggered by shutter opening. The Struck dwell time, number of data points, Struck inputs to record and the name of output file are all hardcoded. User is supposed to take a copy of the script and edit it for his/her specific needs.

GUI:
Not available.

Syntax:
timeslice.pl


toastMotor.pl

Purpose:
This script toasts any PMAC-controlled servo motor between the two coordinates specified in the command line.

GUI:
Not available.

Syntax:
toastMotor.pl Assembly Axis LOWERcoord UPPERcoord

Assembly
Specifies motor assembly.
Axis
Specifies motor axis.
LOWERcoord
Specifies lower toasting coordinate.
UPPERcoord
Specifies upper toasting coordinate.

toastSlit.pl

Purpose:
This script toasts center or size of collimator slit (monochromatic beam slit) between the two coordinates specified in the command line.

GUI:
Not available.

Syntax:
toastSlit.pl XC|XS|YC|YS LOWERcoord UPPERcoord

XC|XS|YC|YS
Specifies slit axis to toast.
LOWERcoord
Specifies lower toasting coordinate.
UPPERcoord
Specifies upper toasting coordinate.

trackMotor.pl

Purpose:
This script tracks motion of a Servo Motor and in case of problems aborts motion and sends error to JBluIce

GUI:
Not available.

Syntax:
trackMotor.pl beamline Assembly Axis

beamline
Specifies beamline name. Possible values are 23i, 23o, or 23b.
Assembly
Specifies motor assembly, 23i:GS:Av
Axis
Specifies motor axis, 23i:GS:ZC

NOTE: All parameters must be placed in the specified order.


transfocatorMakeDB.pl

Purpose:
This script calculates sum(1/(focus*$delta) for all possible combinations of transfocator lenses, i.e. for 2^n states (for n=21, 2^21=2,097,152 and for n=19, 2^19=524,288). Then it records it in mySQL (the previous table is overwritten).

GUI:
Not available.

Syntax:
transfocatorMakeDB.pl


transfocatorServer.pl
 

Purpose:
This script serves as transfocator server setting up requested focus and displaying current focal distance depending on energy and CRL in/out.

GUI:
Graphical interface is available through the TOOLS menu on EPICS toolbar. It consists of a MEDM screen, which has a button to launch the server. Keep in mind that in order to avoid multiple instances, the server can be started on ws2 only.

Syntax:
transfocatorServer.pl [beamline] [useShift|noShift] [useWeight|noWeight]

beamline
Specifies beamline name. Possible values are 23i, 23o, or 23b. The default is current beamline.
useShift|noShift
Take into account or ignore transfocator upstream/downstream shift in final focus.
useWeight|noWeight
Take into account or ignore the shift of the transfocator center of gravity depending on lenses in/out in final focus.

unlink32.pl

Purpose:
This script unlinks PMAC virtual motor (typically motor 32) from any coordinate system in given PMAC.

GUI:
The GUI call is available through the MOTION menu on EPICS toolbar.

Syntax:
unlink32.pl pmac [beamline]

pmac
Specifies EPICS name of pmac, e.g. 'pmac20' or '23i:pmac20'. In the later case the name specifies beamline, which cannot be combined with separate beamline specification.
beamline
Specifies beamline name. Possible values are 23i, 23o, or 23b. The default is current beamline.

update_jdk8.pl

Purpose:
This script checks Oracle depository for the latest JDK-8 RPM and compares it with the installed JDK-8 RPM. If the Oracle version is newer, it is downloaded and the RPM is updated with the help of YUM.

GUI:
Not available.

Syntax:
update_jdk8.pl


update_jdk9.pl

Purpose:
This script checks Oracle depository for the latest JDK-9 RPM and compares it with the installed JDK-8 or JDK-9 RPM. If the Oracle version is newer, it is downloaded and the RPM is updated with the help of YUM.

GUI:
Not available.

Syntax:
update_jdk9.pl


updateCollimatorPresets.pl

Purpose:
This script saves current collimator H- and V-positions as new presets for currently active collimator. Here is the sequence of actions:

  1. Reading current active collimator preset.
  2. Reading current collimator horizontal position.
  3. Reading current collimator vertical position.
  4. Reading current collimator horizontal preset.
  5. Reading current collimator vertical preset.
  6. Checking that planned preset changes do not exceed a threshold (a hardcoded value of 50um).
  7. Writing current collimator horizontal position as a new H-preset.
  8. Writing current collimator vertical position as a new V-preset.

GUI:
Not available.

Syntax:
updateCollimatorPresets.pl [beamline]

beamline
Specifies beamline name. Possible values are 23i, 23o, or 23b. The default is current beamline.

user_setup.pl|user_setup3.pl
 

Purpose:
This script sets some standard beamline parameters for a users and creates a log of current beamline settings. Among other actions, the script calls measureMiniBeam.pl, moveMotor.pl, mtrPositionsBackup.pl, mirrorsBackup.pl, and collimatorCtrl.pl. The script was initially written by Derek Yoder. Version-3 brings many changes including a GUI frontend.

GUI:
Not available for user_setup.pl. user_setup3.pl is a GUI

Syntax:
user_setup3.pl [beamline] [pause] [inline] [extras] [debug] [simulate] [history=NN]

beamline
Specifies beamline name. Possible values are 23i, 23o, or 23b. The default is current beamline.
pause
Pause after each step
inline
Execute all scripts in the main window instead of starting xterm for each one
extras
Show extra operations at startup (default is to show only main operations
debug
Show debug messages and also add function test_perl() for testing external operations
simulate
Do not execute any steps, instead sleep 2s per step. Can be used to demo or debug the GUI
history=NN
days of history to show (the default is 28 and it can also be changed from the GUI).

user_setup_expectations.pl

Purpose:
The script written by Derek Yoder should never be called directly: it sets "historical values" for user_setup.pl which compares current beamline parameters with expected values.

GUI:
Not available.

Syntax:
The script is called from user_setup.pl and should not be called directly.


vectorCollectionClean.pl

Purpose:
This script cleans PVs related to vector data collection and disables vector collection in JBluIce.

GUI:
The script is called from JBluIce when a new JBluIce user is invoked.

Syntax:
vectorCollectionClean.pl [beamline]

beamline
Specifies beamline name. Possible values are 23i, 23o, or 23b. The default is current beamline.

verifyhfs.pl

Purpose:
This script finds all HFS/HFS+ partitions on the attached devices, checks them for errors with the help of Paragon Software chkhfs and then attempts to mount with the help of udisks. The script runs as user (no admin rights are required).

GUI:
Not available.

Syntax:
verifyhfs.pl


verifyConfigTcl.pl

Purpose:
This script verifies PMAC configuration lists in configNNN.tcl against EPICS data (tsub, pcs, mtrno, mtr/drv/axs names and count).

GUI:
Can be called from user_setup3.pl.

Syntax:
verifyConfigTcl.pl [beamline]

beamline
Beamline specification. Possible values are 23i, 23o, or 23b. The default is current beamline.

zenity.pl
 

Purpose:
This script is a simple emulator of Zenity (GTK+ dialog displayer), especially for MS Windows, although on Windows one can use a Zenity port by placella.com. The script can be called from many GM/CA Perl scripts when they need to display a message or a dialog and authentic Zenity is unavailable.

GUI:
This script is a GUI.

Syntax:
zenity.pl --title='title' --error|info|warning|notification|question|yesno --text='msg'

--title='title'
Specifies graphical window title.
--error|info|warning|notification|question|yesno
Specifies type of dialog box.
--text='msg'
Specifies dialog box message.