astroforge.coordinates.PosVelToFPState#

astroforge.coordinates.PosVelToFPState(x, v, x_site, v_site)[source]#

Compute observables for a target with a given position and velocity as seen by a sensor with a particular position and velocity.

Note

This method was originally intended to compute angles-only observations from the sensor location, thus the acryonym “FP” in the method name, which stands for Focal Plane. It has since been adapted to also compute the range and range-rate, which are observables typical for radar sensors.

Parameters:
  • x (NDArray[np.float64]) – Position vector of the target(s). Should have shape (3, ) or (N, 3).

  • v (NDArray[np.float64]) – Velocity vector of the target(s). Should have shape (3, ) or (N, 3).

  • x_site (NDArray[np.float64]) – Position vector of the sensor. Should have shape (3, ) or (N, 3).

  • v_site (NDArray[np.float64]) – Velocity vector of the sensor. Should have shape (3, ) or (N, 3).

Returns:

  • fpstate (NDArray[np.float64]) – 2D array of shape (N, 4) with the columns corresponding to right ascension (\(\alpha\)), declination (\(\delta\)), and their rates of change (\(\dot{\alpha}, \dot{\delta}\)).

  • r (NDArray[np.float64]) – 1D array of shape (N, ) of range values (\(r\))

  • r_rate (NDArray[np.float64]) – 1D array of shape (N, ) of range-rate values (\(\dot{r}\))

Examples

Compute observations from a ground-based sensor:

>>> # make up a site location
>>> lat, lon, alt = 42.459629, -71.267319, 0.0
>>>
>>> # time of the observation
>>> mjd = 51720.0
>>>
>>> # rotate site location into inertial coordinates
>>> x_site_itrs = af.coordinates.LatLonAltToITRS(lat, lon, alt)
>>> v_site_itrs = np.zeros(3)
>>> x_site, v_site = PosVelConversion(ITRSToTETED, mjd, x_site_itrs, v_site_itrs)
>>>
>>> # make up some satellite ephemeris data
>>> alt = 400.0
>>> r = af.R_earth + alt  # note: R_earth is *equatorial* radius
>>> v = np.sqrt(af.GM / r)
>>> xdir = x_site / np.sqrt(x_site @ x_site)   # unit vector pointing from Earth center to site
>>> vdir = np.cross(xdir, np.array([1.0, 0.0, 0.0]))
>>> vdir /= np.sqrt(vdir @ vdir)
>>>
>>> x = r * xdir
>>> v = v * vdir
>>>
>>> # compute observation
>>> angles, rho, rhodot = af.coordinates.PosVelToFPState(x, v, x_site, v_site)
>>> with np.printoptions(suppress=True):
>>>     print(f"{angles = }")
>>>     print(f"{rho  = }")
>>>     print(f"{rhodot = }")
angles = array([[-2.75464514,  0.73771759, -0.02276666,  0.00969875]])
rho  = array([409.70091677])
rhodot = array([0.])

Note

The range is not exactly 400 km because the Earth is not a perfect sphere. The radius of the Earth at the latitude used in this examples is less than the equatorial radius, and therefore the satellite is further away.