Skip to content

Instantly share code, notes, and snippets.

@thomasaarholt
Last active July 4, 2019 12:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save thomasaarholt/030ffe365f97ba4aa251a23a7bd62538 to your computer and use it in GitHub Desktop.
Save thomasaarholt/030ffe365f97ba4aa251a23a7bd62538 to your computer and use it in GitHub Desktop.
Rough approximation of our approach to odemis SI acquisition
def approx_acquisition_method():
self.spect.data.synchronizedOn(self.escan.newPosition)
startt = time.time()
self.spect.data.subscribe(self.receive_spect_point)
sed_data = self.sed.data.get()
# wait the last point is fully acquired
self.acq_complete.wait()
def receive_spect_point(self, dataflow, data):
"""
callback for each point scanned as seen by the spectrometer
"""
self.acq_spect_buf.append(data)
self.acq_left -= 1
if self.acq_left <= 0:
dataflow.unsubscribe(self.receive_spect_point)
self.acq_complete.set()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment