-
-
Notifications
You must be signed in to change notification settings - Fork 49
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
NDCubeSequence plotting mixin API. #98
Conversation
Hello @DanRyanIrish! Thanks for updating the PR.
Comment last updated on March 26, 2018 at 18:43 Hours UTC |
…th placeholder errors.
ffda5b2
to
6b5a8c5
Compare
@Cadair, I think this is ready for a serious discussion now. As an explanation, the |
…ke dimension states. Also got NDCubeSequencePlotMixin.plot working with LineAnimatorNDCubeSequence class for 2D sequences.
…cases where sequence dimensions > 2.
I think I might have done another Danny's-1st-PR-style move here. +1,198 lines, -3 lines...woops! |
ndcube/mixins/sequence_plotting.py
Outdated
|
||
axes_units: length 2 `list` of `astropy.unit.Unit` or valid unit `str` or None. | ||
Denotes unit in which X-axis and Y-axis, respectively, should be displayed. | ||
Only used if corresponding entry in axes_coordinates is a Quantity. |
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.
Error in this kwarg description. Should be same length as number of dimensions.
However, should probably also accept length 2 for images and length one for line plots so slider units don't have to be changed every time for high dimension sequences.
ndcube/mixins/sequence_plotting.py
Outdated
If None coordinates derived from the WCS objects will be used for all axes. | ||
If a list, it should contain one element for each axis. Each element should | ||
be either an `astropy.units.Quantity` or a `numpy.ndarray` of coordinates for | ||
each pixel, or a `str` denoting a valid extra coordinate. |
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.
Error in this kwarg description. Elements can also be None.
axes_coordinates should probably also accept length 2 for images and length one for line plots so slider units don't have to be changed every time for high dimension sequences.
ndcube/mixins/sequence_plotting.py
Outdated
If None coordinates derived from the WCS objects will be used for all axes. | ||
If a list, it should contain one element for each axis. Each element should | ||
be either an `astropy.units.Quantity` or a `numpy.ndarray` of coordinates for | ||
each pixel, or a `str` denoting a valid extra coordinate. |
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.
add None
here
ndcube/mixins/sequence_plotting.py
Outdated
|
||
data_unit: `astropy.unit.Unit` or valid unit `str` or None | ||
Unit in which data in a 2D image or animation should be displayed. Only used if | ||
visualization is a 2D image or animation, i.e. if image_axis has length 2. |
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.
Correct this description. Data unit also is applied to y-axis of line plot.
Move the plot_as_cube options into separate |
Move some helper functions into class. Those that use the object itself. |
…hod. Also updaed docstrings of plot and plot_as_cube to reflect the what the API will become over future commits.
…PlotMixin.plot_as_cube.
Wrap dimension-specific prep operations in |
…plot and and plot_as_cube methods to external function. Also added more comments.
5ea7c04
to
94b9b2c
Compare
94b9b2c
to
4fa0da3
Compare
…ll stop bugs when dimensions are of same length. Also made NDCubeSequencePlotMixin a proper class by replacing the cubesequence input arg to self.
… plot options. Also implement mixin in ndcubesequence module creating a non-plotting Base class and an NDCubeSequence class using plot mixin.
…ues were being reassigned instead of the axis unit. Also added some error checks and removed a few lines of extraneous code.
…eby axis values were being reassigned instead of the axis unit. Also added some error checks and removed a few lines of extraneous code.
…write test for it.
…urrent plot API. Also make those ImageAnimator classes aware of the sub-cubes data unit.
…r. Add back in after sunpy 0.9 release.
65fdf62
to
cc59ce4
Compare
cc59ce4
to
bfe945c
Compare
I've left 1D animation functionality out of this PR as it depends on sunpy master. I'll issue another PR once this one has been merged with the 1D animation capability that can be merged either when sunpy 0.9 comes out or if we decide ndcube master depending on sunpy master is fine until 0.9. |
As part of this PR I've realised there are shortcomings in the 2D images produced, it that coordinates for an axis are sometimes taken from the first sub-cube in the sequence and assumed not to change. I haven't fully figured out all the ties this occurs. So this comment is just a reminder to raise an issue after this PR is merged. Addressing this issue is beyond the scope of this PR. |
…plot_as_cube docstrings and add type checks in their tests.
b80dc28
to
0917b02
Compare
0917b02
to
d629ec8
Compare
Hey @Cadair. I'm planning to merge this tomorrow (your today) as I think it's ready and there are a couple PRs piling up waiting for it. I know you're really busy so if you don't have time to look at it no problem. Otherwise I'll take any comments you do have into tomorrow. |
This PR introduces a new API for an
NDCubeSequence
plotting that will provide a more comprehensive plotting functionality forNDCubeSequence
and more consistent API. This API/functionality should be mirroredNDCube
where appropriate and vice versa.This new mixin API will also allow a new
NDCubeSequenceBase
class independent of visualization and also ofsunpy
.