Closed jilavsky closed 2 years ago
final steps of that report:
trd_autorange_controls_ranges_gain0_background -> 1.0
trd_autorange_controls_ranges_gain0_background_error -> 0.0
I Mon-12:48:16 - TR diode range=0 gain=1e5 bkg=1.0 +/- 0.0
scaler0_preset_time -> 0.025
scaler0_auto_count_delay -> 0.02500000037252903
TypeError: '<' not supported between instances of 'KohzuSoftPositionerTuple' and 'float'
calls https://github.com/APS-USAXS/ipython-usaxs/blob/8c149024007334bf67f836fcc7c3ae2e87cd8e9b/profile_bluesky/startup/instrument/plans/command_list.py#L403 https://github.com/APS-USAXS/ipython-usaxs/blob/8c149024007334bf67f836fcc7c3ae2e87cd8e9b/profile_bluesky/startup/instrument/plans/command_list.py#L457
look for scaler0
to be counted
The problem is with a comparison of monochromator value. Looking at: https://github.com/APS-USAXS/ipython-usaxs/blob/8c149024007334bf67f836fcc7c3ae2e87cd8e9b/profile_bluesky/startup/instrument/devices/monochromator.py#L58-L59
need to search for comparisons that involve .dcm
:
(/share1/bluesky/conda_envs/bluesky_2022_1) bash-4.2$ git grep "\\.dcm"
plans/axis_tuning.py: if monochromator.dcm.energy.get() < 10.99: # ~ 10 keV for Si 220 crystals
plans/axis_tuning.py: elif 10.99 <= monochromator.dcm.energy.get() < 12.99: # Si 220 crystals
plans/axis_tuning.py: elif 12.99 <= monochromator.dcm.energy.get() < 18.1: # Si 220 crystals
plans/axis_tuning.py: elif 18.1 <= monochromator.dcm.energy.get() < 20.8: # Si 220 crystals
plans/axis_tuning.py: elif 20.8 <= monochromator.dcm.energy.get(): # Si 220 crystals
plans/filters.py: if monochromator.dcm.energy.get() < 12.1:
plans/filters.py: elif monochromator.dcm.energy.get() < 18.1:
plans/scans.py: # angle_offset = q2angle(q_offset, monochromator.dcm.wavelength.get())
plans/scans.py: startAngle = terms.USAXS.ar_val_center.get()- q2angle(terms.USAXS.start_offset.get(),monochromator.dcm.wavelength.get())
plans/scans.py: endAngle = terms.USAXS.ar_val_center.get()-q2angle(terms.USAXS.finish.get(),monochromator.dcm.wavelength.get())
plans/scans.py: # angle_offset = q2angle(q_offset, monochromator.dcm.wavelength.get())
Looking in apstools
:
class KohzuSeqCtl_Monochromator(Device):
"""
synApps Kohzu double-crystal monochromator sequence control program
.. index:: Ophyd Device; KohzuSeqCtl_Monochromator
"""
energy = Component(KohzuSoftPositioner, "BraggE", kind="hinted")
theta = Component(KohzuSoftPositioner, "BraggTheta", kind="normal")
# lambda is reserved word in Python, can't use it for wavelength
wavelength = Component(KohzuSoftPositioner, "BraggLambda", kind="normal")
and there is the problem. The .dcm.energy
is a KohzuSoftPositioner (now), not a Signal. Replace .get()
with .position
. This line:
if monochromator.dcm.energy.get() < 10.99: # ~ 10 keV for Si 220 crystals
should be changed to:
if monochromator.dcm.energy.position < 10.99: # ~ 10 keV for Si 220 crystals
NOTE: The change to make Kohzu energy, theta, & wavelength into positioners was in apstools 1.5.3. We did not see that yet since USAXS was running apstools 1.4 last December. Now upgraded to latest apstools 1.6.1.
In [4]: cat = databroker.catalog["9idc_usaxs_retired_2022_01_14"]
In [5]: run = cat.v2[-1]
In [6]: run.metadata["start"]["versions"]
Out[6]:
{'bluesky': '1.6.7',
'ophyd': '1.6.0',
'databroker': '1.2.0',
'apstools': '1.4.1',
'epics': '3.4.3',
'h5py': '2.10.0',
'numpy': '1.19.2',
'matplotlib': '3.3.2',
'spec2nexus': '2021.1.8',
'pyRestTable': '2020.0.3',
'pymongo': '3.11.2'}
In [1]: RE.md["versions"]
Out[1]:
{'bluesky': '1.8.2',
'ophyd': '1.6.3',
'databroker': '1.2.5',
'apstools': '1.6.1',
'epics': '3.5.0',
'h5py': '3.6.0',
'numpy': '1.21.2',
'matplotlib': '3.5.0',
'spec2nexus': '2021.1.8',
'pyRestTable': '2020.0.3',
'pymongo': '3.12.0'}
In [2]: monochromator.dcm.energy.position
Out[2]: 21.000047131358706
In [3]: monochromator.dcm.energy.get()
Out[3]: KohzuSoftPositionerTuple(setpoint=21.000047131358706, readback=21.000047131358706, done=0)
It's an upgrade detail I missed.
Started in new terminal, BlueSky loads. Tried to start data collection. Something about TypeError: '<' not supported between instances of 'KohzuSoftPositionerTuple' and 'float' stops data collection... Cannot proceed. Switching to spec. Call me when ready, please.