-
Notifications
You must be signed in to change notification settings - Fork 8
Tickets/dm 15015 #9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good. One request is to more clearly explain what fastMaskDisplay
does. The reader is likely to misunderstand "lowest bitplane" to mean on an overall basis; but instead, what is meant is "lowest mask bit set per pixel".
with pyplot.rc_context(dict(interactive=False)): | ||
if isMask: | ||
for i, p in reversed(list(enumerate(planeList))): | ||
if colors[i + 1][3] == 0: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Explain for the reader of the code
- Why
i+1
instead ofi
? - That
[3]
is the alpha channel. Perhaps as simple as
alpha_channel = 3
[...]
if colors[i + 1][alpha_channel] == 0
Could do these even higher up above so that the colors[i + 1][3] = alpha
in line 320 used this same alpha_channel
. It's more obvious in line 320 because of the variable name on the rhs, but for consistency could do both.
extent=extent, cmap=cmap, norm=norm) | ||
maskArr[:] = 0 | ||
|
||
if self._fastMaskDisplay: # we only draw the lowest bitplane |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This comment should say 'we only draw the lowest bitplane set for each pixel'.
maskArr[bitIsSet] = i + 1
accumulates for each item in planeList
. The maskArr
is only reset if not self._fastMaskDisplay
.
""" | ||
Initialise a matplotlib display | ||
|
||
@param fastMaskDisplay If True, only show the first bitplane that's set |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
in each pixel.
Useful as matplotlib's GREEN is very dark
Useful with e.g. %ipympl
I'm not sure how it ever worked. Calling `imshow` with an empty mask appears to erase all mask display (matplotlib bug?)
Should be added to afwDisplay's API
Also clarify the code a little post-review
661f2e6
to
a3fc192
Compare
No description provided.