Skip to content
Snippets Groups Projects
Commit f6759a41 authored by David Hammer's avatar David Hammer
Browse files

Merge branch 'fix/cleanup-dssc-device' into devel

parents 12e5f41a fe78fd13
No related branches found
No related tags found
2 merge requests!12Snapshot: field test deployed version as of end of run 202201,!3Base correction device, CalCat interaction, DSSC and AGIPD devices
......@@ -33,6 +33,6 @@ setup(name='calng',
'CalibrationManager = calng.CalibrationManager:CalibrationManager'
],
},
package_data={},
package_data={'': ['*.cpp']},
requires=[],
)
import copy
import re
import threading
import timeit
......@@ -15,7 +13,6 @@ from karabo.bound import (
NDARRAY_ELEMENT,
NODE_ELEMENT,
OUTPUT_CHANNEL,
SLOT_ELEMENT,
STRING_ELEMENT,
UINT32_ELEMENT,
UINT64_ELEMENT,
......@@ -32,8 +29,8 @@ from karabo.bound import (
)
from karabo.common.states import State
import shmem_utils
import utils
from . import shmem_utils
from . import utils
from ._version import version as deviceVersion
from .dssc_gpu import DsscGpuRunner
......@@ -63,15 +60,6 @@ class DsscCorrection(calibrationBase.CalibrationReceiverBaseDevice):
)
(
SLOT_ELEMENT(expected)
.key("askConnectedReadersToSendMySources")
.displayedName("Request sources from connected RunToPipe")
.description(
"Only relevant for development environment. When running without a "
"CAL_MANAGER, we need to tell RunToPipe instances which sources to "
"send us."
)
.commit(),
BOOL_ELEMENT(expected)
.key("doAnything")
.displayedName("Enable input processing")
......@@ -376,9 +364,6 @@ class DsscCorrection(calibrationBase.CalibrationReceiverBaseDevice):
self._dict_cache = {k: config.get(k) for k in self._dict_cache_slots}
super().__init__(config)
# very sneaky debugging
self.KARABO_SLOT(self.askConnectedReadersToSendMySources)
self.KARABO_ON_DATA("dataInput", self.process_input)
self.KARABO_ON_EOS("dataInput", self.handle_eos)
......@@ -404,7 +389,6 @@ class DsscCorrection(calibrationBase.CalibrationReceiverBaseDevice):
self._output_transpose,
)
self._has_set_output_schema = False
self._has_set_preview_output_schema = False
self._rate_tracker = calibrationBase.utils.UpdateRate(
interval=config.get("performance.rateBufferSpan")
)
......@@ -595,7 +579,9 @@ class DsscCorrection(calibrationBase.CalibrationReceiverBaseDevice):
self.gpu_runner.load_cell_table(cell_table)
else:
# in this case, there will be no corrected preview
self.log.WARN("Corrected preview will not actually be corrected.")
self.log.WARN(
"Corrected preview will not actually be corrected."
)
preview_raw, preview_corrected = self.gpu_runner.compute_preview(
preview_slice_index,
have_corrected=do_apply_correction,
......@@ -742,30 +728,6 @@ class DsscCorrection(calibrationBase.CalibrationReceiverBaseDevice):
self.managerInstance = instance_id
self.log.INFO(f"Registered calibration manager {instance_id}")
def askConnectedReadersToSendMySources(self):
"""For all connected outputs, set my sources to True
This is really something the cal_manager should handle. Will be removed
after prototyping phase.
"""
connected_friends = [
# TODO: full set of possible device / channel separators
re.split(r"[@:]", channel)[0]
for channel in self.get("dataInput.connectedOutputChannels")
]
send_me_the_thing_hash = Hash()
for source in self.get("fastSources"):
send_me_the_thing_hash[f"sources.{source}"] = True
# ask them nicely to send it
for friend in connected_friends:
# TODO: check that device is a reader
self.signalSlotable.call(friend, "slotReconfigure", send_me_the_thing_hash)
# who needs middlelayer? we can roll out own setNowait 😎
def _update_output_schema(self, data):
"""Updates the schema of dataOutput based on parameter data (a Hash)
......
......@@ -5,7 +5,7 @@ import shmem_utils
from karabo.bound import KARABO_CLASSINFO, VECTOR_STRING_ELEMENT
from PipeToZeroMQ import PipeToZeroMQ, conversion, device_schema
import shmem_utils
from . import shmem_utils
from ._version import version as deviceVersion
......
......@@ -5,7 +5,7 @@ import cupyx
import jinja2
import numpy as np
import utils
from . import utils
class DsscGpuRunner:
......
File moved
File moved
File moved
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment