SatelliteCameraViewer.SatelliteCamera package
Camera
- class SatelliteCameraViewer.SatelliteCamera.SatelliteCamera[source]
Bases:
object- Attributes:
attitudeattitude
bccbcc
cam_attitudecam_attitude
cameracamera
cxcx
cycy
focal_length_mmfocal_length_mm
nxnx
nyny
obs_timeobs_time
sat_attitudesat_attitude
sat_orbitsat_orbit
sat_quat_body_to_ecisat_quat_body_to_eci
sensor_size_x_mmsensor_size_x_mm
sensor_size_y_mmsensor_size_y_mm
tletle
Methods
BrownConradyCoeffs.py
CameraAttitude
CameraFOV.py
CameraIntrinsics.py
Earth.py
SatelliteOrbit
datetime(year, month, day[, hour[, minute[, ...)The year, month and day arguments are required.
SatelliteCamera
- Attributes:
attitudeattitude
bccbcc
cam_attitudecam_attitude
cameracamera
cxcx
cycy
focal_length_mmfocal_length_mm
nxnx
nyny
obs_timeobs_time
sat_attitudesat_attitude
sat_orbitsat_orbit
sat_quat_body_to_ecisat_quat_body_to_eci
sensor_size_x_mmsensor_size_x_mm
sensor_size_y_mmsensor_size_y_mm
tletle
Methods
BrownConradyCoeffs.py
CameraAttitude
CameraFOV.py
CameraIntrinsics.py
Earth.py
SatelliteOrbit
datetime(year, month, day[, hour[, minute[, ...)The year, month and day arguments are required.
- class BrownConradyCoeffs(k1: float = 0.0, k2: float = 0.0, p1: float = 0.0, p2: float = 0.0, k3: float = 0.0, k4: float = 0.0, k5: float = 0.0, k6: float = 0.0, cx: float = 0.0, cy: float = 0.0)
Bases:
objectStores Brown-Conrady lens distortion coefficients. Ref: https://docs.nvidia.com/vpi/2.0/algo_ldc.html
Methods
- cx: float = 0.0
- cy: float = 0.0
- k1: float = 0.0
- k2: float = 0.0
- k3: float = 0.0
- k4: float = 0.0
- k5: float = 0.0
- k6: float = 0.0
- p1: float = 0.0
- p2: float = 0.0
- to_array()
Returns coefficients as an OpenCV-compatible array [k1, k2, p1, p2, k3].
- class CameraAttitude(sat_quat_body_to_eci: Quaternion = None, sat_attitude: Attitude = None, cam_attitude: Attitude = None)
Bases:
objectFull attitude model: - Satellite orientation in ECI (as quaternion or yaw/pitch/roll) - Camera mounting offsets (yaw/pitch/roll) - Produces final camera->ECI quaternion
- Attributes:
- cam_attitude
quat_cam_to_eciquat_cam_to_eci
- sat_attitude
- sat_quat_body_to_eci
Methods
- cam_to_eci()
- property quat_cam_to_eci
- classmethod quaternion_nadir_pointing(r_eci_km)
Compute camera->ECI quaternion for nadir pointing. r_eci_km: satellite position in ECI (km), shape (3,)
Returns: quaternion [w, x, y, z]
- classmethod quaternion_pointing_ground(lat_deg, lon_deg, obs_time, r_sat_gcrs_km)
Compute camera->ECI quaternion that points +Z_cam at a ground location. lat_deg, lon_deg: ground target in degrees r_sat_gcrs_km: satellite position in GCRS (km)
- classmethod quaternion_pointing_radec(ra_deg, dec_deg, obs_time)
Compute camera->ECI quaternion that points +Z_cam at a given RA/Dec target.
- classmethod quaternion_velocity_pointing(r_eci_km, v_eci_km_s)
Compute camera->ECI quaternion for velocity-vector pointing. r_eci_km: satellite position in ECI (km) v_eci_km_s: satellite velocity in ECI (km/s)
Returns: quaternion [w, x, y, z]
- classmethod quaternion_wxyz(qw: float = 1.0, qx: float = 0.0, qy: float = 0.0, qz: float = 0.0) Quaternion
quaternion
- sat_quat_body_to_eci: Quaternion = None
- classmethod teme_to_gcrs_vector(r_teme_km, obs_time)
Convert a TEME position vector to GCRS (ECI) using Astropy. r_teme_km: (3,) km vector Returns: (3,) km vector in GCRS
- class CameraFOV
Bases:
objectMethods
- classmethod camera_fov_angular_width_height(camera: CameraIntrinsics, attitude: CameraAttitude, obs_time: datetime)
Compute: - Angular width and height of the camera FOV - Approximate solid angle (steradians) using a spherical polygon area
- classmethod camera_fov_border_vectors(camera: CameraIntrinsics, attitude: CameraAttitude, obs_time: datetime, border_step=50)
Sample the full border of the camera sensor and return a list of 3D GCRS unit vectors representing the FOV boundary.
border_step = number of samples per edge (higher for ultra-wide lenses)
- classmethod camera_fov_convex_hull(camera: CameraIntrinsics, attitude: CameraAttitude, obs_time: datetime, border_step: int = 100)
Sample the border of the sensor and compute a convex hull on the sphere. Returns: - hull_coords: SkyCoord of hull vertices (in order) - hull: ConvexHull object in 3D unit-vector space
- classmethod camera_fov_healpix_mask(camera: CameraIntrinsics, attitude: CameraAttitude, obs_time: datetime, nside=64)
Return HEALPix pixel indices inside the camera FOV. Uses 3D spherical polygon for robustness.
- classmethod camera_fov_radec_box(camera: CameraIntrinsics, attitude: CameraAttitude, obs_time: datetime)
Compute RA/Dec for the four corners of the camera sensor. Returns a dict with RA/Dec for each corner and a SkyCoord polygon.
- classmethod camera_fov_solid_angle(camera: CameraIntrinsics, attitude: CameraAttitude, obs_time: datetime)
Compute the solid angle of the camera FOV in steradians using a robust 3D spherical polygon method.
- class CameraIntrinsics
Bases:
object- Attributes:
aspect_ratioaspect_ratio - return sensor aspect ratio
- bcc
- cx
- cy
fov_diag_degfov_diag_deg - return diagonal axis FOV in degrees
fov_x_degfov_x_deg - return x axis FOV in degrees
fov_y_degfov_y_deg - return y axis FOV in degrees
pixel_size_x_mmpixel_size_x_mm - x size of sensor in mm
pixel_size_y_mmpixel_size_y_mm - y size of sensor in mm
- sensor_to_lens_mm
Methods
- property aspect_ratio
aspect_ratio - return sensor aspect ratio
- bcc: BrownConradyCoeffs = None
- cx: float = None
- cy: float = None
- focal_length_mm: float
- property fov_diag_deg
fov_diag_deg - return diagonal axis FOV in degrees
- property fov_x_deg
fov_x_deg - return x axis FOV in degrees
- property fov_y_deg
fov_y_deg - return y axis FOV in degrees
- nx: int
- ny: int
- property pixel_size_x_mm
pixel_size_x_mm - x size of sensor in mm
- property pixel_size_y_mm
pixel_size_y_mm - y size of sensor in mm
- pixel_to_radec(px: float, py: float, attitude: CameraAttitude, obs_time: datetime)
Convert a pixel coordinate to RA/Dec using: - Correct camera geometry - Correct camera -> ECI rotation - Correct TEME -> GCRS conversion
- pixel_to_radec_and_vector(px: float, py: float, attitude: CameraAttitude, obs_time: datetime, sat_orbit: SatelliteOrbit = None)
Convert a pixel coordinate to RA/Dec and return satellite vector
- radec_to_pixel(ra_deg: float, dec_deg: float, attitude: CameraAttitude, obs_time: datetime)
Convert an RA/Dec (ICRS) direction into pixel coordinates (px, py) using the camera’s orientation quaternion (w, x, y, z).
Raises CameraIntrinsicsError if the direction is outside the camera FOV.
- sensor_size_x_mm: float
- sensor_size_y_mm: float
- sensor_to_lens_mm: float = None
- sensor_to_radec()
- class Earth
Bases:
objectMethods
Earth
- Parameters:
sat_orbit – Satellite Orbit
Methods
- camera_fov_intercept_earth()
- Parameters:
camera – The camera.
attitude – The camera attitude.
obs_time – The time (in UTC).
border_step – Accuracy of edge lines (8 should be ok).
- earth_angular_radius()
- earth_center_radec(attitude: CameraAttitude, obs_time: datetime)
earth_center_radec - caculate ra/dec for of earth center in the camera frame from the satellite
- Parameters:
attitude – The camera attitude.
obs_time – Time (in UTC)
- Returns:
ra/dec for of earth center in the camera frame from the satellite
- Return type:
tuple(float, float)
- earth_center_radec_simple(obs_time: datetime)
earth_center_radec_simple - caculate ra/dec for of earth center from the satellite
- earth_center_vector(obs_time: datetime)
earth_center_vector - returns: unit vector pointing from satellite → earth center
- Parameters:
obs_time – Time (in UTC)
- Returns:
Vector as [x, y, z].
- Return type:
list[float]
- earth_center_vector_icrs()
- class Quaternion(qw: float = 1.0, qx: float = 0.0, qy: float = 0.0, qz: float = 0.0)
Bases:
objectA satellite quaternion body (or attitude quaternion) is a 4-component mathematical tool q = [q0,q1,q2,q3] or q = [s,v] used to represent the 3D orientation (attitude) of a satellite’s body-fixed frame relative to a reference frame. https://en.wikipedia.org/wiki/Quaternions_and_spatial_rotation
- qw: float = 1.0
- qx: float = 0.0
- qy: float = 0.0
- qz: float = 0.0
- property w
- property wxyz
- property x
- property y
- property z
- class SatelliteOrbit
Bases:
object- Attributes:
tletle - return array of TLE strings (2 or 3 lines long)
Methods
SatelliteOrbit - accept a TLE/3LE or 2LE 2LE or two-line element sets (no satellite name on Line 0). TLE/3LE or three-line element sets including 24-character satellite name on Line 0.
- Parameters:
tle (list[str]) – TLEs as an array (2 or 3 lines long).
- Attributes:
tletle - return array of TLE strings (2 or 3 lines long)
Methods
- eci_position_vector(obs_time: datetime)
Returns ECI (Earth-Centered Inertial) position (km) at UTC time obs_time.
- eci_velocity_vector(obs_time: datetime)
Returns ECI (Earth-Centered Inertial) velocity (km/s) at UTC time obs_time.
- icrs(obs_time: datetime)
icrs - convert satellite and time into a ICRS value
- sat_in_eclipse(obs_time: datetime)
in_eclipse - Returns True if saetellite is in Earth’s umbra (full shadow).
- Parameters:
obs_time (datetime) – Observation time (in UTC).
- sat_lon_lat_alt(obs_time)
sat_lon_lat_alt - Return satellite geodetic lat, lon, alt.
- Parameters:
obs_time (astropy Time) – Observation time.
- Returns:
lat_deg (float)
lon_deg (float)
alt_km (float)
- property tle
tle - return array of TLE strings (2 or 3 lines long)
- Returns:
TLEs
- Return type:
list[str]
- property attitude
- property bcc
- property cam_attitude
- property camera
- property cx
- property cy
- property focal_length_mm
- property nx
- property ny
- property obs_time
- property sat_attitude
- property sat_orbit
- property sat_quat_body_to_eci
- property sensor_size_x_mm
- property sensor_size_y_mm
- property tle
Submodules
- SatelliteCameraViewer.SatelliteCamera.BrownConradyCoeffs module
- SatelliteCameraViewer.SatelliteCamera.CameraAttitude module
- SatelliteCameraViewer.SatelliteCamera.CameraFOV module
- SatelliteCameraViewer.SatelliteCamera.CameraIntrinsics module
- SatelliteCameraViewer.SatelliteCamera.Earth module
- SatelliteCameraViewer.SatelliteCamera.SatelliteCamera module
- SatelliteCameraViewer.SatelliteCamera.SatelliteOrbit module
- SatelliteCameraViewer.SatelliteCamera.fits_stars module