spherical_deproject¶
- sofia_redux.scan.coordinate_systems.projection.projection_numba_functions.spherical_deproject(phi, theta, celestial_pole_x, celestial_pole_y, celestial_cos_lat, celestial_sin_lat, native_pole_x)[source]¶
Deproject single coordinates about a celestial pole to a native pole.
The following conversions are used depending on the value of the celestial pole native latitude (lat_cp) to convert the coordinates (x_cp, y_cp) about a celestial pole to coordinates about a native pole (x, y). Here _cp denotes “celestial pole”, _np denotes “native pole”, and any numbers are in degrees.
lat_cp = 90:
x = lon_cp + x_cp - lon_np - 180 y = y_cp
lat_cp = -90:
x = lon_cp + lon_np - x_cp y = -y_cp
Otherwise:
d_cp = x_cp - lon_np C = -cos(y_cp)sin(d_cp) D = sin(y_cp)cos(lat_cp) - cos(y_cp)sin(lat_cp)cos(d_cp) x = lon_cp + arctan2(C, D) y = arcsin(sin(y_cp)sin(lat_cp) + cos(y_cp)cos(lat_cp)cos(d_cp))
The reverse operation (native to celestial poles) can be performed using
spherical_project()
.- Parameters:
- phifloat
The coordinate longitude in radians about the celestial pole (x_cp).
- thetafloat
The coordinate latitude in radians about the celestial pole (y_cp).
- celestial_pole_xfloat
The celestial pole native longitude in radians (lon_cp).
- celestial_pole_yfloat
The celestial pole native latitude in radians (lat_cp).
- celestial_cos_latfloat
The cosine of
celestial_pole_y
.- celestial_sin_latfloat
The sine of
celestial_pole_y
.- native_pole_xfloat
The coordinate’s native pole longitude in radians.
- Returns:
- x, yfloat, float
The native longitude (x) and latitude (y) coordinates about the native pole in radians.