Skip to content

DM-55580: Make mask display faster - #23

Merged
timj merged 2 commits into
mainfrom
tickets/DM-55580
Jul 22, 2026
Merged

DM-55580: Make mask display faster#23
timj merged 2 commits into
mainfrom
tickets/DM-55580

Conversation

@timj

@timj timj commented Jul 22, 2026

Copy link
Copy Markdown
Member
  • There was a imshow call that was not needed because it was immediately followed by imshow.
  • We were calling imshow per mask plane and that was not only causing rendering each time but also additional matplotlib overhead. This patch creates a high res composite mask image first and then hands it off to matplotlib once.

@erykoff erykoff left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are you sure that the draw_idle isn't needed?

@timj

timj commented Jul 22, 2026

Copy link
Copy Markdown
Member Author

_i_mtv is only called from _mtv and _mtv does the drawing as well. I'll add a note to the docstring for _i_mtv.

timj and others added 2 commits July 22, 2026 09:13
This redraw is not needed because the calling code immediately redraws.
Displaying an Exposure previously drew the mask with one imshow per set
bitplane, so a coadd with many populated planes produced a dozen
full-resolution overlay layers.  Every repaint then colour-mapped and
resampled each layer independently, which dominated the display time
(the resampling itself is cheap; generating the full-resolution RGBA
for each layer is the cost).

Blend the visible planes into a single full-resolution RGBA image and
draw it as one layer instead.  The Porter-Duff "over" operator is
associative, so this is equivalent to drawing each plane separately but
leaves matplotlib with one layer to colour-map and resample rather than
one per plane; rendered output matches the old path to within 8-bit
rounding.  fastMaskDisplay is unchanged.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@timj
timj force-pushed the tickets/DM-55580 branch from c0409b6 to 8e9a8e2 Compare July 22, 2026 16:13
@timj
timj merged commit 8a49a09 into main Jul 22, 2026
2 of 4 checks passed
@timj
timj deleted the tickets/DM-55580 branch July 22, 2026 16:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants