-
-
Notifications
You must be signed in to change notification settings - Fork 44
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
Adds persistence transform example to the gallery #137
Conversation
pre-commit.ci autofix |
for more information, see https://pre-commit.ci
pre-commit.ci autofix |
for more information, see https://pre-commit.ci
@nabobalis @wafels |
examples/persistence_transform.py
Outdated
# To create a MapSequence, we can call Map directly but add in a | ||
# keyword to output a MapSequence instead. | ||
|
||
aiamapseq = sunpy.map.Map(AIA_193_CUTOUT01_IMAGE, AIA_193_CUTOUT02_IMAGE, AIA_193_CUTOUT03_IMAGE, cube=True) |
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.
Does this cube keyword work?
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.
Hmm ... my bad, there is no impact from the cube keyword.
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.
How do we make it a sequence?
aiamapseq = sunpy.map.Map(AIA_193_CUTOUT01_IMAGE, AIA_193_CUTOUT02_IMAGE, AIA_193_CUTOUT03_IMAGE, cube=True) | ||
|
||
############################################################################### | ||
# For a data set consisting of N images with intensity values I(x,y,t), |
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.
Maybe this should be rendered as math text
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.
I think we need to change the docs/config.py so the gallery will have animations.
Hmm ... i will go through that 👍
# This plots the final mapsequence after implementing the persistence transform | ||
|
||
result_mapseq = sunpy.map.MapSequence(persistence_maps) | ||
result_mapseq.peek() |
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.
We should not be using peek to display any images.
I think we need to change the docs/config.py so the gallery will have animations. |
Co-authored-by: Nabil Freij <nabil.freij@gmail.com>
Co-authored-by: Nabil Freij <nabil.freij@gmail.com>
Co-authored-by: Nabil Freij <nabil.freij@gmail.com>
Co-authored-by: Nabil Freij <nabil.freij@gmail.com>
Co-authored-by: Nabil Freij <nabil.freij@gmail.com>
Co-authored-by: Nabil Freij <nabil.freij@gmail.com>
Co-authored-by: Nabil Freij <nabil.freij@gmail.com>
pre-commit.ci autofix |
for more information, see https://pre-commit.ci
for i, map_i in enumerate(aiamapseq[1:]): | ||
per = np.array([aiamapseq[n].data for n in [i, i + 1]]).max(axis=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.
Surely we don't need two loops to do this...Can this operation not be vectorized?
smap.plot_settings["cmap"] = cm.get_cmap("Greys_r") | ||
smap.plot_settings["norm"] = colors.LogNorm(100, smap.max()) |
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.
These two lines should be removed and the keyword arguments can just be passed directly when calling plot
, e.g. aiamapseq.plot(cmap=cm.get_cmap('Greys_r'), norm=colors.LogNorm(100, smap.max())
.
# For a data set consisting of N images with intensity values I(x,y,t), | ||
# the Persistence Map Pn is a function of several arguments, | ||
# namely intensity, location and time: | ||
# Pn(x,y,tn)=Q(I(x,y,t≤tn)) |
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.
What is Q here? the actual operation that is being performed needs a lot more explanation. @wafels could you provide a few references where this kind of operation is used in the literature?
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.
Typically Q is the maximum function - i.e., find the maximum value for all values from 0 to t_{n}. For a reference - DOI 10.3847/0004-637X/825/1/27 .
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.
Thanks for the reference
@wtbarnes @nabobalis |
I added a range of sunkit-image issues in the proposal, in this case, I have no problem with continuing this pull request and we replace the issue in the proposal. |
@nabobalis |
Thanks for working on this @Telomelonia but since there has been no activity, I will be closing this. If you want to continue working on this, please reopen this. |
PR Description
These include persistence transform maps and mapcubes and overplotting of multiple maps in the same matplotlib Axes instance.
TODO
peek()
Fixes #76