-
-
Notifications
You must be signed in to change notification settings - Fork 37
Fix mixed frequency unit plotting on shared axes #151
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
Merged
samaloney
merged 6 commits into
sunpy:main
from
Amityush-lgtm:fix-spectrogram-plotting-units-clean
Feb 23, 2026
Merged
Changes from 4 commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
15a6e61
Resolve conflicts with merged PR #144 and simplify axis converter
b848a9a
Fix Matplotlib CI failure on older versions missing set_converter
b222ab9
Retrieve quantity_support and pin axis converter for backward compati…
8bc64c5
Fix WAVES filename date parsing
cd1eec9
reverting out-of-scope changes and cleaning up tests
6d50f8b
Merge branch 'main' into fix-spectrogram-plotting-units-clean
Amityush-lgtm 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 hidden or 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 |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| Fixed mixed frequency unit plotting on shared axes to correctly convert units when multiple spectrograms with different frequency units are plotted together. |
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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,3 +1,33 @@ | ||
| import matplotlib | ||
|
|
||
| matplotlib.use("Agg") | ||
|
|
||
| import numpy as np | ||
| import pytest | ||
|
|
||
| import astropy.units as u | ||
| from astropy.time import Time | ||
|
|
||
| from radiospectra.spectrogram.spectrogrambase import GenericSpectrogram | ||
|
|
||
|
|
||
| @pytest.fixture | ||
| def make_spectrogram(): | ||
| """Factory fixture to create test spectrograms with given frequencies.""" | ||
|
|
||
| def _make(frequencies, times=None, scale="utc"): | ||
| if times is None: | ||
| times = Time("2020-01-01T00:00:00", format="isot", scale=scale) + np.arange(4) * u.min | ||
| meta = { | ||
| "observatory": "Test", | ||
| "instrument": "TestInst", | ||
| "detector": "TestDet", | ||
| "start_time": times[0], | ||
| "end_time": times[-1], | ||
| "wavelength": np.array([1, 10]) * u.m, | ||
| "times": times, | ||
| "freqs": frequencies, | ||
| } | ||
| return GenericSpectrogram(np.arange(16).reshape(4, 4), meta) | ||
|
|
||
| return _make |
This file contains hidden or 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
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.
Uh oh!
There was an error while loading. Please reload this page.