-
Type:
Story
-
Status: Done (View Workflow)
-
Priority:
Normal
-
Resolution: Done
-
Affects Version/s: None
-
Fix Version/s: None
-
Component/s: None
-
Labels:None
-
Story Points:1
-
Sprint:2DDRP-2021 A 4
There's a bug in the book-keeping in SpectrumSet.makeImage:
assert len(self) == len(self), "Number of spectra and fiberTraces don't match"
(self appears twice) which means that the code accepts being passed a set of fiberTraces that doesn't match the spectra; this happens when there are broken fibres (think SuNSS); (PIPE2D-819).
Furthermore, the code assumes that the order of fibres in SpectrumSet and FiberTraceSet are the same; is that guaranteed? It might be safer to switch to
fiberIds = list(self.getAllFiberIds()) for ft in fiberTraces: spec = self[fiberIds.index(ft.fiberId)] fiberImage = ft.constructImage(spec) image[fiberImage.getBBox(), afwImage.PARENT] += fiberImage