include include "delaytime.h" # OBJECT_POS -- Calculate the unit state vector of the target, including proper # motion # # Description: # ------------ # Apply proper motion to the right ascension and declination of an object. # The output coordinates are converted from spherical coordinates to # a unit vector in rectangular coordinates because the routine TIMEDELAY # which is to use the position needs a unit vector in rectangular coordinates. # # Date Author Description # ---- ------ ----------- # 12-Nov-1984 C. D. Biemesderfer Original module # 30-Mar-1990 J.-C. Hsu rewrite in SPP #------------------------------------------------------------------------------ procedure object_pos (epoch, ra_j2000, dec_j2000, mu_ra, mu_dec, objposn) double epoch # input: (mean) epoch of observation (in MJD) double ra_j2000 # input: right ascension of target on J2000 (degs) double dec_j2000 # input: declination of target on J2000 (degs) double mu_ra # input: proper motion in RA on J2000(deg/yr) double mu_dec # input: proper motion in Dec on J2000(deg/yr) double objposn[3] # output: Obj coords corrected for prop mtn double cosdec # Cosine of declination double mucoeff double truedec # Corrected (of-date) declination double truera # Corrected (of-date) right ascension #============================================================================== begin # Apply proper motion correction to object J2000 coordinates mucoeff = (epoch - MJDJ2000) / DAYPERYR truera = ra_j2000 + mucoeff * mu_ra # in degrees truedec = dec_j2000 + mucoeff * mu_dec # in degrees # Convert true coordinates to unit Cartesian cosdec = cos(truedec/RADIAN) objposn[1] = cosdec * cos(truera/RADIAN) objposn[2] = cosdec * sin(truera/RADIAN) objposn[3] = sin(truedec/RADIAN) end