NavigationInterpolators#
- class NavigationInterpolatorLatLon(*args, **kwargs)#
The NavInterpolator class: Interpolate navigation (lat/lon) values and attitude information and transform the values using the offsets specified in the sensor configuration class
- __init__(self, sensor_configuration: SensorConfiguration, extrapolation_mode: themachinethatgoesping.tools_nanopy.vectorinterpolators.o_extr_mode = t_extr_mode.extrapolate) → None#
Construct a new i navigationinterpolator interface
- Parameters:
sensor_configuration – sensor configuration used for this navigation interpolator
extrapolation_mode – extrapolate, fail or nearest
- add_target(self, target_id: str, x: float, y: float, z: float, yaw: float, pitch: float, roll: float) → None#
- add_target(self, target_id: str, target_offsets: PositionalOffsets) → None
Overloaded function.
add_target(self, target_id: str, x: float, y: float, z: float, yaw: float, pitch: float, roll: float) -> None
add a target sensor with positional offsets
- Parameters:
target_id – name of the target sensor
x – x position of the sensor in m, positive forward
y – y position of the sensor in m, positive starboard
z – z position of the sensor in m, positive down
yaw – yaw angle of the sensor in °, positive clockwise
pitch – pitch angle of the sensor in °, positive is bow up
roll – roll angle of the sensor in °, positive is port up
add_target(self, target_id: str, target_offsets: themachinethatgoesping.navigation_nanopy.datastructures.PositionalOffsets) -> None
add a target sensor with positional offsets
- Parameters:
target_id – name of the target sensor
sensor_offsets – structure that contains the sensor position
- compute_target_position(self, target_id: str, timestamp: float) → GeolocationLatLon#
- compute_target_position(self, target_id: str, timestamps: Sequence[float], mp_cores: int = 1) → themachinethatgoesping.navigation_nanopy.datastructures.GeolocationLatLonVector
Overloaded function.
compute_target_position(self, target_id: str, timestamp: float) -> themachinethatgoesping.navigation_nanopy.datastructures.GeolocationLatLon
Compute the position of the target “target_id” based on the sensor data for the given timestamp stamp
- Parameters:
target_id – name of the target (e.g. “MBES”)
timestamp – timestamp in seconds since epoch
- Returns:
data structure that contains the position of the target in the world coordinate system
compute_target_position(self, target_id: str, timestamps: collections.abc.Sequence[float], mp_cores: int = 1) -> themachinethatgoesping.navigation_nanopy.datastructures.GeolocationLatLonVector
Compute the position of the target “target_id” for multiple timestamps (vectorized)
- Parameters:
target_id – name of the target (e.g. “MBES”)
timestamps – vector of timestamps in seconds since epoch
mp_cores – Number of OpenMP threads to use for parallelization. Default is 1
- Returns:
GeolocationLatLonVector containing positions for all timestamps
- copy(self) → NavigationInterpolatorLatLon#
return a copy using the c++ default copy constructor
- from_binary = <nanobind.nb_func object>#
- get_sampled_timestamps(self, downsample_interval: float = nan, max_gap: float = nan, sensor_names: Set[str] = {'longitude', 'latitude'}) → numpy.ndarray[dtype=float64, order='C']#
Get sampled timestamps from the specified sensor interpolators
This function retrieves timestamps from the specified sensors and returns their intersection (timestamps that are common to all specified sensors within max_gap).
- Parameters:
downsample_interval – Interval for downsampling timestamps. If NaN, no downsampling
max_gap – Maximum allowed gap between consecutive timestamps
sensor_names – Set of sensor names to include. Valid names are: “latitude”, “longitude”, “attitude”, “heading”, “heave”, “depth”
- Returns:
- xt::xtensor<double, 1> Array of timestamps that are common to all
specified sensors
- get_sensor_configuration(self) → SensorConfiguration#
direct reference to the sensor configuration
- Returns:
SensorConfiguration&
- get_sensor_data(self, timestamp: float) → SensordataLatLon#
- get_sensor_data(self, timestamps: Sequence[float], mp_cores: int = 1) → themachinethatgoesping.navigation_nanopy.datastructures.SensordataLatLonVector
Overloaded function.
get_sensor_data(self, timestamp: float) -> themachinethatgoesping.navigation_nanopy.datastructures.SensordataLatLon
Interpolate the saved sensor data for a specified timestamp stamp
- Parameters:
timestamp – timestamp in seconds since epoch
- Returns:
data structure that contains the sensor data interpolated for the given timestamp stamp
get_sensor_data(self, timestamps: collections.abc.Sequence[float], mp_cores: int = 1) -> themachinethatgoesping.navigation_nanopy.datastructures.SensordataLatLonVector
Interpolate the saved sensor data for multiple timestamps (vectorized)
- Parameters:
timestamps – vector of timestamps in seconds since epoch
mp_cores – Number of OpenMP threads to use for parallelization. Default is 1
- Returns:
SensordataLatLonVector containing sensor data for all timestamps
- info_string(self, float_precision: int = 3, superscript_exponents: bool = True) → str#
Return object information as string
- property interpolator_attitude#
interpolator that stores attitude data (pitch and roll)
- property interpolator_depth#
interpolator that stores depth data (depth, positive downwards) [m]
- property interpolator_heading#
interpolator that stores compass data (yaw/heading) [°]
- property interpolator_heave#
interpolator that stores heave data (relative change in depth, positive upwards) [m]
- property interpolator_latitude#
interpolator for the latitude data
- property interpolator_longitude#
interpolator for the longitude data
- merge(self, other: NavigationInterpolatorLatLon) → None#
Merge data from another interpolator. Only works of the SensorConfiguration is compatible.
- Parameters:
other
- print(self, float_precision: int = 3, superscript_exponents: bool = True) → None#
Print object information
- set_data_attitude(self, timestamp: Sequence[float], pitch: Sequence[float], roll: Sequence[float]) → None#
Set the attitude data (no yaw, this is set in set_data_heading)
- Parameters:
timestamp – in seconds since epoch
pitch – in °, positive is bow up
roll – in °, positive is port up
- set_data_depth(self, timestamp: Sequence[float], depth: Sequence[float]) → None#
Set the depth data
- Parameters:
timestamp – in seconds since epoch
depth – in meters, positive downwards
- set_data_heading(self, timestamp: Sequence[float], heading: Sequence[float]) → None#
Set the compass data
- Parameters:
timestamp – in seconds since epoch
heading – in °, positive clockwise (north is 0°)
- set_data_heave(self, timestamp: Sequence[float], heave: Sequence[float]) → None#
Set the heave data
- Parameters:
timestamp – in seconds since epoch
heave – in meters, positive upwards
- set_data_position(self, timestamp: Sequence[float], latitude: Sequence[float], longitude: Sequence[float]) → None#
Set the data of the position system (latitude, longitude)
- Parameters:
timestamp – in seconds since epoch
latitude – latitude in °
longitude – longitude in °
- set_extrapolation_mode(self, extrapolation_mode: themachinethatgoesping.tools_nanopy.vectorinterpolators.o_extr_mode = t_extr_mode.extrapolate) → None#
Set the extrapolation mode for all interpolators
- Parameters:
extrapolation_mode – extrapolate, fail or nearest
- set_sensor_configuration(self, sensor_configuration: SensorConfiguration) → None#
- class NavigationInterpolatorLocal(*args, **kwargs)#
The NavInterpolator class: Interpolate navigation (northing/easting no zone specified) values and attitude information and transform the values using the offsets specified in the sensor configuration class
- __init__(self, sensor_configuration: SensorConfiguration, extrapolation_mode: themachinethatgoesping.tools_nanopy.vectorinterpolators.o_extr_mode = t_extr_mode.extrapolate) → None#
Construct a new i navigationinterpolator interface
- Parameters:
sensor_configuration – sensor configuration used for this navigation interpolator
extrapolation_mode – extrapolate, fail or nearest
- add_target(self, target_id: str, x: float, y: float, z: float, yaw: float, pitch: float, roll: float) → None#
- add_target(self, target_id: str, target_offsets: PositionalOffsets) → None
Overloaded function.
add_target(self, target_id: str, x: float, y: float, z: float, yaw: float, pitch: float, roll: float) -> None
add a target sensor with positional offsets
- Parameters:
target_id – name of the target sensor
x – x position of the sensor in m, positive forward
y – y position of the sensor in m, positive starboard
z – z position of the sensor in m, positive down
yaw – yaw angle of the sensor in °, positive clockwise
pitch – pitch angle of the sensor in °, positive is bow up
roll – roll angle of the sensor in °, positive is port up
add_target(self, target_id: str, target_offsets: themachinethatgoesping.navigation_nanopy.datastructures.PositionalOffsets) -> None
add a target sensor with positional offsets
- Parameters:
target_id – name of the target sensor
sensor_offsets – structure that contains the sensor position
- compute_target_position(self, target_id: str, timestamp: float) → GeolocationLocal#
- compute_target_position(self, target_id: str, timestamps: Sequence[float], mp_cores: int = 1) → themachinethatgoesping.navigation_nanopy.datastructures.GeolocationLocalVector
Overloaded function.
compute_target_position(self, target_id: str, timestamp: float) -> themachinethatgoesping.navigation_nanopy.datastructures.GeolocationLocal
Compute the position of the target “target_id” based on the sensor data for the given timestamp stamp
- Parameters:
target_id – name of the target (e.g. “MBES”)
timestamp – timestamp in seconds since epoch
- Returns:
data structure that contains the position of the target in the world coordinate system
compute_target_position(self, target_id: str, timestamps: collections.abc.Sequence[float], mp_cores: int = 1) -> themachinethatgoesping.navigation_nanopy.datastructures.GeolocationLocalVector
Compute the position of the target “target_id” for multiple timestamps (vectorized)
- Parameters:
target_id – name of the target (e.g. “MBES”)
timestamps – vector of timestamps in seconds since epoch
mp_cores – Number of OpenMP threads to use for parallelization. Default is 1
- Returns:
GeolocationLocalVector containing positions for all timestamps
- copy(self) → NavigationInterpolatorLocal#
return a copy using the c++ default copy constructor
- from_binary = <nanobind.nb_func object>#
- get_sampled_timestamps(self, downsample_interval: float = nan, max_gap: float = nan, sensor_names: Set[str] = {'easting', 'northing'}) → numpy.ndarray[dtype=float64, order='C']#
Get sampled timestamps from the specified sensor interpolators
This function retrieves timestamps from the specified sensors and returns their intersection (timestamps that are common to all specified sensors within max_gap).
- Parameters:
downsample_interval – Interval for downsampling timestamps. If NaN, no downsampling
max_gap – Maximum allowed gap between consecutive timestamps
sensor_names – Set of sensor names to include. Valid names are: “northing”, “easting”, “attitude”, “heading”, “heave”, “depth”
- Returns:
- xt::xtensor<double, 1> Array of timestamps that are common to all
specified sensors
- Raises:
std::invalid_argument – if an unknown sensor name is specified
- get_sensor_configuration(self) → SensorConfiguration#
direct reference to the sensor configuration
- Returns:
SensorConfiguration&
- get_sensor_data(self, timestamp: float) → SensordataLocal#
- get_sensor_data(self, timestamps: Sequence[float], mp_cores: int = 1) → themachinethatgoesping.navigation_nanopy.datastructures.SensordataLocalVector
Overloaded function.
get_sensor_data(self, timestamp: float) -> themachinethatgoesping.navigation_nanopy.datastructures.SensordataLocal
Interpolate the saved sensor data for a specified timestamp stamp
- Parameters:
timestamp – timestamp in seconds since epoch
- Returns:
data structure that contains the sensor data interpolated for the given timestamp stamp
get_sensor_data(self, timestamps: collections.abc.Sequence[float], mp_cores: int = 1) -> themachinethatgoesping.navigation_nanopy.datastructures.SensordataLocalVector
Interpolate the saved sensor data for multiple timestamps (vectorized)
- Parameters:
timestamps – vector of timestamps in seconds since epoch
mp_cores – Number of OpenMP threads to use for parallelization. Default is 1
- Returns:
SensordataLocalVector containing sensor data for all timestamps
- info_string(self, float_precision: int = 3, superscript_exponents: bool = True) → str#
Return object information as string
- property interpolator_attitude#
interpolator that stores attitude data (pitch and roll)
- property interpolator_depth#
interpolator that stores depth data (depth, positive downwards) [m]
- property interpolator_easting#
interpolator for the easting data
- property interpolator_heading#
interpolator that stores compass data (yaw/heading) [°]
- property interpolator_heave#
interpolator that stores heave data (relative change in depth, positive upwards) [m]
- property interpolator_northing#
interpolator for the northing data
- merge(self, other: NavigationInterpolatorLocal) → None#
Merge data from another interpolator. Only works of the SensorConfiguration is compatible.
- Parameters:
other
- print(self, float_precision: int = 3, superscript_exponents: bool = True) → None#
Print object information
- set_data_attitude(self, timestamp: Sequence[float], pitch: Sequence[float], roll: Sequence[float]) → None#
Set the attitude data (no yaw, this is set in set_data_heading)
- Parameters:
timestamp – in seconds since epoch
pitch – in °, positive is bow up
roll – in °, positive is port up
- set_data_depth(self, timestamp: Sequence[float], depth: Sequence[float]) → None#
Set the depth data
- Parameters:
timestamp – in seconds since epoch
depth – in meters, positive downwards
- set_data_heading(self, timestamp: Sequence[float], heading: Sequence[float]) → None#
Set the compass data
- Parameters:
timestamp – in seconds since epoch
heading – in °, positive clockwise (north is 0°)
- set_data_heave(self, timestamp: Sequence[float], heave: Sequence[float]) → None#
Set the heave data
- Parameters:
timestamp – in seconds since epoch
heave – in meters, positive upwards
- set_data_position(self, timestamp: Sequence[float], northing: Sequence[float], easting: Sequence[float]) → None#
Set the data of the position system (northing, easting)
- Parameters:
timestamp – in seconds since epoch
northing – northing in meters
easting – easting in meters
- set_extrapolation_mode(self, extrapolation_mode: themachinethatgoesping.tools_nanopy.vectorinterpolators.o_extr_mode = t_extr_mode.extrapolate) → None#
Set the extrapolation mode for all interpolators
- Parameters:
extrapolation_mode – extrapolate, fail or nearest
- set_sensor_configuration(self, sensor_configuration: SensorConfiguration) → None#