You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I struggle with serialization (through the pickle or dill library) of the sp.Spectrum1D object. In particular, the default wcs is not pickle-able. I use serialization to both save the data as pickle file and for multiprocessing of several functions, so this functionality would be helpful, especially since I actually don't really care about the sp.Spectrum1D.wcs attribute.
I know it's possible to bypass this by temporarily removing the wcs with spectrum.wcs = None, or using the high-level API WCS class. However, the first solution is a patchwork solution that doesn't solve the fundamental issue (the default wcs is re-added at some point in my pipeline). I think it is possible to setup the high-level WCS for spectral data, but I am unsure how to do it properly. Right now, I am using the spam CTYPE of WCS to do this, but this resets the spectrum.spectral_axis to pixel array in several functions, which is something I would like to avoid.
Is there a workaround that would fix this issue altogether? I think the easiest way is to create the WCS correctly, but unfortunately, the WCS documentation is not super helpful for the spectral data. As far as I gathered, since my spectral_axis is not linear, I should use the tabulated option, based on this paper, Greisen et al. (2006), section 6. Is there some convenience function in specutils that creates high-level WCS given a spectral_axis?
Hello everyone,
I struggle with serialization (through the
pickle
ordill
library) of thesp.Spectrum1D
object. In particular, the default wcs is not pickle-able. I use serialization to both save the data as pickle file and formultiprocessing
of several functions, so this functionality would be helpful, especially since I actually don't really care about thesp.Spectrum1D.wcs
attribute.I know it's possible to bypass this by temporarily removing the wcs with
spectrum.wcs = None
, or using the high-level APIWCS
class. However, the first solution is a patchwork solution that doesn't solve the fundamental issue (the default wcs is re-added at some point in my pipeline). I think it is possible to setup the high-levelWCS
for spectral data, but I am unsure how to do it properly. Right now, I am using thespam
CTYPE ofWCS
to do this, but this resets thespectrum.spectral_axis
to pixel array in several functions, which is something I would like to avoid.Is there a workaround that would fix this issue altogether? I think the easiest way is to create the
WCS
correctly, but unfortunately, the WCS documentation is not super helpful for the spectral data. As far as I gathered, since my spectral_axis is not linear, I should use the tabulated option, based on this paper, Greisen et al. (2006), section 6. Is there some convenience function inspecutils
that creates high-levelWCS
given aspectral_axis
?Minimal example:
The text was updated successfully, but these errors were encountered: