MCPcopy Create free account
hub / github.com/LabPy/lantz / scan_amplitude

Method scan_amplitude

examples/backend_frontend/myapps.py:115–137  ·  view source on GitHub ↗

Open the shutter an then for each amplitude: - scan the amplitude of the function generator. - sleeps .3 seconds. - measures the trace of the oscilloscope. - yields amplitude, data for each amplitude. Finally, close the shutter. :param amplitudes: it

(self, amplitudes)

Source from the content-addressed store, hash-verified

113 new_data = QtCore.Signal(object, object)
114
115 def scan_amplitude(self, amplitudes):
116 """Open the shutter an then for each amplitude:
117 - scan the amplitude of the function generator.
118 - sleeps .3 seconds.
119 - measures the trace of the oscilloscope.
120 - yields amplitude, data for each amplitude.
121
122 Finally, close the shutter.
123
124 :param amplitudes: iterable of amplitudes.
125 """
126 self.shutter.opened = True
127
128 # We use the embedded app to perform the actual operation.
129 # Notice that we have not explicitly instantiated the AmplitudeScanner
130 # nor provided the instruments. Lantz has done this in the back
131 # connecting InstrumentsSlots by name.
132 # i.e. self.osci is self.scanner.osci
133 for amplitude, data in self.scanner.scan_amplitude(amplitudes):
134 self.new_data.emit(amplitude, data)
135 yield amplitude, data
136
137 self.shutter.opened = False
138
139 def _scan_amplitude(self, amplitudes):
140 """Because scan_amplitude is a generator, this helper functions is used

Callers 2

_scan_amplitudeMethod · 0.95
default_scanMethod · 0.95

Calls 2

scan_amplitudeMethod · 0.45
emitMethod · 0.45

Tested by

no test coverage detected