Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions docs/source/interfaces/direct/PyChop.rst
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,8 @@ If the *Instrument scientist mode* option is selected, a similar option is
enabled for MERLIN if the G chopper is used. In this case, the phase (time
delay) of the thick disk chopper can be adjusted. The time delay is the time-of-
flight at which the chopper slit first opens (sweeps across the beam profile).
In the event that this mode is then deselected, the time delay entered previously
will be utilised for subsequent calculations instead of the default value.

The Matplotlib axes showing the calculated data have the standard toolbars.

Expand Down
26 changes: 12 additions & 14 deletions qt/python/mantidqtinterfaces/mantidqtinterfaces/PyChop/PyChopGui.py
Original file line number Diff line number Diff line change
Expand Up @@ -214,22 +214,20 @@ def setFreq(self, freqtext=None, **kwargs):
# Checks for independent phases
phases = []
for key, widget in self.widgets.items():
if "MERLIN" in str(self.engine.instname) and key.endswith("Phase") and widget["Label"].isHidden():
if key.endswith("Phase"):
# Special case for MERLIN
# sets the default phase for Chopper0Phase if not in "Instrument Scientist Mode"
phase = float(widget["Edit"].text())
phases.append(phase)
if key.endswith("Phase") and not widget["Label"].isHidden():
idx = int(key[7])
phase = widget["Edit"].text()
if isinstance(self.engine.chopper_system.defaultPhase[idx], str):
phase = str(phase)
else:
try:
phase = float(phase) % (1e6 / self.engine.moderator.source_rep)
except ValueError:
raise ValueError(f'Incorrect phase value "{phase}" for {widget["Label"].text()}')
phases.append(phase)
if not widget["Label"].isHidden() or "MERLIN" in str(self.engine.instname) and widget["Label"].isHidden():
idx = int(key[7])
phase = widget["Edit"].text()
if isinstance(self.engine.chopper_system.defaultPhase[idx], str):
phase = str(phase)
else:
try:
phase = float(phase) % (1e6 / self.engine.moderator.source_rep)
except ValueError:
raise ValueError(f'Incorrect phase value "{phase}" for {widget["Label"].text()}')
phases.append(phase)
if phases:
self.engine.setFrequency(freq_in, phase=phases)
else:
Expand Down
Loading