Simple Scans for Taipan Ferdi Franceschini 2008-09-17 12:52 <command>runscan </command>command You 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 described scanvar a drivable device, ie a motor or temperature controller etc start the start position for the scan variable stop the stop position for the scan variable numpoints the number of scan points (the start and stop positions will be included in the scan) mode Allowed mode one of: time monitor preset the acquisition duration at each scan point, this is in seconds if the mode is time, or counts if the mode is monitor <command>runscan </command> <option>options</option> These parameters must be supplied as a name-value pair, e.g. savetype They can be given in any order. force val Force a scan Allowed 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 val Allowed 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.hdf <command>runscan </command>example runscan 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. <command>runscan </command>example runscan monitor 3000 savetype force This example sets all runscan parameters <command>bmonscan </command>command You 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 run NP mode preset Executes a scan. NP is the number of scan points mode is the counter mode, either or preset is the preset value for the counter Scan data is written to an output file. tree interface /commands/scan/bmonscan/NP tree interface /commands/scan/bmonscan/mode tree interface /commands/scan/bmonscan/preset bmonscan clear Clears the list of scan variables. Must be called before each scan that has different parameters. bmonscan add variable 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_variable tree interface /commands/scan/bmonscan/scan_start tree interface /commands/scan/bmonscan/scan_increment bmonscan getvarpar i Prints the name, start and step of the scan variable number i tree interface /commands/scan/bmonscan/scan_variable bmonscan setchannel n Sets 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/channel bmonscan example bmonscan clear clears the list of scan variables bmonscan 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 degrees bmonscan 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.100000 bmonscan 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 driving bmonscan run 10 monitor 10000 runs the scan with 10 scan points, in counter mode with a preset of 10000 counts. <command>diffskan </command>command diffskan milliseconds scanobj motor start stop speed Runs the counters continuously while the motor drives from start to end. milliseconds is the counter sampling interval scanobj 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 scanned start the start position for the scan variable stop the stop position for the scan variable speed is the speed of the scan variable in its positional units per second, e.g. degrees per second <command>mesh </command>command mesh mot 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 etc The 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.