Skip to content

Fix #110: Ensure spectrogram plotting correctly handles non-UTC time scales#144

Open
Amityush-lgtm wants to merge 3 commits intosunpy:mainfrom
Amityush-lgtm:fix-cdf-time-scale
Open

Fix #110: Ensure spectrogram plotting correctly handles non-UTC time scales#144
Amityush-lgtm wants to merge 3 commits intosunpy:mainfrom
Amityush-lgtm:fix-cdf-time-scale

Conversation

@Amityush-lgtm
Copy link

PR Description

Fixes an issue where plotting data with different time scales i.e. 'tt' and 'utc' would result in time offsets because GenericSpectrogram plotting was using the raw time scale components directly via .datetime. Corrects the plotting logic to always convert to UTC first.
Closes #110

What changed

  • Modified radiospectra/mixins.py to ensure self.times is converted to UTC before generating datetime objects for plotting.
  • Added internal helper _times_utc_datetime to handle the conversion if supported by the time object.
  • Validated that plotting correctly aligns with UTC time regardless of input time scale.

@samaloney, Let me know your thoughts on this!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Time with different scale may be plotted unintentionally.

1 participant