pcdsdevices.lodcm.LODCM

class pcdsdevices.lodcm.LODCM(prefix, *, name, main_line='MAIN', mono_line='MONO', **kwargs)

Large Offset Dual Crystal Monochromator.

This is the device that allows XPP and XCS to multiplex with downstream hutches. It contains two crystals that steer/split the beam and a number of diagnostic devices between them. Beam can continue onto the main line, onto the mono line, onto both, or onto neither.

Tower 1 has the Si and C crystals with 2 angles and 5 linear motions. Tower 2 has the second Si and C crystals and a diode behind the crystals.

Parameters:
  • prefix (str) – The PV prefix.

  • name (str) – The name of this device.

  • main_line (str, optional) – Name of the main, no-bounce beamline.

  • mono_line (str, optional) – Name of the mono, double-bounce beamline.

Ophyd Device Components

Attribute

Class

Suffix

Docs

Kind

Notes

lightpath_summary

SummarySignal

omitted

Inherited from LightpathMixin

yag

YagLom

:DV

omitted

dectris

Dectris

:DH

omitted

diode

Diode

:DIODE

omitted

foil

Foil

:FOIL

omitted

tower1 (FCpt)

CrystalTower1

{self._prefix}

normal

tower2 (FCpt)

CrystalTower2

{self._prefix}

normal

diag_tower (FCpt)

DiagnosticsTower

{self._prefix}

normal

energy_si (FCpt)

LODCMEnergySi

{self._prefix}

normal

energy_c (FCpt)

LODCMEnergyC

{self._prefix}

normal

energy_c1 (FCpt)

LODCMEnergyC1

{self._prefix}

normal

Methods

calc_geometry(energy, material=None, reflection=None)

Calculate the lom geometry.

Parameters:
  • material (str, optional) – Chemical formula. E.g.: Si

  • reflection (tuple, optional) – Reflection of material. E.g.: (1, 1, 1)

Returns:

th, z (tuple)

calc_lightpath_state(tower1_h1n_state_state: int | str) LightpathState

Create and return a LightpathState object containing information needed for lightpath, given a set of signal values

kwargs should be the same as the signal names provided in lightpath_cpts

Device logic goes here.

Returns:

LightpathState – a dataclass containing the Lightpath state

configure(d: Dict[str, Any]) Tuple[Dict[str, Any], Dict[str, Any]]

Configure the device for something during a run

This default implementation allows the user to change any of the configuration_attrs. Subclasses might override this to perform additional input validation, cleanup, etc.

Parameters:

d (dict) – The configuration dictionary. To specify the order that the changes should be made, use an OrderedDict.

Returns:

  • (old, new) tuple of dictionaries

  • Where old and new are pre- and post-configure configuration states.

describe() OrderedDictType[str, Dict[str, Any]]

Provide schema and meta-data for read().

This keys in the OrderedDict this method returns must match the keys in the OrderedDict return by read().

This provides schema related information, (ex shape, dtype), the source (ex PV name), and if available, units, limits, precision etc.

Returns:

data_keys (OrderedDict) – The keys must be strings and the values must be dict-like with the event_model.event_descriptor.data_key schema.

get(**kwargs)

Get the value of all components in the device

Keyword arguments are passed onto each signal.get(). Components beginning with an underscore will not be included.

get_energy(material=None, reflection=None)

Get photon energy from first tower in keV.

Energy is determined by the first crystal (Theta motor).

Parameters:
  • material (str, optional) – Chemical formula.

  • reflection (tuple, optional) – Reflection of material. E.g.: (1, 1, 1)

Returns:

energy (number) – Photon energy in keV.

get_lightpath_state(use_cache: bool = True) LightpathState

Return the current LightpathState

Returns:

LightpathState – a dataclass containing the Lightpath state

get_material()

Get the current crystals material.

Parameters:

check (bool) – Indicates if an exception should occure in case it could not determine the material for a tower.

Returns:

m_1 (str) – Crystals material.

get_reflection()

Get the crystal reflection.

Check both towers, and compare the if they match. If they do not match an error will be raised.

Returns:

ref_1 (tuple) – Reflection of the two Crystal Towers.

Raises:

ValueError – When the reflection of first tower does not match the one of second tower.

post_elog_status()

Post device status to the primary elog, if possible.

read() OrderedDictType[str, Dict[str, Any]]

Read data from the device.

This method is expected to be as instantaneous as possible, with any substantial acquisition time taken care of in trigger().

The OrderedDict returned by this method must have identical keys (in the same order) as the OrderedDict returned by describe().

By convention, the first key in the return is the ‘primary’ key and maybe used by heuristics in bluesky.

The values in the ordered dictionary must be dict (-likes) with the keys {'value', 'timestamp'}. The 'value' may have any type, the timestamp must be a float UNIX epoch timestamp in UTC.

Returns:

data (OrderedDict) – The keys must be strings and the values must be dict-like with the keys {'value', 'timestamp'}

read_configuration() OrderedDictType[str, Dict[str, Any]]

Dictionary mapping names to value dicts with keys: value, timestamp

To control which fields are included, change the Component kinds on the device, or modify the configuration_attrs list.

remove(moved_cb=None, timeout=None, wait=False)

Moves the h1n crystal out of the beam.

remove_dia(moved_cb=None, timeout=None, wait=False)

Remove all diagnostic components.

Parameters:
  • moved_cb (callable, optional) – Call this callback when movement is finished. This callback must accept one keyword argument, obj, which will be set to this instance.

  • timeout (float, optional) – Maximum time to wait for the motion.

  • wait (bool, optional) – If True, do not continue until the move is complete.

Returns:

moved_status (Status) – Status that will be marked as done when the motion is complete.

screen()

Open a screen for controlling the device.

Default behavior is the typhos screen, but this method can be overridden for more specialized screens.

set_energy(energy, material=None, reflection=None)

Set the current positions of th1, th2, z1 and z2 offset motors.

Parameters:
  • energy (number) – Energy in keV.

  • material (str, optional) – Crystal material. E.g.: Si

  • reflection (tuple, optional) – Crystal’s reflections. E.g.: (1,1,1)

stage_group_instances() Iterator[OphydObject]

Yields an iterator of subdevices that should be staged.

status() str

Returns a str with the current pv values for the device.

stop(*, success=False)

Stop the Device and all (instantiated) subdevices

summary()
trigger() StatusBase

Trigger the device and return status object.

This method is responsible for implementing ‘trigger’ or ‘acquire’ functionality of this device.

If there is an appreciable time between triggering the device and it being able to be read (via the read() method) then this method is also responsible for arranging that the StatusBase object returned by this method is notified when the device is ready to be read.

If there is no delay between triggering and being readable, then this method must return a StatusBase object which is already completed.

Returns:

status (StatusBase) – StatusBase object which will be marked as complete when the device is ready to be read.

tweakXC(x, wait=False)
tweak_parallel(p_value, material=None, wait=False)

Tweak the x2 and z2 motors.

Parameters:
  • p_value (number) – The number we want to use to tweak the position of x2 and z2

  • material (str, optional) – Crystal material. E.g.: Si

  • wait (bool) – Wait for motion to complete if wait is True. Defaults to False.

tweak_x(x_value, material=None, wait=False)

Tweak some motors to center the beam on YAG2 horizontally based on the calibrated s4 position.

Parameters:
  • x_value (number) – The value that we want to move x2 by from current position.

  • material (str, optional) – Crystal material. E.g.: Si

  • wait (bool, optional) – Wait for motion to complete if wait is True. Defaults to False.

wait_energy(timeout=None)

Block all these motors untill some action completes.

Parameters:

timeout (number, optional) – If None, wait indefinitely until the status finishes. Defaults to None.

Attributes

E
branches

Returns possible destinations as a list of strings.

configuration_attrs
connected
destination

Which beamline the light is reaching.

Indeterminate states will show as blocked.

Returns:

destination (list of str) – .main_line if the light continues on the main line. .mono_line if the light continues on the mono line.

energy
hints
kind
lightpath_cpts = ['tower1.h1n_state.state']
md
needs_parent: list[type[OphydObject]] = [<class 'ophyd.signal.AttributeSignal'>, <class 'ophyd.signal.DerivedSignal'>, <class 'ophyd.areadetector.plugins.PluginBase'>, <class 'ophyd.pseudopos.PseudoSingle'>, <class 'pcdsdevices.signal.PVStateSignal'>, <class 'pcdsdevices.signal.AggregateSignal'>]
stage_group: list[Component] = None
subscriptions: ClassVar[FrozenSet[str]] = frozenset({'acq_done'})
transmission

Returns h1n’s transmission value.