id4_common.plans.base_scans#
Local 1-D scan plans: count, ascan, lup, qxscan.
These are the polar-bits versions of the generic bluesky scan plans. They
add the standard polar-bits machinery (counters / dichro / lockin /
softgluezynq stage signals, NeXus writer subscription, baseline file paths)
on top of the underlying bluesky.plans calls.
Module Contents#
- id4_common.plans.base_scans.count(num, time, detectors=None, lockin=False, dichro=False, vortex_sgz=False, g_sgz=False, delay=None, per_shot=None, md=None)#
Take one or more readings from detectors.
This is a local version of bluesky.plans.count. Note that the per_shot cannot be set here, as it is used for dichro scans.
- Parameters:
num (integer) – number of readings to take If None, capture data until canceled
time (float) – If a number is passed, it will modify the counts over time. All detectors need to have a .preset_monitor signal.
detectors (list, optional) – List of ‘readable’ objects. If None, will use the detectors defined in counters.detectors.
lockin (boolean, optional) – Flag to do a lock-in scan. Please run pr_setup.config() prior do a lock-in scan.
dichro (boolean, optional) – Flag to do a dichro scan. Please run pr_setup.config() prior do a dichro scan. Note that this will switch the x-ray polarization at every point using the +, -, -, + sequence, thus increasing the number of points by a factor of 4
vortex_sgz (boolean, optional) – Measures the Vortex detector using the softgluezynq triggers. This is a special mode that requires the ‘vortex’ and ‘sgz_vortex’ devices to exist otherwise an error will be thrown.
delay (iterable or scalar, optional) – Time delay in seconds between successive readings; default is 0.
per_shot (callable, optional) – Hook for customizing action of inner loop (messages per step). See docstring of
bluesky.plan_stubs.one_nd_step()(the default) for details.md (dict, optional) – metadata
Notes
If
delayis an iterable, it must have at leastnum - 1entries or the plan will raise aValueErrorduring iteration.
- id4_common.plans.base_scans.ascan(*args, detectors=None, lockin=False, dichro=False, fixq=False, vortex_sgz=False, g_sgz=False, per_step=None, md=None)#
Scan over one multi-motor trajectory.
This is a local version of bluesky.plans.scan. Note that the per_step cannot be set here, as it is used for dichro scans.
- Parameters:
*args –
For one dimension,
motor, start, stop, number of points, time. In general: .. code-block:: pythonmotor1, start1, stop1, motor2, start2, start2, …, motorN, startN, stopN, number of points, time
Motors can be any ‘settable’ object (motor, temp controller, etc.)
detectors (list, optional) – List of detectors to be used in the scan. If None, will use the detectors defined in counters.detectors.
lockin (boolean, optional) – Flag to do a lock-in scan. Please run pr_setup.config() prior do a lock-in scan.
dichro (boolean, optional) – Flag to do a dichro scan. Please run pr_setup.config() prior do a dichro scan. Note that this will switch the x-ray polarization at every point using the +, -, -, + sequence, thus increasing the number of points by a factor of 4
fixq (boolean, optional) – Flag for fixQ scans. If True, it will fix the diffractometer hkl position during the scan. This is particularly useful for energy scan. Note that hkl is moved ~after~ the other motors!
vortex_sgz (boolean, optional) – Measures the Vortex detector using the softgluezynq triggers. This is a special mode that requires the ‘vortex’ and ‘sgz_vortex’ devices to exist otherwise an error will be thrown.
per_step (callable, optional) – hook for customizing action of inner loop (messages per step). See docstring of
bluesky.plan_stubs.one_nd_step()(the default) for details.md (dictionary, optional) – Metadata to be added to the run start.
See also
bluesky.plans.scan(),lup()
- id4_common.plans.base_scans.lup(*args, detectors=None, lockin=False, dichro=False, fixq=False, vortex_sgz=False, g_sgz=False, per_step=None, md=None)#
Scan over one multi-motor trajectory relative to current position.
This is a local version of bluesky.plans.rel_scan. Note that the per_step cannot be set here, as it is used for dichro scans.
- Parameters:
*args –
For one dimension,
motor, start, stop, number of points. In general: .. code-block:: pythonmotor1, start1, stop1, motor2, start2, start2, …, motorN, startN, stopN, number of points
Motors can be any ‘settable’ object (motor, temp controller, etc.)
detectors (list, optional) – List of detectors to be used in the scan. If None, will use the detectors defined in counters.detectors.
lockin (boolean, optional) – Flag to do a lock-in scan. Please run pr_setup.config() prior do a lock-in scan.
dichro (boolean, optional) – Flag to do a dichro scan. Please run pr_setup.config() prior do a dichro scan. Note that this will switch the x-ray polarization at every point using the +, -, -, + sequence, thus increasing the number of points by a factor of 4
fixq (boolean, optional) – Flag for fixQ scans. If True, it will fix the diffractometer hkl position during the scan. This is particularly useful for energy scan. Note that hkl is moved ~after~ the other motors!
vortex_sgz (boolean, optional) – Measures the Vortex detector using the softgluezynq triggers. This is a special mode that requires the ‘vortex’ and ‘sgz_vortex’ devices to exist otherwise an error will be thrown.
per_step (callable, optional) – hook for customizing action of inner loop (messages per step). See docstring of
bluesky.plan_stubs.one_nd_step()(the default) for details.md (dictionary, optional) – Metadata to be added to the run start.
See also
bluesky.plans.rel_scan(),ascan()
- id4_common.plans.base_scans.qxscan(edge_energy, time, detectors=None, lockin=False, dichro=False, fixq=False, vortex_sgz=False, g_sgz=False, per_step=None, md=None)#
Energy scan with fixed delta_K steps.
WARNING: please run qxscan_params() before using this plan! It will use the parameters set in qxscan_params to determine the energy points.
- Parameters:
edge_energy (float) – Absorption edge energy. The parameters in qxscan_params offset by this energy.
time (float) – If a number is passed, it will modify the counts over time. All detectors need to have a .preset_monitor signal.
detectors (list, optional) – List of detectors to be used in the scan. If None, will use the detectors defined in counters.detectors.
lockin (boolean, optional) – Flag to do a lock-in scan. Please run pr_setup.config() prior do a lock-in scan
dichro (boolean, optional) – Flag to do a dichro scan. Please run pr_setup.config() prior do a dichro scan. Note that this will switch the x-ray polarization at every point using the +, -, -, + sequence, thus increasing the number of points by a factor of 4
fixq (boolean, optional) – Flag for fixQ scans. If True, it will fix the diffractometer hkl position during the scan. Note that hkl is moved ~after~ the other motors!
md (dictionary, optional) – Metadata to be added to the run start.
See also
bluesky.plans.scan(),lup()