[PIPE2D-820] SpectrumSet.makeImage assumes that SpectrumSet and FiberTraceSet are aligned Created: 24/Apr/21 Updated: 04/May/21 Resolved: 04/May/21 |
|
| Status: | Done |
| Project: | DRP 2-D Pipeline |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Story | Priority: | Normal |
| Reporter: | rhl | Assignee: | rhl |
| Resolution: | Done | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Story Points: | 1 |
| Sprint: | 2DDRP-2021 A 4 |
| Reviewers: | price |
| Description |
|
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); ( 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 |
| Comments |
| Comment by rhl [ 24/Apr/21 ] |
| Comment by price [ 27/Apr/21 ] |
|
Good catch, thanks. |
| Comment by hassan [ 04/May/21 ] |
|
Changes merged to master a week ago, so assume this ticket can be closed. If that is not the case, please reopen or file a new ticket. |