spec

Software for Diffraction

vscan

Variable Step Size Scans

DESCRIPTION

The vscan family of macros do variable step size scans over one or more motors or over reciprocal space coordinates. Usage for the single motor version is:

vscan mot start focus end intervals time [minstep|0 [expon]]

The scan arguments include a start, focus and end position for each scanned motor or reciprocal space coordinate, with point spacing being closest together at the specified focus, which can be anywhere within the scan range, including the end points.

Optional arguments specify a minimum step size and an exponent used in calculating the step spacing. For motor scans, if the minimum step size is unspecified or set to zero, the minimum step size will be the motor resolution. For reciprocal space scans, if unspecified, the minimum step size will be 1e-5. If the exponent is zero or unspecified, a default exponent of 1.2 is used.

If global variables VSCAN_EXPON, VSCAN_MINSTEP or VHKLSCAN_MINSTEP exist and have nonzero values, those values will be used as defaults. Macro arguments will override the defaults.

An exponent of zero results in evenly spaced points. An exponent of one gives logarithmic spacing between each end point and the focus. Values less than one spread the steps out more. Values greater than one concentrate the steps towards the specified focus.

The minimum step-size parameter can be set larger than the motor resolution to spread the points out around the focus. For the two motor scan, if the minimum step size is specified, that value is used for both motors. Otherwise, the minimum step size for each motor is its step resolution.

The step size at each position x is calculated as:

step = minstep + k * |x - focus|^expon

An iterative process is used to calculate the factor k given the minimum step size, scan range, focus and exponent. If there are too few steps over the range or for other unusual values the process to determine k may fail, in which case a warning is printed. If the minimum step size is too big for the range and number of steps, the scan is aborted.

The vscan macros all use the new array scan engine. Macros vscan through v4scan scan one to four motors. Macros dvscan through dv4scan are delta versions that return the scanned motors to their starting positions. Reciprocal space version are vhscan, vkscan, vlscan and vhklscan.

INTERNAL MACROS

The _vscan_factor() macro function is used by _vari_angle_scan_prep() and _vari_hkl_scan_prep(). The function iteratively calculates the sum of the steps in an inner loop and adjusts the k factor to minimize the difference (epsilon) between the sum of the steps and the requested range.

The iterations use a factor, k1, formed from the sum of a current value, k0, and an increment, delta. Initially, k0 is 0 and delta is 10.

The inner loop does a "break" if the accumulated range exceeds the specified range. When that happens the delta increment is halved and another iteration begins.

If the inner loop completes, then the accumulated range is less than the specified range. Epsilon is the difference. If epsilon is less than or equal to the previous minimum, the current factor k1 is assigned to k0. Otherwise the delta increment adjustment is halved.

When epsilon is less than half the minimum step size, the function returns the associated k factor. The function will also return after 40 iterations even if there is no convergence.

ACKNOWLEDGMENTS

The vscan algorithm is based on the uascan macro from the APS USAXS beamline.

GLOBALS

VSCAN_MINSTEP

VHKLSCAN_MINSTEP

VSCAN_EXPON

MACROS

vscan

dvscan

vhscan

vkscan

vlscan

vhklscan

_vscan_one_step(x, k, focus, exponent, minstep)

_vscan_factor(start, focus, end, steps, exponent, minstep)

_vari_angle_scan_prep

_vari_hkl_scan_prep



Warning: Undefined array key "related" in /home1/josetxoc/public_html/certif/functions.php on line 298