forked from M-Labs/artiq
remote_exec_processing: style
This commit is contained in:
parent
4a297f0c42
commit
b36eded2e1
|
@ -20,6 +20,7 @@ def compute_gaussian(r, img_w, img_h,
|
||||||
|
|
||||||
def fit(data, get_dataset):
|
def fit(data, get_dataset):
|
||||||
img_w, img_h = data.shape
|
img_w, img_h = data.shape
|
||||||
|
|
||||||
def err(parameters):
|
def err(parameters):
|
||||||
r = np.empty((img_w, img_h))
|
r = np.empty((img_w, img_h))
|
||||||
compute_gaussian(r, img_w, img_h, *parameters)
|
compute_gaussian(r, img_w, img_h, *parameters)
|
||||||
|
@ -38,6 +39,7 @@ def fit(data, get_dataset):
|
||||||
def get_and_fit():
|
def get_and_fit():
|
||||||
if "dataset_db" in globals():
|
if "dataset_db" in globals():
|
||||||
logger.info("using dataset DB for Gaussian fit guess")
|
logger.info("using dataset DB for Gaussian fit guess")
|
||||||
|
|
||||||
def get_dataset(name, default):
|
def get_dataset(name, default):
|
||||||
try:
|
try:
|
||||||
return dataset_db.get(name)
|
return dataset_db.get(name)
|
||||||
|
@ -45,7 +47,7 @@ def get_and_fit():
|
||||||
return default
|
return default
|
||||||
else:
|
else:
|
||||||
logger.info("using defaults for Gaussian fit guess")
|
logger.info("using defaults for Gaussian fit guess")
|
||||||
|
|
||||||
def get_dataset(name, default):
|
def get_dataset(name, default):
|
||||||
return default
|
return default
|
||||||
get_dataset = lambda name, default: default
|
|
||||||
return fit(controller_driver.get_picture(), get_dataset)
|
return fit(controller_driver.get_picture(), get_dataset)
|
||||||
|
|
Loading…
Reference in New Issue