Simple Scans for TaipanFerdi Franceschini2008-09-17 12:52runscan commandYou can run a scan with the runscan command. This
runscan is unique to Taipan. Do not use the options below on any
other instrument. With this command you can acquire data with the beam monitor server
while scanning against a "drivable" device, eg motors, temperature controllers. This
saves count 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 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:timemonitorpresetthe acquisition duration at each scan point, this is in seconds if the
mode is time, or counts if the mode is monitorrunscan These parameters must be supplied as a name-value pair, e.g.
savetypeThey 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. 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 s2 motor starting at 0 and stopping at 2.
The data will be acquired over five seconds at each point and saved in a file with a
three letter instrument prefix and run number.runscan examplerunscan monitor
3000 savetype 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. diffskan commanddiffskanmilliseconds scanobj motor start stop speedRuns the counters continuously while the motor drives from start to end.milliseconds is the counter sampling intervalscanobj is the scan object. You should be able
to use any scan object but I've only tried it with iscan (you need iscan for
meshscan)motor is the name of the motor to be scannedstart the start position for the scan variablestop the stop position for the scan variablespeed is the speed of the scan variable in its
positional units per second, e.g. degrees per secondmesh commandmeshmot start [fname]The mesh command is currently hardwired to drive "mot" from "start" in steps of 1 unit to start +15 and then call diffskan on s1.
So the code needs to be edited for different ranges etcThe meshscan code was just cobbled together when Bob Aldus couldn't find a reflection so we needed to come up with something quickly.
It is an mix of ad-hoc tcl and python code and would need to be parameterised to be generally useful.