id4_common.plans.hkl_scans#

Diffractometer scan plans: th2th, hklscan, hscan, kscan, lscan, psiscan.

These all run on the active hklpy2 diffractometer (see hklpy2.user.set_diffractometer()). Most are thin wrappers over ascan() / lup() from base_scans; psiscan wraps hklpy2.scan_psi() because it owns its own inner loop.

Module Contents#

id4_common.plans.hkl_scans.th2th(tth_start, tth_end, number_of_points, time_per_point, detectors=None, lockin=False, dichro=False, fixq=False, vortex_sgz=False, g_sgz=False, per_step=None, md=None)#

Relative horizontal theta/2theta scan. It will scan the mu and gamma motors.

Parameters:
  • tth_start (float) – Relative 2theta start. The relative theta will be half of the 2theta.

  • tth_end (float) – Relative 2theta end. The relative theta will be half of the 2theta.

  • number_of_points (int) – Number of points to be measured.

  • time_per_point (float) – Measurement time per point.

  • 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

lup(), ascan()

id4_common.plans.hkl_scans.hklscan(h1, h2, k1, k2, l1, l2, number_of_points, time, detectors=None, lockin=False, dichro=False, vortex_sgz=False, g_sgz=False, per_step=None, md=None)#

Linear hkl trajectory scan.

Sweeps the active diffractometer’s (h, k, l) pseudo axes along a straight line in reciprocal space from (h1, k1, l1) to (h2, k2, l2) in number_of_points points. Delegates to ascan(); fixq is forced off because the scan is the trajectory.

Parameters:
  • h1 (float) – Initial and final h of the trajectory.

  • h2 (float) – Initial and final h of the trajectory.

  • k1 (float) – Initial and final k of the trajectory.

  • k2 (float) – Initial and final k of the trajectory.

  • l1 (float) – Initial and final l of the trajectory.

  • l2 (float) – Initial and final l of the trajectory.

  • number_of_points (int) – Number of points (inclusive of endpoints).

  • time (float) – Count time per point (seconds).

  • detectors (list, optional) – Detectors to read. If None, uses counters.detectors.

  • lockin (bool, optional) – Run as a lock-in scan. Requires pr_setup.config() to have been run beforehand.

  • dichro (bool, optional) – Run as a dichro scan. Requires pr_setup.config() beforehand. Switches the x-ray polarization at every point using the + - - + sequence, multiplying the point count by 4.

  • vortex_sgz (bool, optional) – Trigger the Vortex detector via softgluezynq. Requires both the vortex and sgz_vortex devices to exist.

  • g_sgz (bool, optional) – Add the pos_stream position-stream device to the scan so motor positions are captured through the softgluezynq pipeline.

  • per_step (callable, optional) – Hook for customizing the inner-loop messages. See bluesky.plan_stubs.one_nd_step() (the default).

  • md (dict, optional) – Metadata to add to the run start.

See also

ascan(), psiscan()

id4_common.plans.hkl_scans.hscan(start, stop, number_of_points, time, detectors=None, lockin=False, dichro=False, fixq=False, vortex_sgz=False, g_sgz=False, per_step=None, md=None)#

Sweep the active diffractometer’s h pseudo axis.

Thin wrapper around ascan(diff.h, start, stop, number_of_points, time, ...)() that tags the run with plan_name="hscan" so peak() can identify the scan axis.

Parameters:
  • start (float) – Initial and final h value.

  • stop (float) – Initial and final h value.

  • number_of_points (int) – Number of points (inclusive of endpoints).

  • time (float) – Count time per point (seconds).

  • detectors (list, optional) – Detectors to read. If None, uses counters.detectors.

  • lockin (bool, optional) – Run as a lock-in scan. Requires pr_setup.config() to have been run beforehand.

  • dichro (bool, optional) – Run as a dichro scan. Requires pr_setup.config() beforehand. Switches the x-ray polarization at every point using the + - - + sequence, multiplying the point count by 4.

  • fixq (bool, optional) – Fix the diffractometer hkl during the scan. Note: hkl is moved after the other motors.

  • vortex_sgz (bool, optional) – Trigger the Vortex detector via softgluezynq. Requires both the vortex and sgz_vortex devices to exist.

  • g_sgz (bool, optional) – Add the pos_stream position-stream device to the scan so motor positions are captured through the softgluezynq pipeline.

  • per_step (callable, optional) – Hook for customizing the inner-loop messages. See bluesky.plan_stubs.one_nd_step() (the default).

  • md (dict, optional) – Metadata to add to the run start.

See also

ascan(), hklscan(), kscan(), lscan()

id4_common.plans.hkl_scans.kscan(start, stop, number_of_points, time, detectors=None, lockin=False, dichro=False, fixq=False, vortex_sgz=False, g_sgz=False, per_step=None, md=None)#

Sweep the active diffractometer’s k pseudo axis.

Thin wrapper around ascan(diff.k, start, stop, number_of_points, time, ...)() that tags the run with plan_name="kscan" so peak() can identify the scan axis.

Parameters:
  • start (float) – Initial and final k value.

  • stop (float) – Initial and final k value.

  • number_of_points (int) – Number of points (inclusive of endpoints).

  • time (float) – Count time per point (seconds).

  • detectors (list, optional) – Detectors to read. If None, uses counters.detectors.

  • lockin (bool, optional) – Run as a lock-in scan. Requires pr_setup.config() to have been run beforehand.

  • dichro (bool, optional) – Run as a dichro scan. Requires pr_setup.config() beforehand. Switches the x-ray polarization at every point using the + - - + sequence, multiplying the point count by 4.

  • fixq (bool, optional) – Fix the diffractometer hkl during the scan. Note: hkl is moved after the other motors.

  • vortex_sgz (bool, optional) – Trigger the Vortex detector via softgluezynq. Requires both the vortex and sgz_vortex devices to exist.

  • g_sgz (bool, optional) – Add the pos_stream position-stream device to the scan so motor positions are captured through the softgluezynq pipeline.

  • per_step (callable, optional) – Hook for customizing the inner-loop messages. See bluesky.plan_stubs.one_nd_step() (the default).

  • md (dict, optional) – Metadata to add to the run start.

See also

ascan(), hklscan(), hscan(), lscan()

id4_common.plans.hkl_scans.lscan(start, stop, number_of_points, time, detectors=None, lockin=False, dichro=False, fixq=False, vortex_sgz=False, g_sgz=False, per_step=None, md=None)#

Sweep the active diffractometer’s l pseudo axis.

Thin wrapper around ascan(diff.l, start, stop, number_of_points, time, ...)() that tags the run with plan_name="lscan" so peak() can identify the scan axis.

Parameters:
  • start (float) – Initial and final l value.

  • stop (float) – Initial and final l value.

  • number_of_points (int) – Number of points (inclusive of endpoints).

  • time (float) – Count time per point (seconds).

  • detectors (list, optional) – Detectors to read. If None, uses counters.detectors.

  • lockin (bool, optional) – Run as a lock-in scan. Requires pr_setup.config() to have been run beforehand.

  • dichro (bool, optional) – Run as a dichro scan. Requires pr_setup.config() beforehand. Switches the x-ray polarization at every point using the + - - + sequence, multiplying the point count by 4.

  • fixq (bool, optional) – Fix the diffractometer hkl during the scan. Note: hkl is moved after the other motors.

  • vortex_sgz (bool, optional) – Trigger the Vortex detector via softgluezynq. Requires both the vortex and sgz_vortex devices to exist.

  • g_sgz (bool, optional) – Add the pos_stream position-stream device to the scan so motor positions are captured through the softgluezynq pipeline.

  • per_step (callable, optional) – Hook for customizing the inner-loop messages. See bluesky.plan_stubs.one_nd_step() (the default).

  • md (dict, optional) – Metadata to add to the run start.

See also

ascan(), hklscan(), hscan(), kscan()

id4_common.plans.hkl_scans.psiscan(psi_start, psi_stop, number_of_points, time, hkl=None, hkl2=None, orientation='horizontal', detectors=None, psi_axis=None, fail_on_exception=False, md=None)#

Azimuthal psi scan at fixed (h, k, l).

Wraps hklpy2.scan_psi, holding (h, k, l) fixed while sweeping the azimuthal extra parameter from psi_start to psi_stop in number_of_points points. Runs on the active diffractometer (e.g. huber_euler) — its hkl engine exposes the psi constant horizontal / psi constant vertical modes used here.

Parameters:
  • psi_start (float) – Azimuthal angle range (degrees).

  • psi_stop (float) – Azimuthal angle range (degrees).

  • number_of_points (int) – Number of points (inclusive of endpoints).

  • time (float) – Count time per point. Must be > 0.

  • hkl (sequence of float, optional) – Fixed reflection (h, k, l). If None (default), use the current diffractometer position.

  • hkl2 (sequence of float, optional) – Reference reflection (h2, k2, l2) defining psi=0. If None (default), read from the active diffractometer’s core.all_extras (the non-psi entries, in order). Must not be parallel to (h, k, l).

  • orientation ({'horizontal', 'vertical'}, optional) – Scattering plane. Selects the psi mode passed to hklpy2.scan_psi: "psi constant horizontal" (default) or "psi constant vertical".

  • detectors (list, optional) – Detectors to read. If None, uses counters.detectors.

  • psi_axis (str, optional) – Name of the psi extra axis. Auto-detected when None.

  • fail_on_exception (bool, optional) – Forwarded to hklpy2.scan_psi. When False (default), per-point forward-calculation failures are printed and the scan continues.

  • md (dict, optional) – Metadata to add to the run start.

Notes

Unlike ascan/grid_scan, this plan does not support dichro, lockin, fixq, or vortex_sgz because hklpy2.scan_psi runs its own inner loop and does not accept a per_step hook.

See also

hklpy2.scan_psi()