Blackened everything
This commit is contained in:
parent
e213647217
commit
5966ce29be
57 changed files with 1938 additions and 1414 deletions
|
|
@ -1,18 +1,24 @@
|
|||
import numpy as np
|
||||
import logging
|
||||
|
||||
from openflexure_microscope.devel import MicroscopeViewPlugin, JsonResponse, request, jsonify
|
||||
from openflexure_microscope.devel import (
|
||||
MicroscopeViewPlugin,
|
||||
JsonResponse,
|
||||
request,
|
||||
jsonify,
|
||||
)
|
||||
|
||||
|
||||
class MeasureSharpnessAPI(MicroscopeViewPlugin):
|
||||
def post(self):
|
||||
payload = JsonResponse(request)
|
||||
return jsonify({'sharpness': self.plugin.measure_sharpness()})
|
||||
return jsonify({"sharpness": self.plugin.measure_sharpness()})
|
||||
|
||||
|
||||
class AutofocusAPI(MicroscopeViewPlugin):
|
||||
def post(self):
|
||||
payload = JsonResponse(request)
|
||||
|
||||
|
||||
# Figure out the range of z values to use
|
||||
dz = payload.param("dz", default=np.linspace(-300, 300, 7), convert=np.array)
|
||||
|
||||
|
|
@ -22,10 +28,11 @@ class AutofocusAPI(MicroscopeViewPlugin):
|
|||
# return a handle on the autofocus task
|
||||
return jsonify(task.state), 202
|
||||
|
||||
|
||||
class FastAutofocusAPI(MicroscopeViewPlugin):
|
||||
def post(self):
|
||||
payload = JsonResponse(request)
|
||||
|
||||
|
||||
# Figure out the parameters to use
|
||||
dz = payload.param("dz", default=2000, convert=int)
|
||||
backlash = payload.param("backlash", default=0, convert=int)
|
||||
|
|
@ -33,7 +40,9 @@ class FastAutofocusAPI(MicroscopeViewPlugin):
|
|||
backlash = 0
|
||||
|
||||
logging.info("Running autofocus...")
|
||||
task = self.microscope.task.start(self.plugin.fast_autofocus, dz, backlash=backlash)
|
||||
task = self.microscope.task.start(
|
||||
self.plugin.fast_autofocus, dz, backlash=backlash
|
||||
)
|
||||
|
||||
# return a handle on the autofocus task
|
||||
return jsonify(task.state), 202
|
||||
return jsonify(task.state), 202
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue