sim_lonlatrad

ssapy.utils.sim_lonlatrad(x, y, z, xe, ye, ze, xs, ys, zs)[source][source]

Simulate longitude, latitude, and radius in a geocentric frame with the Sun at (0, 0).

This function calculates the longitude, latitude, and radius of a point (x, y, z) relative to the Earth and the Sun. The input coordinates are first shifted to a geocentric frame (Earth at the origin), then converted to spherical coordinates (longitude, latitude, radius). The output is corrected so that the Sun is positioned at (0, 0) in the frame.

Parameters:

x (float): The x-coordinate of the point in the inertial frame. y (float): The y-coordinate of the point in the inertial frame. z (float): The z-coordinate of the point in the inertial frame. xe (float): The x-coordinate of the Earth in the inertial frame. ye (float): The y-coordinate of the Earth in the inertial frame. ze (float): The z-coordinate of the Earth in the inertial frame. xs (float): The x-coordinate of the Sun in the inertial frame. ys (float): The y-coordinate of the Sun in the inertial frame. zs (float): The z-coordinate of the Sun in the inertial frame.

Returns:

tuple:
  • longitude (float): The corrected longitude of the point in degrees.

  • latitude (float): The corrected latitude of the point in degrees.

  • radius (float): The radial distance of the point from the Earth.

Notes:

  • The function assumes the existence of cart2sph_deg, which converts Cartesian coordinates to spherical coordinates in degrees.

  • The function assumes the existence of deg0to360, which ensures longitude values are within the range [0, 360] degrees.

Example:

sim_lonlatrad(1, 2, 3, -1, 0, 0, 0, 0, 0) -> (180.0, 45.0, 3.7416573867739413)