SunPyBaseCoordinateFrame#

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

Bases: 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

default_differential

Default representation for differential data (e.g., velocity)

default_representation

Default representation for position data

frame_attributes

frame_specific_representation_info

Mapping for frame-specific component names

name

obstime

A frame attribute

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

default_differential#

Default representation for differential data (e.g., velocity)

default_representation#

Default representation for position data

frame_attributes = {'obstime': <sunpy.coordinates.frameattributes.TimeFrameAttributeSunPy object>}#
frame_specific_representation_info#

Mapping for frame-specific component names

name = 'sunpybasecoordinateframe'#
obstime#

A frame attribute

No default value

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.

Parameters:
  • 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

Returns:

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

Raises:

AttributeError – If this object had no data

Examples

>>> 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.)>