diff options
author | Joe Hunkeler <jhunkeler@gmail.com> | 2015-08-11 16:51:37 -0400 |
---|---|---|
committer | Joe Hunkeler <jhunkeler@gmail.com> | 2015-08-11 16:51:37 -0400 |
commit | 40e5a5811c6ffce9b0974e93cdd927cbcf60c157 (patch) | |
tree | 4464880c571602d54f6ae114729bf62a89518057 /noao/astutil/asttools/astvrotate.x | |
download | iraf-osx-40e5a5811c6ffce9b0974e93cdd927cbcf60c157.tar.gz |
Repatch (from linux) of OSX IRAF
Diffstat (limited to 'noao/astutil/asttools/astvrotate.x')
-rw-r--r-- | noao/astutil/asttools/astvrotate.x | 43 |
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 |