Reference/API#

astropy.coordinates Package#

This subpackage contains classes and functions for celestial coordinates of astronomical objects. It also contains a framework for conversions between coordinate systems.

Functions#

angular_separation(lon1, lat1, lon2, lat2)

Angular separation between two points on a sphere.

cartesian_to_spherical(x, y, z)

Converts 3D rectangular cartesian coordinates to spherical polar coordinates.

concatenate(coords)

Combine multiple coordinate objects into a single SkyCoord.

concatenate_representations(reps)

Combine multiple representation objects into a single instance by concatenating the data in each component.

custom_stokes_symbol_mapping(mapping[, replace])

Add a custom set of mappings from values to Stokes symbols.

get_body(body, time[, location, ephemeris])

Get a SkyCoord for a solar system body as observed from a location on Earth in the GCRS reference system.

get_body_barycentric(body, time[, ephemeris])

Calculate the barycentric position of a solar system body.

get_body_barycentric_posvel(body, time[, ...])

Calculate the barycentric position and velocity of a solar system body.

get_constellation(coord[, short_name, ...])

Determines the constellation(s) a given coordinate object contains.

get_icrs_coordinates(name[, parse, cache])

Retrieve an ICRS object by using an online name resolving service to retrieve coordinates for the specified name.

get_moon(time[, location, ephemeris])

Deprecated since version 5.3.

get_sun(time)

Determines the location of the sun at a given time (or times, if the input is an array Time object), in geocentric coordinates.

golden_spiral_grid(size)

Generate a grid of points on the surface of the unit sphere using the Fibonacci or Golden Spiral method.

make_transform_graph_docs(transform_graph)

Generates a string that can be used in other docstrings to include a transformation graph, showing the available transforms and coordinate systems.

match_coordinates_3d(matchcoord, catalogcoord)

Finds the nearest 3-dimensional matches of a coordinate or coordinates in a set of catalog coordinates.

match_coordinates_sky(matchcoord, catalogcoord)

Finds the nearest on-sky matches of a coordinate or coordinates in a set of catalog coordinates.

offset_by(lon, lat, posang, distance)

Point with the given offset from the given point.

position_angle(lon1, lat1, lon2, lat2)

Position Angle (East of North) between two points on a sphere.

search_around_3d(coords1, coords2, distlimit)

Searches for pairs of points that are at least as close as a specified distance in 3D space.

search_around_sky(coords1, coords2, seplimit)

Searches for pairs of points that have an angular separation at least as close as a specified angle.

spherical_to_cartesian(r, lat, lon)

Converts spherical polar coordinates to rectangular cartesian coordinates.

uniform_spherical_random_surface([size])

Generate a random sampling of points on the surface of the unit sphere.

uniform_spherical_random_volume([size, ...])

Generate a random sampling of points that follow a uniform volume density distribution within a sphere.

Classes#

AffineTransform(transform_func, fromsys, tosys)

A coordinate transformation specified as a function that yields a 3 x 3 cartesian transformation matrix and a tuple of displacement vectors.

AltAz(*args, **kwargs)

A coordinate or frame in the Altitude-Azimuth system (Horizontal coordinates) with respect to the WGS84 ellipsoid.

Angle(angle[, unit, dtype, copy])

One or more angular value(s) with units equivalent to radians or degrees.

Attribute([default, secondary_attribute])

A non-mutable data descriptor to hold a frame attribute.

BarycentricMeanEcliptic(*args[, copy, ...])

Barycentric mean ecliptic coordinates.

BarycentricTrueEcliptic(*args[, copy, ...])

Barycentric true ecliptic coordinates.

BaseAffineTransform(fromsys, tosys[, ...])

Base class for common functionality between the AffineTransform-type subclasses.

BaseBodycentricRepresentation(lon[, lat, ...])

Representation of points in bodycentric 3D coordinates.

BaseCoordinateFrame(*args[, copy, ...])

The base class for coordinate frames.

BaseDifferential(*args, **kwargs)

A base class representing differentials of representations.

BaseEclipticFrame(*args[, copy, ...])

A base class for frames that have names and conventions like that of ecliptic frames.

BaseGeodeticRepresentation(lon[, lat, ...])

Base class for geodetic representations.

BaseRADecFrame(*args[, copy, ...])

A base class that defines default representation info for frames that represent longitude and latitude as Right Ascension and Declination following typical "equatorial" conventions.

BaseRepresentation(*args[, differentials])

Base for representing a point in a 3D coordinate system.

BaseRepresentationOrDifferential(*args, **kwargs)

3D coordinate representations and differentials.

BaseSphericalCosLatDifferential(*args, **kwargs)

Differentials from points on a spherical base representation.

BaseSphericalDifferential(*args, **kwargs)

BoundsError

Raised when an angle is outside of its user-specified bounds.

CIRS(*args[, copy, representation_type, ...])

A coordinate or frame in the Celestial Intermediate Reference System (CIRS).

CartesianDifferential(d_x[, d_y, d_z, unit, ...])

Differentials in of points in 3D cartesian coordinates.

CartesianRepresentation(x[, y, z, unit, ...])

Representation of points in 3D cartesian coordinates.

CartesianRepresentationAttribute([default, ...])

A frame attribute that is a CartesianRepresentation with specified units.

CompositeTransform(transforms, fromsys, tosys)

A transformation constructed by combining together a series of single-step transformations.

ConvertError

Raised if a coordinate system cannot be converted to another.

CoordinateAttribute(frame[, default, ...])

A frame attribute which is a coordinate object.

CoordinateTransform(fromsys, tosys[, ...])

An object that transforms a coordinate from one system to another.

CustomBarycentricEcliptic(*args[, copy, ...])

Barycentric ecliptic coordinates with custom obliquity.

CylindricalDifferential(d_rho[, d_phi, d_z, ...])

Differential(s) of points in cylindrical coordinates.

CylindricalRepresentation(rho[, phi, z, ...])

Representation of points in 3D cylindrical coordinates.

DifferentialAttribute([default, ...])

A frame attribute which is a differential instance.

Distance([value, unit, z, cosmology, ...])

A one-dimensional distance.

DynamicMatrixTransform(matrix_func, fromsys, ...)

A coordinate transformation specified as a function that yields a 3 x 3 cartesian transformation matrix.

EarthLocation(*args, **kwargs)

Location on the Earth.

EarthLocationAttribute([default, ...])

A frame attribute that can act as a EarthLocation.

FK4(*args[, copy, representation_type, ...])

A coordinate or frame in the FK4 system.

FK4NoETerms(*args[, copy, ...])

A coordinate or frame in the FK4 system, but with the E-terms of aberration removed.

FK5(*args[, copy, representation_type, ...])

A coordinate or frame in the FK5 system.

FunctionTransform(func, fromsys, tosys[, ...])

A coordinate transformation defined by a function that accepts a coordinate object and returns the transformed coordinate object.

FunctionTransformWithFiniteDifference(func, ...)

Transormation based on functions using finite difference for velocities.

GCRS(*args[, copy, representation_type, ...])

A coordinate or frame in the Geocentric Celestial Reference System (GCRS).

GRS80GeodeticRepresentation(lon[, lat, ...])

Representation of points in GRS80 3D geodetic coordinates.

Galactic(*args[, copy, representation_type, ...])

A coordinate or frame in the Galactic coordinate system.

GalacticLSR(*args[, copy, ...])

A coordinate or frame in the Local Standard of Rest (LSR), axis-aligned to the Galactic frame.

Galactocentric(*args, **kwargs)

A coordinate or frame in the Galactocentric system.

GenericFrame(frame_attrs)

A frame object that can't store data but can hold any arbitrary frame attributes.

GeocentricMeanEcliptic(*args[, copy, ...])

Geocentric mean ecliptic coordinates.

GeocentricTrueEcliptic(*args[, copy, ...])

Geocentric true ecliptic coordinates.

HADec(*args, **kwargs)

A coordinate or frame in the Hour Angle-Declination system (Equatorial coordinates) with respect to the WGS84 ellipsoid.

HCRS(*args[, copy, representation_type, ...])

A coordinate or frame in a Heliocentric system, with axes aligned to ICRS.

HeliocentricEclipticIAU76(*args[, copy, ...])

Heliocentric mean (IAU 1976) ecliptic coordinates.

HeliocentricMeanEcliptic(*args[, copy, ...])

Heliocentric mean ecliptic coordinates.

HeliocentricTrueEcliptic(*args[, copy, ...])

Heliocentric true ecliptic coordinates.

ICRS(*args[, copy, representation_type, ...])

A coordinate or frame in the ICRS system.

ITRS(*args[, copy, representation_type, ...])

A coordinate or frame in the International Terrestrial Reference System (ITRS).

IllegalHourError(hour)

Raised when an hour value is not in the range [0,24).

IllegalHourWarning(hour[, alternativeactionstr])

Raised when an hour value is 24.

IllegalMinuteError(minute)

Raised when an minute value is not in the range [0,60].

IllegalMinuteWarning(minute[, ...])

Raised when a minute value is 60.

IllegalSecondError(second)

Raised when an second value (time) is not in the range [0,60].

IllegalSecondWarning(second[, ...])

Raised when a second value is 60.

LSR(*args[, copy, representation_type, ...])

A coordinate or frame in the Local Standard of Rest (LSR).

LSRD(*args[, copy, representation_type, ...])

A coordinate or frame in the Dynamical Local Standard of Rest (LSRD).

LSRK(*args[, copy, representation_type, ...])

A coordinate or frame in the Kinematic Local Standard of Rest (LSR).

Latitude(angle[, unit])

Latitude-like angle(s) which must be in the range -90 to +90 deg.

Longitude(angle[, unit, wrap_angle])

Longitude-like angle(s) which are wrapped within a contiguous 360 degree range.

PhysicsSphericalDifferential(d_phi[, ...])

Differential(s) of 3D spherical coordinates using physics convention.

PhysicsSphericalRepresentation(phi[, theta, ...])

Representation of points in 3D spherical coordinates (using the physics convention of using phi and theta for azimuth and inclination from the pole).

PrecessedGeocentric(*args[, copy, ...])

A coordinate frame defined in a similar manner as GCRS, but precessed to a requested (mean) equinox.

QuantityAttribute([default, ...])

A frame attribute that is a quantity with specified units and shape (optionally).

RadialDifferential(*args, **kwargs)

Differential(s) of radial distances.

RadialRepresentation(distance[, ...])

Representation of the distance of points from the origin.

RangeError

Raised when some part of an angle is out of its valid range.

RepresentationMapping(reprname, framename[, ...])

This NamedTuple is used with the frame_specific_representation_info attribute to tell frames what attribute names (and default units) to use for a particular representation.

SkyCoord(*args[, copy])

High-level object providing a flexible interface for celestial coordinate representation, manipulation, and transformation between systems.

SkyCoordInfo([bound])

Container for meta information like name, description, format.

SkyOffsetFrame(*args, **kwargs)

A frame which is relative to some specific position and oriented to match its frame.

SpectralCoord(value[, unit, observer, ...])

A spectral coordinate with its corresponding unit.

SpectralQuantity(value[, unit, ...])

One or more value(s) with spectral units.

SphericalCosLatDifferential(d_lon_coslat[, ...])

Differential(s) of points in 3D spherical coordinates.

SphericalDifferential(d_lon[, d_lat, ...])

Differential(s) of points in 3D spherical coordinates.

SphericalRepresentation(lon[, lat, ...])

Representation of points in 3D spherical coordinates.

StaticMatrixTransform(matrix, fromsys, tosys)

A coordinate transformation defined as a 3 x 3 cartesian transformation matrix.

StokesCoord(stokes[, copy])

A representation of stokes coordinates with helpers for converting to profile names.

StokesSymbol([symbol, description])

Symbol for a Stokes coordinate.

Supergalactic(*args[, copy, ...])

Supergalactic Coordinates (see Lahav et al. 2000, <https://ui.adsabs.harvard.edu/abs/2000MNRAS.312..166L>, and references therein).

TEME(*args[, copy, representation_type, ...])

A coordinate or frame in the True Equator Mean Equinox frame (TEME).

TETE(*args[, copy, representation_type, ...])

An equatorial coordinate or frame using the True Equator and True Equinox (TETE).

TimeAttribute([default, secondary_attribute])

Frame attribute descriptor for quantities that are Time objects.

TransformGraph()

A graph representing the paths between coordinate frames.

UnitSphericalCosLatDifferential(d_lon_coslat)

Differential(s) of points on a unit sphere.

UnitSphericalDifferential(d_lon[, d_lat, copy])

Differential(s) of points on a unit sphere.

UnitSphericalRepresentation(lon[, lat, ...])

Representation of points on a unit sphere.

UnknownSiteException(site, attribute[, ...])

WGS72GeodeticRepresentation(lon[, lat, ...])

Representation of points in WGS72 3D geodetic coordinates.

WGS84GeodeticRepresentation(lon[, lat, ...])

Representation of points in WGS84 3D geodetic coordinates.

galactocentric_frame_defaults()

Global setting of default values for the frame attributes in the Galactocentric frame.

solar_system_ephemeris()

Default ephemerides for calculating positions of Solar-System bodies.

Class Inheritance Diagram#

Inheritance diagram of astropy.coordinates.transformations.AffineTransform, astropy.coordinates.builtin_frames.altaz.AltAz, astropy.coordinates.angles.core.Angle, astropy.coordinates.attributes.Attribute, astropy.coordinates.builtin_frames.ecliptic.BarycentricMeanEcliptic, astropy.coordinates.builtin_frames.ecliptic.BarycentricTrueEcliptic, astropy.coordinates.transformations.BaseAffineTransform, astropy.coordinates.representation.geodetic.BaseBodycentricRepresentation, astropy.coordinates.baseframe.BaseCoordinateFrame, astropy.coordinates.representation.base.BaseDifferential, astropy.coordinates.builtin_frames.ecliptic.BaseEclipticFrame, astropy.coordinates.representation.geodetic.BaseGeodeticRepresentation, astropy.coordinates.builtin_frames.baseradec.BaseRADecFrame, astropy.coordinates.representation.base.BaseRepresentation, astropy.coordinates.representation.base.BaseRepresentationOrDifferential, astropy.coordinates.representation.spherical.BaseSphericalCosLatDifferential, astropy.coordinates.representation.spherical.BaseSphericalDifferential, astropy.coordinates.angles.errors.BoundsError, astropy.coordinates.builtin_frames.cirs.CIRS, astropy.coordinates.representation.cartesian.CartesianDifferential, astropy.coordinates.representation.cartesian.CartesianRepresentation, astropy.coordinates.attributes.CartesianRepresentationAttribute, astropy.coordinates.transformations.CompositeTransform, astropy.coordinates.errors.ConvertError, astropy.coordinates.attributes.CoordinateAttribute, astropy.coordinates.transformations.CoordinateTransform, astropy.coordinates.builtin_frames.ecliptic.CustomBarycentricEcliptic, astropy.coordinates.representation.cylindrical.CylindricalDifferential, astropy.coordinates.representation.cylindrical.CylindricalRepresentation, astropy.coordinates.attributes.DifferentialAttribute, astropy.coordinates.distances.Distance, astropy.coordinates.transformations.DynamicMatrixTransform, astropy.coordinates.earth.EarthLocation, astropy.coordinates.attributes.EarthLocationAttribute, astropy.coordinates.builtin_frames.fk4.FK4, astropy.coordinates.builtin_frames.fk4.FK4NoETerms, astropy.coordinates.builtin_frames.fk5.FK5, astropy.coordinates.transformations.FunctionTransform, astropy.coordinates.transformations.FunctionTransformWithFiniteDifference, astropy.coordinates.builtin_frames.gcrs.GCRS, astropy.coordinates.representation.geodetic.GRS80GeodeticRepresentation, astropy.coordinates.builtin_frames.galactic.Galactic, astropy.coordinates.builtin_frames.lsr.GalacticLSR, astropy.coordinates.builtin_frames.galactocentric.Galactocentric, astropy.coordinates.baseframe.GenericFrame, astropy.coordinates.builtin_frames.ecliptic.GeocentricMeanEcliptic, astropy.coordinates.builtin_frames.ecliptic.GeocentricTrueEcliptic, astropy.coordinates.builtin_frames.hadec.HADec, astropy.coordinates.builtin_frames.hcrs.HCRS, astropy.coordinates.builtin_frames.ecliptic.HeliocentricEclipticIAU76, astropy.coordinates.builtin_frames.ecliptic.HeliocentricMeanEcliptic, astropy.coordinates.builtin_frames.ecliptic.HeliocentricTrueEcliptic, astropy.coordinates.builtin_frames.icrs.ICRS, astropy.coordinates.builtin_frames.itrs.ITRS, astropy.coordinates.angles.errors.IllegalHourError, astropy.coordinates.angles.errors.IllegalHourWarning, astropy.coordinates.angles.errors.IllegalMinuteError, astropy.coordinates.angles.errors.IllegalMinuteWarning, astropy.coordinates.angles.errors.IllegalSecondError, astropy.coordinates.angles.errors.IllegalSecondWarning, astropy.coordinates.builtin_frames.lsr.LSR, astropy.coordinates.builtin_frames.lsr.LSRD, astropy.coordinates.builtin_frames.lsr.LSRK, astropy.coordinates.angles.core.Latitude, astropy.coordinates.angles.core.Longitude, astropy.coordinates.representation.spherical.PhysicsSphericalDifferential, astropy.coordinates.representation.spherical.PhysicsSphericalRepresentation, astropy.coordinates.builtin_frames.gcrs.PrecessedGeocentric, astropy.coordinates.attributes.QuantityAttribute, astropy.coordinates.representation.spherical.RadialDifferential, astropy.coordinates.representation.spherical.RadialRepresentation, astropy.coordinates.angles.errors.RangeError, astropy.coordinates.baseframe.RepresentationMapping, astropy.coordinates.sky_coordinate.SkyCoord, astropy.coordinates.sky_coordinate.SkyCoordInfo, astropy.coordinates.builtin_frames.skyoffset.SkyOffsetFrame, astropy.coordinates.spectral_coordinate.SpectralCoord, astropy.coordinates.spectral_quantity.SpectralQuantity, astropy.coordinates.representation.spherical.SphericalCosLatDifferential, astropy.coordinates.representation.spherical.SphericalDifferential, astropy.coordinates.representation.spherical.SphericalRepresentation, astropy.coordinates.transformations.StaticMatrixTransform, astropy.coordinates.polarization.StokesCoord, astropy.coordinates.polarization.StokesSymbol, astropy.coordinates.builtin_frames.supergalactic.Supergalactic, astropy.coordinates.builtin_frames.equatorial.TEME, astropy.coordinates.builtin_frames.equatorial.TETE, astropy.coordinates.attributes.TimeAttribute, astropy.coordinates.transformations.TransformGraph, astropy.coordinates.representation.spherical.UnitSphericalCosLatDifferential, astropy.coordinates.representation.spherical.UnitSphericalDifferential, astropy.coordinates.representation.spherical.UnitSphericalRepresentation, astropy.coordinates.errors.UnknownSiteException, astropy.coordinates.representation.geodetic.WGS72GeodeticRepresentation, astropy.coordinates.representation.geodetic.WGS84GeodeticRepresentation, astropy.coordinates.builtin_frames.galactocentric.galactocentric_frame_defaults, astropy.coordinates.solar_system.solar_system_ephemeris