es_sfgtools.modeling.garpos_tools.functions module

class es_sfgtools.modeling.garpos_tools.functions.CoordTransformer(latitude: float, longitude: float, elevation: float)

Bases: object

A class to transform coordinates between different systems.

lat0

float Latitude of the reference point.

lon0

float Longitude of the reference point.

hgt0

float Height of the reference point.

X0

float X coordinate of the reference point in ECEF.

Y0

float Y coordinate of the reference point in ECEF.

Z0

float Z coordinate of the reference point in ECEF.

XYZ2ENU(X, Y, Z, **kwargs)

Converts ECEF coordinates to ENU coordinates.

LLH2ENU(lat, lon, hgt, **kwargs)

Converts geodetic coordinates (latitude, longitude, height) to ENU coordinates.

LLH2ENU_vec(lat

np.ndarray, lon: np.ndarray, hgt: np.ndarray) -> Tuple[np.ndarray, np.ndarray, np.ndarray]: Converts arrays of geodetic coordinates to ENU coordinates.

ECEF2ENU_vec(X

np.ndarray, Y: np.ndarray, Z: np.ndarray) -> Tuple[np.ndarray, np.ndarray, np.ndarray]: Converts arrays of ECEF coordinates to ENU coordinates.

ECEF2ENU_vec(X: ndarray, Y: ndarray, Z: ndarray) Tuple[ndarray, ndarray, ndarray]

Convert ECEF coordinates to ENU coordinates.

Parameters:
  • X – np.ndarray Array of X coordinates in meters.

  • Y – np.ndarray Array of Y coordinates in meters.

  • Z – np.ndarray Array of Z coordinates in meters.

Returns:

Tuple[np.ndarray, np.ndarray, np.ndarray]

Tuple containing arrays of East, North, and Up coordinates in meters.

LLH2ENU(lat: float, lon: float, hgt: float) Tuple[float, float, float]

Convert latitude, longitude, and height (LLH) to East, North, Up (ENU) coordinates. This function converts geodetic coordinates (latitude, longitude, height) to local tangent plane coordinates (East, North, Up) relative to a reference point.

Parameters:
  • lat (float) – Latitude in degrees.

  • lon (float) – Longitude in degrees.

  • hgt (float) – Height in meters.

Returns:

A tuple containing the East, North, and Up coordinates in meters.

Return type:

Tuple[float, float, float]

LLH2ENU_vec(lat: ndarray, lon: ndarray, hgt: ndarray) Tuple[ndarray, ndarray, ndarray]

Convert latitude, longitude, and height (LLH) coordinates to East-North-Up (ENU) coordinates.

Parameters:
  • lat – np.ndarray Array of latitudes in degrees.

  • lon – np.ndarray Array of longitudes in degrees.

  • hgt – np.ndarray Array of heights in meters.

Returns:

Tuple[np.ndarray, np.ndarray, np.ndarray]

Tuple containing arrays of East, North, and Up coordinates in meters.

XYZ2ENU(X: float, Y: float, Z: float) Tuple[float, float, float]

Convert Cartesian coordinates (X, Y, Z) to East-North-Up (ENU) coordinates.

Parameters:
  • X (float) – X coordinate in the Cartesian system.

  • Y (float) – Y coordinate in the Cartesian system.

  • Z (float) – Z coordinate in the Cartesian system.

Returns:

A tuple containing the East (e), North (n), and Up (u) coordinates.

Return type:

tuple

es_sfgtools.modeling.garpos_tools.functions.avg_transponder_position(transponders: List[GPTransponder]) Tuple[GPPositionENU, GPPositionLLH]

Calculate the average position of the transponders.

Parameters:

transponders (List[Transponder]) – A list of transponders.

Returns:

A tuple containing the average position in ENU and LLH coordinates.

Return type:

Tuple[PositionENU, PositionLLH]

es_sfgtools.modeling.garpos_tools.functions.plot_enu_llh_side_by_side(garpos_input: GarposInput)

Plot the transponder and antenna positions in ENU and LLH coordinates side by side.

Parameters:

garpos_input (GarposInput) – The input data containing observations and site information.

es_sfgtools.modeling.garpos_tools.functions.process_garpos_results(results: GarposInput) Tuple[GarposInput, DataFrame]

Process garpos results to compute delta x, y, z and relevant fields. This function processes the garpos results to calculate the delta x, y, z for each transponder and other relevant fields. It also converts the residual travel time (ResiTT) to meters using the harmonic mean of the sound speed data.

Parameters:

results (GarposInput) – The input data containing observations and site information.

Returns:

A tuple containing the processed garpos results and a DataFrame with the shot data including the calculated residual ranges.

Return type:

Tuple[GarposResults, pd.DataFrame]

es_sfgtools.modeling.garpos_tools.functions.rectify_shotdata(coord_transformer: CoordTransformer, shot_data: DataFrame) DataFrame

Rectifies the shot data to the site local coordinate system by transforming coordinates and renaming columns. This method performs the following operations on the input shot data: 1. Transforms the ECEF coordinates to ENU coordinates for two sets of points. 2. Adds the transformed coordinates to the DataFrame. 3. Sets default values for the “SET” and “LN” columns. 4. Renames specific columns according to a predefined mapping. 5. Selects and reorders the columns in the DataFrame. 6. Validates and sorts the DataFrame by “triggerTime”.

Parameters:

shot_data (pd.DataFrame) – The input DataFrame containing shot data with columns “east0”, “north0”, “up0”, “east1”, “north1”, “up1”, “trigger_time”, “hae0”, “pingTime”, “returnTime”, “tt”, “transponderID”, “head0”, “pitch0”, “roll0”, “head1”, “pitch1”, and “roll1”.

Returns:

The rectified and validated DataFrame sorted by “triggerTime”.

Return type:

pd.DataFrame

es_sfgtools.modeling.garpos_tools.functions.xyz2enu(x, y, z, lat0, lon0, hgt0, inv=1, **kwargs)

Rotates the vector of positions XYZ and covariance to the local east-north-up system at latitude and longitude (or XYZ coordinates) specified in origin. if inv = -1. then enu -> xyz

Parameters:
  • x (float)

  • y (float)

  • z (float) – Position in ECEF (if inv=-1, in ENU)

  • lat0 (float)

  • lon0 (float)

  • Hgt0 (float) – Origin for the local system in degrees.

  • inv (1 or -1) – Switch (1: XYZ -> ENU, -1: ENU -> XYZ)

Returns:

  • e (float)

  • n (float)

  • u (float) – Position in ENU (if inv=-1, in ECEF)