Add setter for times attribute to support light travel time corrections#140
Add setter for times attribute to support light travel time corrections#140Amityush-lgtm wants to merge 2 commits intosunpy:mainfrom
Conversation
9214d59 to
ecfd4aa
Compare
|
Hi @samaloney, I’ve updated the PR to address the initial CI failures (renamed the changelog to #140 and fixed the linting issues). The remaining CI failures in These failures seem to be due to recent breaking changes in Let me know if you’d like me to open a separate issue for the SunPy compatibility problem or if there’s anything else you’d like me to adjust here. Thanks! |
PR Description
Adds a setter for the
timesproperty inGenericSpectrogramto enable users to update time coordinates. This allows for light travel time corrections when comparing data from multiple spacecraft at different distances (e.g., Solar Orbiter RPW and Parker Solar Probe).Closes #77
What changed
Added a
timessetter inradiospectra/spectrogram/spectrogrambase.pyastropy.time.Timeastropy.units.Quantity(e.g.,500 * u.s) and applies it as an offset to the existingTimearraymeta["start_time"]/meta["end_time"]to stay consistent with the updated axisAdded unit tests in
radiospectra/tests/test_spectrogrambase.pycovering:TimedirectlyQuantityoffsetExample
Before:
After:
@samaloney @hayesla