spherical_project¶
- sofia_redux.scan.coordinate_systems.projection.projection_numba_functions.spherical_project(x, y, cos_lat, sin_lat, celestial_pole_x, celestial_pole_y, celestial_cos_lat, celestial_sin_lat, native_pole_x)[source]¶
Convert a single coordinate form a native pole to a celestial pole.
The following conversions are used depending on the value of the celestial pole native latitude (lat_cp) to convert the coordinates (x, y) to coordinates about the celestial pole (x_cp, y_cp). Here _cp denotes “celestial pole”, _np denotes “native pole”, and any numbers are in degrees.
lat_cp = 90:
x_cp = 180 + lon_np + x - lon_cp y_cp = y
lat_cp = -90:
x_cp = lon_np + lon_cp - x y_cp = -y
Otherwise:
d = x - lon_cp A = -cos(y)sin(d) B = sin(y)cos(lat_cp) - cos(y)sin(lat_cp)cos(d) x_cp = lon_np + arctan2(A, B) y_cp = arcsin(sin(y)sin(lat_cp) + cos(y)cos(lat_cp)cos(d))
The reverse operation (celestial to native poles) can be performed using
spherical_deproject()
.- Parameters:
- xfloat
The coordinate native longitude in radians.
- yfloat
The coordinate native latitude in radians.
- cos_latfloat
The cosine of
y
.- sin_latfloat
The sine of
y
.- celestial_pole_xfloat
The celestial pole native longitude in radians.
- celestial_pole_yfloat
The celestial pole native latitude in radians.
- 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:
- theta, phifloat, float
The projection of (x, y) about the native pole on the celestial pole, with
theta
equivalent to y_cp andphi
equivalent to x_cp where _cp denotes a projection about the celestial pole.