Skip to content

Commit

Permalink
Addressed #6279
Browse files Browse the repository at this point in the history
This fix is based on
astropy/astropy#13305

This fix makes it so that RotatedSunFrame objects
can be pickled and unpickled.
  • Loading branch information
EdBehn committed Jul 26, 2022
1 parent ea8b612 commit 1e3d52d
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions sunpy/coordinates/metaframes.py
Expand Up @@ -216,6 +216,13 @@ def rotated_time(self):
"""
return self.base.obstime + self.duration

def __reduce__(self) :
return (_rotatedsunframe_reducer, (self.base,), self.__dict__)


def _rotatedsunframe_reducer(base) :
return RotatedSunFrame.__new__(RotatedSunFrame, base=base)


# For Astropy 4.3+, we need to manually remove the `obstime` frame attribute from RotatedSunFrame
if 'obstime' in RotatedSunFrame.frame_attributes:
Expand Down

0 comments on commit 1e3d52d

Please sign in to comment.