20 lines
942 B
Python
20 lines
942 B
Python
from collections import OrderedDict
|
|
from cam_server.pipeline.data_processing import functions, processor
|
|
import numpy as np
|
|
|
|
def process_image(image, pulse_id, timestamp, x_axis, y_axis, parameters, bsdata):
|
|
r = processor.process_image(image, pulse_id, timestamp, x_axis, y_axis, parameters, bsdata)
|
|
ret = OrderedDict()
|
|
channels = ["intensity","x_center_of_mass","x_fwhm","x_rms","x_fit_amplitude", "x_fit_mean","x_fit_offset","x_fit_standard_deviation","x_profile","y_center_of_mass","y_fwhm","y_rms","y_fit_amplitude", "y_fit_mean","y_fit_offset","y_fit_standard_deviation","y_profile"]
|
|
prefix = parameters["camera_name"]
|
|
for c in channels:
|
|
value = r[c]
|
|
if isinstance(value,np.floating):
|
|
value=float(value)
|
|
if isinstance(value,np.integer):
|
|
value=int(value)
|
|
if type(value) == list:
|
|
value = np.array(value)
|
|
ret[prefix+":"+c] = value
|
|
return ret
|