class sunpy.coordinates.frames.SunPyBaseCoordinateFrame(*args, **kwargs)[source]

Bases: astropy.coordinates.BaseCoordinateFrame

Base class for sunpy coordinate frames.

This class is not intended to be used directly and has no transformations defined.

  • Defines the frame attribute obstime for observation time.

  • Defines a default wrap angle of 180 degrees for longitude in spherical coordinates, which can be overridden via the class variable _wrap_angle.

  • Inject a nice way of representing the object which the coordinate represents.

Attributes Summary





dict() -> new empty dictionary dict(mapping) -> new dictionary initialized from a mapping object's (key, value) pairs dict(iterable) -> new dictionary initialized as if via: d = {} for k, v in iterable: d[k] = v dict(**kwargs) -> new dictionary initialized with the name=value pairs in the keyword argument list. For example: dict(one=1, two=2).



Methods Summary

represent_as(base[, s, in_frame_units])

Generate and return a new representation of this frame's data as a Representation object.

Attributes Documentation

frame_attributes = {'obstime': <sunpy.coordinates.frameattributes.TimeFrameAttributeSunPy object>}
name = 'sunpybasecoordinateframe'
obstime = None

Methods Documentation

represent_as(base, s='base', in_frame_units=False)[source]

Generate and return a new representation of this frame’s data as a Representation object.

Note: In order to make an in-place change of the representation of a Frame or SkyCoord object, set the representation attribute of that object to the desired new representation, or use the set_representation_cls method to also set the differential.

  • base (subclass of BaseRepresentation or string) – The type of representation to generate. Must be a class (not an instance), or the string name of the representation class.

  • s (subclass of BaseDifferential, str, optional) – Class in which any velocities should be represented. Must be a class (not an instance), or the string name of the differential class. If equal to ‘base’ (default), inferred from the base class. If None, all velocity information is dropped.

  • in_frame_units (bool, keyword-only) – Force the representation units to match the specified units particular to this frame


newrep (BaseRepresentation-derived object) – A new representation object of this frame’s data.


AttributeError – If this object had no data


>>> from astropy import units as u
>>> from astropy.coordinates import SkyCoord, CartesianRepresentation
>>> coord = SkyCoord(0*u.deg, 0*u.deg)
>>> coord.represent_as(CartesianRepresentation)  
<CartesianRepresentation (x, y, z) [dimensionless]
        (1., 0., 0.)>
>>> coord.representation_type = CartesianRepresentation
>>> coord  
<SkyCoord (ICRS): (x, y, z) [dimensionless]
    (1., 0., 0.)>