API/Reference
Index
SkyCoords.AbstractSkyCoords
SkyCoords.EclipticCoords
SkyCoords.FK5Coords
SkyCoords.GalCoords
SkyCoords.ICRSCoords
SkyCoords.SuperGalCoords
SkyCoords.offset
SkyCoords.position_angle
SkyCoords.separation
Types
SkyCoords.AbstractSkyCoords
— TypeThe supertype for all sky coordinate systems.
SkyCoords.ICRSCoords
— TypeICRSCoords(ra, dec)
International Celestial Reference System
This is the current standard adopted by the International Astronomical Union notably due to its high level of accuracy compared to standard equatorial coordinate systems. What sets this apart from FK5Coords
is that it is completely defined using extragalactic radio sources rather than a geocentric frame, which means the reference frame will not change due to Earth's motion.
Coordinates
ra
- Right ascension in radians (0, 2π)dec
- Declination in radians (-π/2, π/2)
SkyCoords.GalCoords
— TypeGalCoords(l, b)
This coordinate system is defined based on the projection of the Milky Way galaxy onto our celestial sphere, with (0, 0) being approximately the center of our galaxy.
Coordinates
l
- Galactic longitude in radians (-π, π)b
- Galactic latitude in radians (-π/2, π/2)
SkyCoords.SuperGalCoords
— TypeSuperGalCoords(l, b)
Supergalactic Coordinate System
The supergalactic plane is part of a reference frame for the supercluster of galaxies that contains the Milky Way galaxy. The supergalactic plane as so-far observed is more or less perpendicular to the plane of the Milky Way, the angle is 84.5 degrees. Viewed from the Earth, the plane traces a great circle across the sky through the constellations
Coordinates
l
- SuperGalCoords longitude in radians (-π, π)b
- SuperGalCoords latitude in radians (-π/2, π/2)
SkyCoords.FK5Coords
— TypeFK5Coords{equinox}(ra, dec)
This coordinate system maps the celestial sphere based on a geocentric observer. Historically the oldest, this coordinate system has been shown to be inaccurate due to its definitions based on the Earth, which has long-scale precession causing the reference frame to change. Because of this, an equinox must be provided (typically 2000, commonly known as J2000) which defines the reference frame.
Coordinates
ra
- Right ascension in radians (0, 2π)dec
- Declination in radians (-π/2, π/2)
SkyCoords.EclipticCoords
— TypeEclipticCoords{equinox}(lon, lat)
This coordinate system is geocentric with the ecliptic plane as the xy-plane with x oriented according to the equinox specified by equinox
.
Coordinates
lon
- Longitude in radians (0, 2π)lat
- Latitude in radians (-π/2, π/2)
Conversion
To convert between types, there are three (equivalent) methods of doing so.
julia> c1 = ICRSCoords(0., 0.)
ICRSCoords{Float64}(0.0, 0.0)
- using
convert
julia> convert(GalCoords, c1) GalCoords{Float64}(1.6814027872278692, -1.0504884034813007)
- using constructors
julia> GalCoords(c1) GalCoords{Float64}(1.6814027872278692, -1.0504884034813007)
- using
|>
julia> c1 |> GalCoords GalCoords{Float64}(1.6814027872278692, -1.0504884034813007)
Functions
SkyCoords.separation
— Functionseparation(c1::AbstractSkyCoords, c2::AbstractSkyCoords) -> distance
Return angular separation between two sky coordinates, in radians.
The angular separation is calculated using the Vincenty formula, which is slightly more complex and computationally expensive than some alternatives, but is stable at at all distances, including the poles and antipodes.
SkyCoords.position_angle
— Functionposition_angle(c1::AbstractSkyCoords, c2::AbstractSkyCoords) -> angle
Return position angle between two sky coordinates, in positive radians.
Examples
julia> c1 = ICRSCoords(0, 0); c2 = ICRSCoords(deg2rad(1), 0);
julia> position_angle(c1, c2) |> rad2deg
90.0
SkyCoords.offset
— Functionoffset(::AbstractSkyCoords, separation, pa) -> coordinate
Offset a coordinate by a given angular separation, separation
, in radians and position angle, pa
, in radians.
Uses the sine and cosine rules in spherical coordinates with corrections for the antipodes. Returns a sky coordinate of the same type as input.
Examples
julia> c1 = ICRSCoords(0, 0);
julia> c2 = offset(c1, deg2rad(1), deg2rad(90))
ICRSCoords{Float64}(0.017453292519943295, 1.0686516840418957e-18)
julia> offset(c1, c2) .|> rad2deg
(1.0, 90.0)
See Also
offset(::AbstractSkyCoords, AbstractSkyCoords) -> angle, angle
Return the separation and position angle in radians between two sky coordinates.
Examples
julia> c1 = ICRSCoords(0, 0); c2 = ICRSCoords(deg2rad(1), 0);
julia> offset(c1, c2) .|> rad2deg
(1.0, 90.0)
See Also