proper_motion_ra_dec
- ssapy.utils.proper_motion_ra_dec(r=None, v=None, x=None, y=None, z=None, vx=None, vy=None, vz=None, r_earth=array([0, 0, 0]), v_earth=array([0, 0, 0]), input_unit='si')[source][source]
Calculate the proper motion in right ascension (RA) and declination (DEC) for celestial objects.
This function computes the proper motion in RA and DEC based on the position and velocity of the object relative to Earth. Proper motion is expressed in arcseconds per second.
Parameters:
r (numpy array, optional): Position vector of the object [x, y, z] (in meters or AU, depending on input_unit). v (numpy array, optional): Velocity vector of the object [vx, vy, vz] (in meters/second or AU/s, depending on input_unit). x, y, z (float, optional): Individual position coordinates of the object (used if r is not provided). vx, vy, vz (float, optional): Individual velocity components of the object (used if v is not provided). r_earth (numpy array, optional): Position vector of Earth [x, y, z] (default is [0, 0, 0]). v_earth (numpy array, optional): Velocity vector of Earth [vx, vy, vz] (default is [0, 0, 0]). input_unit (str, optional): Unit system for input data (‘si’ for SI units, ‘rebound’ for REBOUND simulation units).
Default is ‘si’.
Returns:
- tuple: Proper motion in RA and DEC:
pmra (numpy array): Proper motion in RA (arcseconds per second).
pmdec (numpy array): Proper motion in DEC (arcseconds per second).
Notes:
If r and v are not provided, the function expects individual coordinates (x, y, z) and velocities (vx, vy, vz).
Earth’s position and velocity are subtracted from the input position and velocity vectors to calculate relative motion.
The einsum_norm function calculates the magnitude of the position vector.
Proper motion is scaled by a factor of 206265 to convert radians to arcseconds.
For REBOUND simulation units, proper motion is adjusted to account for time scaling.