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

Remove leftovers from sending gain map as full output

parent fcc08a7c
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
......@@ -31,14 +31,6 @@ class AgipdCorrection(BaseCorrection):
_gpu_runner_class = AgipdGpuRunner
_calcat_friend_class = AgipdCalcatFriend
_constant_enum_class = AgipdConstants
_managed_keys = BaseCorrection._managed_keys | {
"sendGainMap",
}
# this is just extending (not mandatory)
_schema_cache_fields = BaseCorrection._schema_cache_fields | {
"sendGainMap",
}
@staticmethod
def expectedParameters(expected):
......@@ -281,22 +273,7 @@ class AgipdCorrection(BaseCorrection):
# reusing input data hash for sending
data_hash.set("image.data", buffer_handle)
if self._schema_cache["sendGainMap"]:
(
buffer_handle,
buffer_array,
) = self._shmem_buffer_gain_map.next_slot()
self.gpu_runner.get_gain_map(
output_order=self._schema_cache["dataFormat.outputAxisOrder"],
out=buffer_array,
)
data_hash.set(
"image.gainMap",
buffer_handle,
)
data_hash.set("calngShmemPaths", ["image.data", "image.gainMap"])
else:
data_hash.set("calngShmemPaths", ["image.data"])
data_hash.set("calngShmemPaths", ["image.data"])
data_hash.set("image.cellId", cell_table[:, np.newaxis])
data_hash.set("image.pulseId", pulse_table[:, np.newaxis])
......@@ -349,31 +326,6 @@ class AgipdCorrection(BaseCorrection):
self._update_correction_flags()
self.log_status_info(f"Done loading {constant.name} to GPU")
def _update_buffers(self):
super()._update_buffers()
# TODO: pack four pixels per byte
if self._schema_cache["sendGainMap"]:
if self._shmem_buffer_gain_map is None:
buffer_name = self.getInstanceId() + ":dataOutput-gain"
# try to match number of trains in image data buffer
memory_budget = (
self.get("outputShmemBufferSize")
* 2 ** 30
// (
np.dtype(self.output_data_dtype).itemsize
// np.dtype(np.uint8).itemsize
)
)
self.log.INFO(f"Opening new shmem buffer for gain: {buffer_name}")
self._shmem_buffer_gain_map = shmem_utils.ShmemCircularBuffer(
memory_budget,
self.output_data_shape,
np.uint8,
buffer_name,
)
else:
self._shmem_buffer_gain_map.change_shape(self.output_data_shape)
def _update_bad_pixel_selection(self):
selection = 0
for field in BadPixelValues:
......
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