Simple ScansFerdi Franceschini2008-09-17 12:52runscan commandYou can run a histogram memory scan with the runscan command. With
this command you can acquire data with the histogram memory server while scanning
against a "drivable" device, eg motors, temperature controllers. By default this saves
time resolved, ie HISTOGRAM_XYT data at each scan point.Multi-dimensional scans, where you would like to scan say temperature and a motor,
have to be done in a batch file, or by using a tcl for loop, which
may contain a runscan. See Chapter5. Batch Manager The data acquired at each scan point is saved before going to the next
point.runscan scanvar start stop numpoints mode preset [force datatype
savetype]Arguments must be in the order describedscanvara drivable device, ie a motor or temperature controller etcstartthe start position for the scan variablestopthe stop position for the scan variablenumpointsthe number of scan points (the start and stop positions will be included
in the scan)modeAllowed mode one of:timeunlimitedperiodcountframeMONITOR_n (where n=1,2,3 ...)If you set the mode to MONITOR_1 then the histogram server will stop when
MONITOR_1 reaches the preset number of counts which has been set with the
following preset parameterpresetthe acquisition duration at each scan point, this is in second if the mode
is time, or counts if the mode is count or MONITOR_nrunscan These parameters must be supplied as a name-value pair, e.g.
datatypeThey can be given in any order.force valForce a scanAllowed val one of:
(default) If you really want to, you can force a scan when the instrument isn't
ready. This can be useful for getting a background reference. datatype valSelect the histogram memory datatype to save in your
data file. Allowed val one of:
(default)savetype valAllowed val one of:
(default) By default your data will be saved in a file with a three letter
instrument prefix and a run number. If you use savetype
then the data will be written to a scratch file
called scratch.nx.hdfrunscan examplerunscan This will run a four point scan with the sphi motor starting at 0 and stopping at 2.
The data will be acquired over five seconds at each point, with the default datatype
HISTOGRAM_XYT, and saved in a file with a three letter instrument prefix and run number.runscan examplerunscan MONITOR_2
3000 savetype datatype
force This example sets all runscan parametersbmonscan commandYou can run a beam monitor scan with the bmonscan command. With
this command you can acquire data with a counter in the histogram memory server while
scanning against a "drivable" device, eg motors. The main detector is not required.
Generally this would be used to align an instrument, e.g. alignment of a monochromator
or sample crystal.Additional information can be found in the chapters "Counters", "User Defined Scans"
and "Batch Manager". bmonscan will create a data file of type BEAM_MONITOR. Multi-dimensional scans have to be done in a batch file, or by using a tcl
for loop, which may contain a runscan. See the chapter "Batch
Manager".Unlike runscan, bmonscan is a standard SICS scan object. This means you can configure,
interrogate and control bmonscan using the commands in the chapter "User Defined Scans".
This section has only a summary of the most used commands, which allows you to do a one
variable scan. The data acquired at each scan point is saved before going to the next
point.bmonscan runNP mode preset Executes a scan. NP is the number of scan pointsmode is the counter mode, either
or preset is the preset value for the counterScan data is written to an output file.tree interface /commands/scan/bmonscan/NPtree interface /commands/scan/bmonscan/modetree interface
/commands/scan/bmonscan/presetbmonscan clearClears the list of scan variables. Must be called before each scan that
has different parameters. bmonscan addvariable start increment Adds the variable specified by the argument
variable to the list of variables scanned in the
next scan. The arguments start and
increment define the starting point and the
step width for the scan on this variable. tree interface
/commands/scan/bmonscan/scan_variabletree interface
/commands/scan/bmonscan/scan_starttree interface
/commands/scan/bmonscan/scan_incrementbmonscan getvarpariPrints the name, start and step of the scan variable number
itree interface
/commands/scan/bmonscan/scan_variablebmonscan setchannelnSets the beam monitor to collect data from, where
n is an integer ID for the beam monitor to use.
setchannel uses zero-based counting, so 0 is bm1 etc.tree interface /commands/scan/bmonscan/channelbmonscan examplebmonscan clear clears the list of scan variablesbmonscan add stth 0 0.1 adds the
motor stth to the scan, with a starting value of 0 degrees and an increment value
0.1 degreesbmonscan getvarpar 0 lets you check
the variable you are scanning, its start and step value. In this case it returns
bmonscan.stth = 0.000000 = 0.100000bmonscan setchannel 0 selects the
first beam monitor, aka bm1. You'll need to check physically where this beam monitor
is on the instrument you're drivingbmonscan run 10 monitor 10000 runs
the scan with 10 scan points, in counter mode with a preset of 10000 counts.