@@ -214,17 +214,20 @@ def setFreq(self, freqtext=None, **kwargs):
214
214
# Checks for independent phases
215
215
phases = []
216
216
for key , widget in self .widgets .items ():
217
- if key .endswith ("Phase" ) and not widget ["Label" ].isHidden ():
218
- idx = int (key [7 ])
219
- phase = widget ["Edit" ].text ()
220
- if isinstance (self .engine .chopper_system .defaultPhase [idx ], str ):
221
- phase = str (phase )
222
- else :
223
- try :
224
- phase = float (phase ) % (1e6 / self .engine .moderator .source_rep )
225
- except ValueError :
226
- raise ValueError (f'Incorrect phase value "{ phase } " for { widget ["Label" ].text ()} ' )
227
- phases .append (phase )
217
+ if key .endswith ("Phase" ):
218
+ # Special case for MERLIN
219
+ # sets the default phase for Chopper0Phase if not in "Instrument Scientist Mode"
220
+ if not widget ["Label" ].isHidden () or "MERLIN" in str (self .engine .instname ) and key [7 ] == 0 :
221
+ idx = int (key [7 ])
222
+ phase = widget ["Edit" ].text ()
223
+ if isinstance (self .engine .chopper_system .defaultPhase [idx ], str ):
224
+ phase = str (phase )
225
+ else :
226
+ try :
227
+ phase = float (phase ) % (1e6 / self .engine .moderator .source_rep )
228
+ except ValueError :
229
+ raise ValueError (f'Incorrect phase value "{ phase } " for { widget ["Label" ].text ()} ' )
230
+ phases .append (phase )
228
231
if phases :
229
232
self .engine .setFrequency (freq_in , phase = phases )
230
233
else :
@@ -642,9 +645,9 @@ def _gen_text_ei(self, ei, obj_in):
642
645
txt += "# Ei = %8.2f meV\n " % (ei )
643
646
txt += "# Flux = %8.2f n/cm2/s\n " % (flux )
644
647
txt += "# Elastic resolution = %6.2f meV\n " % (res [0 ])
645
- txt += "# Time width at sample = %6.2f us, of which:\n " % (1e6 * np .sqrt (tsqvan ))
648
+ txt += "# Time width at sample = %6.2f us, of which:\n " % (1e6 * np .sqrt (tsqvan [ 0 ] ))
646
649
for ky , val in list (tsqdic .items ()):
647
- txt += "# %20s : %6.2f us\n " % (ky , 1e6 * np .sqrt (val ))
650
+ txt += "# %20s : %6.2f us\n " % (ky , 1e6 * np .sqrt (val [ 0 ] ))
648
651
txt += "# %s distances:\n " % (obj .instname )
649
652
txt += "# x0 = %6.2f m (%s to Fermi)\n " % (x0 , first_component )
650
653
txt += "# x1 = %6.2f m (Fermi to sample)\n " % (x1 )
0 commit comments