Heliocentric#
- class sunpy.coordinates.frames.Heliocentric(*args, **kwargs)[source]#
Bases:
SunPyBaseCoordinateFrameA coordinate or frame in the Heliocentric system, which is observer-based.
The origin is the center of the Sun.
The Z-axis is aligned with the Sun-observer line.
The Y-axis is aligned with the component of the vector to the Sun’s north pole that is perpendicular to the Z-axis.
This frame defaults to a Cartesian component representation, which is known as Heliocentric Cartesian (HCC). This frame can also be represented using cylindrical components, where where
rhois the impact parameter andpsiis the position angle.psiis measured relative to the west limb, rather than solar north, so is shifted by 90 degrees compared to the convention of the Heliocentric Radial (HCR) system.A new instance can be created using the following signatures (note that if supplied,
obstime,observer, andrepresentation_typemust be keyword arguments):Heliocentric(x, y, z, obstime=obstime, observer=observer) Heliocentric(rho, psi, z, representation_type='cylindrical', obstime=obstime, observer=observer)
- Parameters:
data (
BaseRepresentationorNone) – A representation object orNoneto have no data (or use the coordinate component arguments, see below).x (
Quantity, optional) – X-axis coordinate for this object. Not needed ifdatais given.y (
Quantity, optional) – Y-axis coordinate for this object. Not needed ifdatais given.z (
Quantity, optional) – Z-axis coordinate for this object. Not needed ifdatais given.observer (
HeliographicStonyhurst, str) – The location of the observer. If a string is provided, it must be a solar system body that can be parsed byget_body_heliographic_stonyhurstat the timeobstime. Defaults to Earth center.obstime (
tuple,list,str,pandas.Timestamp,pandas.Index,pandas.Series,pandas.DatetimeIndex,datetime.datetime,datetime.date,numpy.datetime64,numpy.ndarray,astropy.time.Time) – The time of the observation. This is used to determine the position of solar-system bodies (e.g., the Sun and the Earth) as needed to define the origin and orientation of the frame.representation_type (
BaseRepresentation, str, optional) – A representation class or string name of a representation class. This may change the valid coordinate component arguments from the defaults (see above). For example, passingrepresentation_type='cartesian'will make the frame expect Cartesian coordinate component arguments (typically,x,y, andz).copy (bool, optional) – If
True(default), make copies of the input coordinate arrays.
Examples
>>> from astropy.coordinates import SkyCoord, CartesianRepresentation >>> import sunpy.coordinates >>> import astropy.units as u
>>> sc = SkyCoord(CartesianRepresentation(10*u.km, 1*u.km, 2*u.km), ... obstime="2011/01/05T00:00:50", observer="earth", frame="heliocentric") >>> sc <SkyCoord (Heliocentric: obstime=2011-01-05T00:00:50.000, observer=<HeliographicStonyhurst Coordinate for 'earth'>): (x, y, z) in km (10., 1., 2.)>
>>> sc = SkyCoord([1,2]*u.km, [3,4]*u.m, [5,6]*u.cm, ... obstime="2011/01/01T00:00:54", observer="earth", frame="heliocentric") >>> sc <SkyCoord (Heliocentric: obstime=2011-01-01T00:00:54.000, observer=<HeliographicStonyhurst Coordinate for 'earth'>): (x, y, z) in (km, m, cm) [(1., 3., 5.), (2., 4., 6.)]>
>>> sc = SkyCoord(CylindricalRepresentation(10*u.km, 60*u.deg, 10*u.km), ... obstime="2011/01/05T00:00:50", observer="earth", frame="heliocentric") >>> sc <SkyCoord (Heliocentric: obstime=2011-01-05T00:00:50.000, observer=<HeliographicStonyhurst Coordinate for 'earth'>): (x, y, z) in km (5., 8.66025404, 10.)>
Attributes Summary
Default representation for differential data (e.g., velocity)
Default representation for position data
Mapping for frame-specific component names
A frame attribute
Methods Summary
represent_as(base[, s, in_frame_units])Generate and return a new representation of this frame's
dataas a Representation object.Attributes Documentation
- default_differential#
Default representation for differential data (e.g., velocity)
- default_representation#
Default representation for position data
- frame_attributes = {'observer': <sunpy.coordinates.frameattributes.ObserverCoordinateAttribute object>, 'obstime': <sunpy.coordinates.frameattributes.TimeFrameAttributeSunPy object>}#
- frame_specific_representation_info#
Mapping for frame-specific component names
- name = 'heliocentric'#
Methods Documentation
- represent_as(base, s='base', in_frame_units=False)[source]#
Generate and return a new representation of this frame’s
dataas a Representation object.Note: In order to make an in-place change of the representation of a Frame or SkyCoord object, set the
representationattribute of that object to the desired new representation, or use theset_representation_clsmethod 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. IfNone, 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.)>