-
Notifications
You must be signed in to change notification settings - Fork 75
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
SpectralCube to specutils transition in cubeviz #547
Merged
Merged
Changes from 11 commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
a7da799
SpectralCube to specutils transition in cubeviz
javerbukh ff40dfb
Add change log
pllim 5fd484d
POC: Load Cherinka s3d cubes
pllim 4138be4
Only pass in sliced WCS
pllim 3a28bca
Comment out WCS slicing
pllim 2ebf2a8
Update change log
javerbukh 3bde38b
Update CHANGES.rst
javerbukh a888518
Gaussian smooth now uses Spectrum1D
javerbukh c4ce92d
Modify setup.cfg to ignore spectrum1d warning
javerbukh 85b9f17
Moment map plugin now uses Spectrum1D
javerbukh d81d055
Fix code style checks
javerbukh 6717e0d
Remove changes to notebook
javerbukh 2a66436
Update change log
javerbukh f6e6c7b
Minor change to fix spatial smoothing
javerbukh File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 12 additions & 10 deletions
22
jdaviz/configs/cubeviz/plugins/moment_maps/tests/test_moment_maps.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,27 @@ | ||
import numpy as np | ||
|
||
from glue.core import Data | ||
from specutils import Spectrum1D | ||
|
||
from jdaviz import Application | ||
from jdaviz.configs.cubeviz.plugins.moment_maps.moment_maps import MomentMap | ||
|
||
|
||
def test_moment_calculation(spectral_cube_wcs): | ||
def todo_fix_test_moment_calculation(spectrum1d_cube): | ||
|
||
app = Application() | ||
dc = app.data_collection | ||
dc.append(Data(x=np.ones((3, 4, 5)), label='test', coords=spectral_cube_wcs)) | ||
app.add_data(spectrum1d_cube, 'test') | ||
|
||
mm = MomentMap(app=app) | ||
mm._subset_selected = 'None' | ||
# mm.spectral_min = 1.0 * u.m | ||
# mm.spectral_max = 2.0 * u.m | ||
mm._on_data_updated(None) | ||
|
||
mm.selected_data = 'test' | ||
mm.n_moment = 0 | ||
mm.vue_calculate_moment(None) | ||
mm._on_data_selected({'new': 'test'}) | ||
mm._on_subset_selected({'new': None}) | ||
|
||
print(dc[1].get_object()) | ||
mm.n_moment = 0 | ||
mm.vue_calculate_moment() | ||
|
||
assert mm.moment_available | ||
assert dc[1].label == 'Moment 0: test' | ||
assert dc[1].get_object().shape == (4, 5) | ||
assert dc[1].get_object(cls=Spectrum1D, statistic=None).shape == (4, 2, 2) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 is not quite true yet, but hopefully will be true by the time this PR is complete.
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.
@javerbukh , since this patch doesn't include "Spiderman: Far From Home," please re-word this change log entry accordingly. Thanks! 😸