aboutsummaryrefslogtreecommitdiff
path: root/noao/astutil/asttools/astvrotate.x
diff options
context:
space:
mode:
authorJoseph Hunkeler <jhunkeler@gmail.com>2015-07-08 20:46:52 -0400
committerJoseph Hunkeler <jhunkeler@gmail.com>2015-07-08 20:46:52 -0400
commitfa080de7afc95aa1c19a6e6fc0e0708ced2eadc4 (patch)
treebdda434976bc09c864f2e4fa6f16ba1952b1e555 /noao/astutil/asttools/astvrotate.x
downloadiraf-linux-fa080de7afc95aa1c19a6e6fc0e0708ced2eadc4.tar.gz
Initial commit
Diffstat (limited to 'noao/astutil/asttools/astvrotate.x')
-rw-r--r--noao/astutil/asttools/astvrotate.x43
1 files changed, 43 insertions, 0 deletions
diff --git a/noao/astutil/asttools/astvrotate.x b/noao/astutil/asttools/astvrotate.x
new file mode 100644
index 00000000..df5b9b1c
--- /dev/null
+++ b/noao/astutil/asttools/astvrotate.x
@@ -0,0 +1,43 @@
+include <math.h>
+
+# AST_VROTATE -- Radial velocity component of the observer relative to
+# the center of the Earth due to the Earth's rotation.
+
+procedure ast_vrotate (ra, dec, epoch, latitude, longitude, altitude, v)
+
+double ra # Right Ascension of observation (hours)
+double dec # Declination of observation (degrees)
+double epoch # Epoch of observation (Julian epoch)
+double latitude # Latitude (degrees)
+double longitude # Latitude (degrees)
+double altitude # Altitude (meters)
+double v # Velocity (km / s)
+
+double lat, dlat, r, vc, lmst, ast_mst()
+
+begin
+ # LAT is the latitude in radians.
+ lat = DEGTORAD (latitude)
+
+ # Reduction of geodetic latitude to geocentric latitude (radians).
+ # Dlat is in arcseconds.
+
+ dlat = -(11. * 60. + 32.743000d0) * sin (2 * lat) +
+ 1.163300d0 * sin (4 * lat) -0.002600d0 * sin (6 * lat)
+ lat = lat + DEGTORAD (dlat / 3600.)
+
+ # R is the radius vector from the Earth's center to the observer
+ # (meters). Vc is the corresponding circular velocity
+ # (meters/sidereal day converted to km / sec).
+ # (sidereal day = 23.934469591229 hours (1986))
+
+ r = 6378160.0d0 * (0.998327073d0 + 0.00167643800d0 * cos (2 * lat) -
+ 0.00000351d0 * cos (4 * lat) + 0.000000008d0 * cos (6 * lat)) +
+ altitude
+ vc = TWOPI * (r / 1000.) / (23.934469591229d0 * 3600.)
+
+ # Project the velocity onto the line of sight to the star.
+ lmst = ast_mst (epoch, longitude)
+ v = vc * cos (lat) * cos (DEGTORAD (dec)) *
+ sin (DEGTORAD ((ra - lmst) * 15.))
+end