Skip to content
Snippets Groups Projects

Correction runners as friends

Merged David Hammer requested to merge correction-runners-as-friends into master
3 files
+ 20
45
Compare changes
  • Side-by-side
  • Inline
Files
3
@@ -74,8 +74,8 @@ class JungfrauBaseRunner(base_kernel_runner.BaseKernelRunner):
_bad_pixel_constants = bad_pixel_constants
_correction_flag_class = CorrectionFlags
_correction_steps = correction_steps
num_pixels_ss = 1024
num_pixels_fs = 512
num_pixels_ss = 512
num_pixels_fs = 1024
@property
def _map_shape(self):
@@ -168,7 +168,7 @@ class JungfrauBaseRunner(base_kernel_runner.BaseKernelRunner):
# note: always masking unmapped pixels (not respecting NON_STANDARD_SIZE)
def _load_constant(self, constant, constant_data):
if constant_data.shape[0] == self.num_pixels_ss:
if constant_data.shape[0] == self.num_pixels_fs:
constant_data = np.transpose(constant_data, (2, 1, 0, 3))
else:
constant_data = np.transpose(constant_data, (2, 0, 1, 3))
@@ -219,8 +219,6 @@ class JungfrauGpuRunner(JungfrauBaseRunner):
source_module = self._xp.RawModule(
code=base_kernel_runner.get_kernel_template("jungfrau_gpu.cu").render(
{
"pixels_x": self.num_pixels_ss,
"pixels_y": self.num_pixels_fs,
"constant_memory_cells": self._constant_memory_cells,
"output_data_dtype": utils.np_dtype_to_c_type(
self._output_dtype
@@ -443,7 +441,7 @@ class JungfrauCalcatFriend(base_calcat.BaseCalcatFriend):
@KARABO_CLASSINFO("JungfrauCorrection", deviceVersion)
class JungfrauCorrection(base_correction.BaseCorrection):
_base_output_schema = schemas.jf_output_schema
_correction_flag_class = CorrectionFlags
_correction_steps = correction_steps
_calcat_friend_class = JungfrauCalcatFriend
_constant_enum_class = Constants
_preview_outputs = [
@@ -545,25 +543,3 @@ class JungfrauCorrection(base_correction.BaseCorrection):
return JungfrauCpuRunner
else:
return JungfrauGpuRunner
def postReconfigure(self):
super().postReconfigure()
if not hasattr(self, "_prereconfigure_update_hash"):
return
update = self._prereconfigure_update_hash
if update.has("corrections.strixel.enable"):
self._lock_and_update(self._update_frame_filter)
if update.has("corrections.badPixels.subsetToUse"):
self.log_status_info("Updating bad pixel maps based on subset specified")
# note: now just always reloading from cache for convenience
with self.calcat_friend.cached_constants_lock:
self.kernel_runner.flush_buffers(bad_pixel_constants)
for constant in bad_pixel_constants:
if constant in self.calcat_friend.cached_constants:
self._load_constant_to_runner(
constant, self.calcat_friend.cached_constants[constant]
)
Loading