geodesy.radar_target_calculation

This module provides functions to convert between Geodetic coordinates and Earth-Centered, Earth-Fixed (ECEF) Cartesian coordinates, as well as calculating target coordinates based on radar measurements.

Reference: - https://en.wikipedia.org/wiki/Geographic_coordinate_conversion - https://en.wikipedia.org/wiki/Local_tangent_plane_coordinates

Attributes

WGS84_A

WGS84_B

WGS84_EP_SQ

WGS84_E_SQ

Functions

calculate_target_coordinates(→ tuple[float, float, float])

Main function to calculate target (ship) coordinates from radar measurements.

ecef_to_geodetic(→ tuple[float, float, float])

Converts Earth-Centered, Earth-Fixed (ECEF) coordinates to

enu_to_ecef(→ tuple[float, float, float])

Rotates East-North-Up (ENU) offset coordinates to ECEF offset coordinates,

geodetic_to_ecef(→ tuple[float, float, float])

Converts Geodetic coordinates (Latitude, Longitude, Altitude) to

Module Contents

geodesy.radar_target_calculation.calculate_target_coordinates(radar_lat: float, radar_lon: float, radar_alt: float, azimuth_deg: float, range_m: float, elevation_deg: float = 0.0) tuple[float, float, float]

Main function to calculate target (ship) coordinates from radar measurements.

Parameters: radar_lat (float): Radar latitude in degrees radar_lon (float): Radar longitude in degrees radar_alt (float): Radar altitude above sea level in meters azimuth_deg (float): True bearing to the target (0 is North, 90 is East) range_m (float): Direct line-of-sight distance to the target in meters elevation_deg (float): Antenna elevation angle in degrees

(default 0 for surface ships)

Returns: tuple: (Target Latitude, Target Longitude, Target Altitude)

>>> lat, lon, alt = calculate_target_coordinates(0.0, 0.0, 0.0, 90.0, 111319.5)
>>> round(lat, 1), round(lon, 1), round(alt, 1)
(0.0, 1.0, 971.4)
geodesy.radar_target_calculation.ecef_to_geodetic(x_ecef: float, y_ecef: float, z_ecef: float) tuple[float, float, float]

Converts Earth-Centered, Earth-Fixed (ECEF) coordinates to Geodetic coordinates (Latitude, Longitude, Altitude) using Bowring’s method.

>>> lat, lon, alt = ecef_to_geodetic(6378137.0, 0.0, 0.0)
>>> round(lat, 2), round(lon, 2), round(alt, 2)
(0.0, 0.0, 0.0)
>>> lat, lon, alt = ecef_to_geodetic(0.0, 0.0, 6356752.314245)
>>> round(lat, 2), round(lon, 2), round(alt, 2)
(90.0, 0.0, 0.0)
geodesy.radar_target_calculation.enu_to_ecef(east: float, north: float, up: float, ref_lat_deg: float, ref_lon_deg: float) tuple[float, float, float]

Rotates East-North-Up (ENU) offset coordinates to ECEF offset coordinates, based on the reference (Radar) latitude and longitude.

>>> dx, dy, dz = enu_to_ecef(100.0, 200.0, 50.0, 0.0, 0.0)
>>> round(dx, 2), round(dy, 2), round(dz, 2)
(50.0, 100.0, 200.0)
geodesy.radar_target_calculation.geodetic_to_ecef(lat_deg: float, lon_deg: float, alt_m: float) tuple[float, float, float]

Converts Geodetic coordinates (Latitude, Longitude, Altitude) to Earth-Centered, Earth-Fixed (ECEF) Cartesian coordinates.

>>> x, y, z = geodetic_to_ecef(0.0, 0.0, 0.0)
>>> round(x, 2), round(y, 2), round(z, 2)
(6378137.0, 0.0, 0.0)
>>> x, y, z = geodetic_to_ecef(90.0, 0.0, 0.0)
>>> round(x, 2), round(y, 2), round(z, 2)
(0.0, 0.0, 6356752.31)
geodesy.radar_target_calculation.WGS84_A = 6378137.0
geodesy.radar_target_calculation.WGS84_B = 6356752.314245
geodesy.radar_target_calculation.WGS84_EP_SQ
geodesy.radar_target_calculation.WGS84_E_SQ