DiamondLightSource / DiamondLightSource/Savu

potential array overrun in dezing_filter.py

Open
#337 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
43
Forks
42
PR merge metrics
No merged PRs in 30d

Description

The code in the plugin appears to assume that flat and dark have the same number of frames.
If flat has a greater number of frames than dark,this will have potential to fail in a bad way.

50 def pre_process(self):
51 # Apply dezing to dark and flat images (data with image key only)
52 inData = self.get_in_datasets()[0]
53 dark = inData.data.dark()
54 flat = inData.data.flat()
55 logging.info("dezing setup size function for dark %s",(dark.shape,))
56 (retval, self.warnflag, self.errflag) = dezing.setup_size(
57 dark.shape, self.parameters['outlier_mu'], self.pad)
58 pad_list = ((self.pad, self.pad), (0, 0), (0, 0))
59 dark = self._dezing(np.pad(dark, pad_list, mode='edge'))
60 flat = self._dezing(np.pad(flat, pad_list, mode='edge'))

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.