diff --git a/src/calng/corrections/PnccdCorrection.py b/src/calng/corrections/PnccdCorrection.py index 20d2e6885effe9b18604e897a3230f187f80b541..a4d8dfab6650d2eab4ec1ed7ac75e5fadce449a8 100644 --- a/src/calng/corrections/PnccdCorrection.py +++ b/src/calng/corrections/PnccdCorrection.py @@ -252,7 +252,6 @@ class PnccdCpuRunner(base_kernel_runner.BaseKernelRunner): cm_min_frac, cm_row, cm_col, - cm_block, ): output = self._q_processed_data[q] output[:] = self._q_input_data[q].astype(np.float32) @@ -260,17 +259,11 @@ class PnccdCpuRunner(base_kernel_runner.BaseKernelRunner): output -= self._q_offset_map[q] if flags & CorrectionFlags.COMMONMODE: - # per rectangular block that looks like something is going on masked = np.ma.masked_array( data=output, mask=(self._q_bad_pixel_map[q] != 0) | (output > self._q_noise_map[q] * cm_noise_sigma), ) - if cm_block: - for block in np.hsplit(masked, 4): - if block.count() < block.size * cm_min_frac: - continue - block.data[:] -= np.ma.median(block) if cm_row: subset_rows = masked.count(axis=1) >= masked.shape[1] * cm_min_frac @@ -296,7 +289,6 @@ class PnccdCpuRunner(base_kernel_runner.BaseKernelRunner): cm_min_frac=0.25, cm_row=True, cm_col=True, - cm_block=True, ): # NOTE: how to best clean up all these duplicated parameters? for result in self.thread_pool.map( @@ -308,7 +300,6 @@ class PnccdCpuRunner(base_kernel_runner.BaseKernelRunner): cm_min_frac=cm_min_frac, cm_row=cm_row, cm_col=cm_col, - cm_block=cm_block, ), range(4), ): @@ -406,20 +397,12 @@ class PnccdCorrection(base_correction.BaseCorrection): .defaultValue(True) .reconfigurable() .commit(), - - BOOL_ELEMENT(expected) - .key("corrections.commonMode.enableBlock") - .assignmentOptional() - .defaultValue(True) - .reconfigurable() - .commit(), ) PnccdCorrection._managed_keys |= { "corrections.commonMode.noiseSigma", "corrections.commonMode.minFrac", "corrections.commonMode.enableRow", "corrections.commonMode.enableCol", - "corrections.commonMode.enableBlock", } PnccdCalcatFriend.add_schema(expected, PnccdCorrection._managed_keys) # TODO: bad pixel node? @@ -459,7 +442,6 @@ class PnccdCorrection(base_correction.BaseCorrection): cm_min_frac=self.unsafe_get("corrections.commonMode.minFrac"), cm_row=self.unsafe_get("corrections.commonMode.enableRow"), cm_col=self.unsafe_get("corrections.commonMode.enableCol"), - cm_block=self.unsafe_get("corrections.commonMode.enableBlock"), ) self.kernel_runner.correct( flags=self._correction_flag_enabled, **args_which_should_be_cached