libTheSky
Routines to compute sky positions of Sun, Moon, planets and more
All Namespaces Files Functions Variables Pages
coordinates.f90 File Reference

(libTheSky version 0.4.3, revision 299, hash 71a3740, 2025-03-02)

Procedures to perform coordinate transformations, apply precession, and more for libTheSky. More...

Go to the source code of this file.

Modules

module  thesky_coordinates
 Procedures for coordinates.
 

Functions/Subroutines

subroutine thesky_coordinates::hc_spher_2_gc_rect (l, b, r, l0, b0, r0, x, y, z)
 Compute the geocentric rectangular coordinates of a planet, from its and the Earth's heliocentric spherical position.
 
subroutine thesky_coordinates::ecl_spher_2_eq_rect (l, b, r, eps, x, y, z)
 Convert spherical, ecliptical coordinates to rectangular, equatorial coordinates of an object - both geocentric.
 
subroutine thesky_coordinates::calcsunxyz (t1, l0, b0, r0, x, y, z)
 Compute the geocentric equatorial rectangular coordinates of the Sun, from Earth's heliocentric, spherical position.
 
subroutine thesky_coordinates::precess_xyz (jd1, jd2, x, y, z)
 Compute the precession of the equinoxes in rectangular coordinates, from jd1 to jd2.
 
subroutine thesky_coordinates::precess_eq (jd1, jd2, a1, d1)
 Compute the precession of the equinoxes in equatorial coordinates, from jd1 to jd2.
 
subroutine thesky_coordinates::precess_eq_yr (yr1, yr2, a1, d1)
 Compute the precession of the equinoxes in equatorial coordinates, from yr1 to yr2.
 
subroutine thesky_coordinates::precess_ecl (jd1, jd2, l, b)
 Compute the precession of the equinoxes in geocentric ecliptical coordinates.
 
subroutine thesky_coordinates::precess_orb (jd1, jd2, i, o1, o2)
 Compute the precession of the equinoxes in orbital elements.
 
subroutine thesky_coordinates::rect_2_spher (x, y, z, l, b, r)
 Convert rectangular coordinates x,y,z to spherical coordinates l,b,r.
 
subroutine thesky_coordinates::aberration_ecl (t, l0, l, b)
 Correct ecliptic longitude and latitiude for annual aberration.
 
subroutine thesky_coordinates::aberration_eq (jd, ra, dec, dra, ddec, eps0)
 Correct equatorial coordinates for annual aberration - moderate accuracy, use for stars.
 
subroutine thesky_coordinates::fk5 (t, l, b)
 Convert coordinates to the FK5 system.
 
subroutine thesky_coordinates::ecl_2_eq (l, b, eps, ra, dec)
 Convert (geocentric) spherical ecliptical coordinates l,b (and eps) to spherical equatorial coordinates RA, Dec.
 
subroutine thesky_coordinates::eq_2_ecl (ra, dec, eps, l, b)
 Convert (geocentric) spherical equatorial coordinates RA, Dec (and eps) to spherical ecliptical coordinates l,b.
 
subroutine thesky_coordinates::eq2horiz (ra, dec, agst, hh, az, alt, lat, lon)
 Convert spherical equatorial coordinates (RA, dec, agst) to spherical horizontal coordinates (hh, az, alt)
 
subroutine thesky_coordinates::horiz2eq (az, alt, agst, hh, ra, dec, lat, lon)
 Convert spherical horizontal coordinates (az, alt, agst) to spherical equatorial coordinates (hh, RA, dec)
 
subroutine thesky_coordinates::eq2gal (ra, dec, l, b)
 Convert spherical equatorial coordinates (RA, dec) to spherical galactic coordinates (l,b), for J2000.0!!!
 
subroutine thesky_coordinates::gal2eq (l, b, ra, dec)
 Convert spherical galactic coordinates (l,b) to spherical equatorial coordinates (RA, dec), for J2000.0!!!
 
subroutine thesky_coordinates::geoc2topoc_ecl (gcl, gcb, gcr, gcs, eps, lst, tcl, tcb, tcs, lat, hgt)
 Convert spherical ecliptical coordinates from the geocentric to the topocentric system.
 
subroutine thesky_coordinates::geoc2topoc_eq (gcra, gcd, gcr, gch, tcra, tcd, lat, hgt)
 Convert geocentric equatorial coordinates to topocentric.
 
real(double) function thesky_coordinates::refract (alt, press, temp)
 Compute the atmospheric refraction for a given true altitude. You should add the result to the uncorrected altitude in order to obtain the observed altitude. Return 0 if alt + refract < -0.3°.
 
real function thesky_coordinates::refract_sp (alt, press, temp)
 Compute the atmospheric refraction for a given true altitude, using single-precision values. This is a wrapper for refract().
 
real(double) function thesky_coordinates::atmospheric_refraction (alt0, h0, lat0, t0, p0, rh, lam, dtdh, eps)
 Compute the atmospheric refraction of light for a given true altitude. Return 0 for alt<-0.9°. This is a wrapper for aref(), which does the opposite (compute refraction for an apparent zenith angle). This is an expensive way to go about(!)
 
real(double) function thesky_coordinates::atmospheric_refraction_apparent (alt0, h0, ph, t0, p0, rh, lam, dtdh, eps)
 Compute the atmospheric refraction of light for a given apparent (observed) altitude of a celestial object and a given observer. Note that you will usually want to use the true altitude as input instead. The method is based on N.A.O Technical Notes 59 and 63 and a paper by Standish and Auer 'Astronomical Refraction: Computational Method for all Zenith Angles'. Return 0 if alt<-1.102°.
 
real(double) function thesky_coordinates::aref (z0, h0, ph, t0, p0, rh, lam, dtdh, eps)
 Compute the atmospheric refraction of light for a given apparent (observed) zenith angle. The method is based on N.A.O Technical Notes 59 and 63 and a paper by Standish and Auer 'Astronomical Refraction: Computational Method for all Zenith Angles'. Return 0 if z0>91.102°.
 
real(double) function thesky_coordinates::refi (r, n, dndr)
 The refraction integrand for atmospheric_refraction_apparent()
 
subroutine thesky_coordinates::troposphere_model (r0, t0, a, r, t, n, dndr)
 Troposphere model for atmospheric_refraction_apparent()
 
subroutine thesky_coordinates::stratosphere_model (rt, tt, nt, a, r, n, dndr)
 Stratosphere model for atmospheric_refraction_apparent()
 

Detailed Description

Procedures to perform coordinate transformations, apply precession, and more for libTheSky.

Definition in file coordinates.f90.