sunpy / radiospectra

Provide support for some type of radio spectra on solar physics
https://docs.sunpy.org/projects/radiospectra
BSD 2-Clause "Simplified" License
13 stars 21 forks source link

Ability to set time attribute #77

Open hayesla opened 2 years ago

hayesla commented 2 years ago

Describe the feature

For doing comparisons between multiple spacecraft at different AU (e.g. solo, psp) you may want to adjust time for light travel time for comparisons of timing etc.

Use case - plot RPW and PSP data on same plot and adjust for light travel between the two.

At the moment, if you try update the spec.times attribute, something like

spec.times = spec_times + light_travel_time you get the AttributeError: can't set attribute error.

It would be nice to be able to do this - thoughts on allowing a method to update it?

samaloney commented 1 year ago

Yea I guess like map don't really want to alter the meta data but need to allow this some how. Long term what I really want it something like:

with spectrogram.assumeLightTravel(spec1.observer):
    spec2.plot()

but what could maybe be done now would be something like:

with spectrogram.assumeLightTravel(-100*u.s):
    spec2.plot()

what do you think?