id4_common.devices.polar_diffractometer_hklpy2#

Polar diffractometer

Module Contents#

id4_common.devices.polar_diffractometer_hklpy2.WAVELENGTH_CONSTANT = 12.39#
id4_common.devices.polar_diffractometer_hklpy2.PTTH_MIN_DEGREES = 79#
id4_common.devices.polar_diffractometer_hklpy2.PTTH_MAX_DEGREES = 101#
id4_common.devices.polar_diffractometer_hklpy2.PTH_MIN_DEGREES = 39#
id4_common.devices.polar_diffractometer_hklpy2.PTH_MAX_DEGREES = 51#
id4_common.devices.polar_diffractometer_hklpy2.ANALYZER_LIST_PATH#
class id4_common.devices.polar_diffractometer_hklpy2.UBMatrixSignal(pv_name, *, parent=None, name=None, **kwargs)#

Bases: ophyd.Signal

In-memory ophyd Signal that wraps the UB matrix on the parent diffractometer.

Reads/writes parent.sample.UB and fires ophyd subscribers on put(), so other components can subscribe to UB matrix changes via .subscribe().

get(**kwargs)#

Return the parent diffractometer’s current UB matrix.

put(value, *, timestamp=None, force=False, **kwargs)#

Write the UB matrix back to the parent and notify subscribers.

class id4_common.devices.polar_diffractometer_hklpy2.AnalyzerDevice#

Bases: ophyd.PseudoPositioner

Crystal polarization analyzer with pseudo-energy axis and crystal setup.

energy#
th#
tth_trans#
th_motor#
tth#
eta#
chi#
d_spacing#
crystal#
tth_detector_distance#
tracking#
move_single(pseudo, position, **kwargs)#

Guard move_single to require analyzer setup before moving energy.

property beamline_wavelength#

Return the current beamline wavelength from the parent diffractometer beam object.

property beamline_energy#

Return the current beamline energy in keV from the parent diffractometer beam object.

convert_energy_to_theta(energy)#

Convert photon energy (keV) to Bragg angle (degrees) using the crystal d-spacing.

convert_energy_to_tth_trans(energy)#

Convert photon energy (keV) to the two-theta translation stage position (mm).

convert_theta_to_energy(theta)#

Convert Bragg angle (degrees) to photon energy (keV) using the crystal d-spacing.

forward(pseudo_pos)#

Run a forward (pseudo -> real) calculation

inverse(real_pos)#

Run an inverse (real -> pseudo) calculation

set_energy(energy)#

Calibrate the Bragg-angle motor to match the given photon energy (keV).

calc(acal='No')#

Print analyzer Bragg angles for the current crystal at the current beamline energy.

setup(analyzer_energy=None, analyzer_list_path=ANALYZER_LIST_PATH)#

List compatible analyzer crystals and interactively configure d-spacing and crystal.

class id4_common.devices.polar_diffractometer_hklpy2.DiffractometerMixin#

Bases: ophyd.Device

Mixin adding table, area-detector, filter, slit, and analyzer components to a diffractometer.

tablex#
tabley#
pad_rail#
point_rail#
filter#
detslt#
ana#
property hints#

Return only explicitly-hinted sub-components to avoid busy plotting.

Kind is a bitfield: Kind.hinted (0b101) shares the Kind.normal bit (0b001). _get_components_of_kind(Kind.hinted) therefore yields both normal and hinted components. The mask (~Kind.normal & Kind.hinted) isolates the “hinted-only” bit so only components explicitly tagged Kind.hinted contribute fields.

property auxiliary_axis_names#

Drop nested PseudoPositioner sub-devices from auxiliaries.

hklpy2’s wh(full=True)/pa() formats each auxiliary axis with round(component.position, ndigits=...). PseudoPositioner sub-devices (e.g. ana) return a PseudoPosition namedtuple, which has no __round__ and crashes the print step. Filter them out here; scalar single-axis auxiliaries (the case hklpy2 was designed for) still pass through.

default_settings()#

Apply default settings for the diffractometer mixin (no-op; subclasses override).

class id4_common.devices.polar_diffractometer_hklpy2.DeferredEpicsMonochromatorRO#

Bases: hklpy2.incident.EpicsMonochromatorRO

EpicsMonochromatorRO whose wavelength/energy don’t block on init.

See _DeferredEpicsSignalRO for the rationale. Used as the beam component for the POLAR diffractometers so they can be instantiated while the VDCM IOC is offline.

wavelength#
energy#
id4_common.devices.polar_diffractometer_hklpy2.mono_kwargs#
id4_common.devices.polar_diffractometer_hklpy2.CradleDiffractometerBase#
class id4_common.devices.polar_diffractometer_hklpy2.CradleDiffractometer#

Bases: DiffractometerMixin, CradleDiffractometerBase

hklpy2 APS-POLAR cradle diffractometer with sample XYZ translation.

x#
y#
z#
id4_common.devices.polar_diffractometer_hklpy2.HPDiffractometerBase#
class id4_common.devices.polar_diffractometer_hklpy2.HPDiffractometer#

Bases: DiffractometerMixin, HPDiffractometerBase

hklpy2 APS-POLAR HP-press diffractometer with base, nano, and tilt motors.

chi#
phi#
basex#
basey#
basez#
basey_motor#
basez_motor#
sample_tilt#
x#
y#
z#
nanox#
nanoy#
nanoz#
xeryon#
id4_common.devices.polar_diffractometer_hklpy2.CradleDiffractometerPSI#
id4_common.devices.polar_diffractometer_hklpy2.HPDiffractometerPSI#