astroforge.coordinates.PosVelConversion#
- astroforge.coordinates.PosVelConversion(conversion, mjd, X0, V0)[source]#
Utility for converting a cartesian position and velocity vectors from one coordinate system to another. The first argument should be the conversion method.
- Parameters:
conversion (Callable) – Method to call on the position and velocity vectors to do the conversion
mjd (float) – Reference time for the conversion, specified as a Modified Julian Date (MJD) in the UT1 time system.
X0 (NDArray[np.float64]) – Position vector to be rotated
V0 (NDArray[np.float64]) – Velocity vector to be rotated
- Returns:
X, V – Rotated position and velocity vectors
- Return type:
Tuple[NDArray[np.float64], NDArray[np.float64]]
Examples
Rotate an ITRS site location (fixed relative to a rotating Earth) to pos/vel vectors in the True Equator True Equinox of Date (TETED) coordinate system:
>>> # pick a site location >>> lat, lon, alt = 42.459629, -71.267319, 0.0 >>> >>> # convert lat/lon/alt to an ITRS position vector >>> x_itrs = LatLonAltToITRS(lat, lon, alt) >>> v_itrs = np.array([0.0, 0.0, 0.0]) # site isn't moving in earth-fixed coordinates >>> >>> # time, used as a reference epoch for the TETED coordinate system >>> mjd = 51720.0 >>> >>> # do the conversion >>> x_teted, v_teted = PosVelConversion(ITRSToTETED, mjd, x_itrs, v_itrs) >>> with np.printoptions(suppress=True): >>> print(f"{x_teted = }") >>> print(f"{v_teted = }") x_teted = array([-4364.24798307, -1778.39228689, 4283.414358 ]) v_teted = array([ 0.12968241, -0.31824598, -0. ])