subnautica_carthography¶
Top-level package for subnautica_carthography.
Used to log coordinates and write observations to files
Module containing code to determine positions
- subnautica_carthography.positioning.determine_beacon_IDs(beacon_names, beacons: pandas.core.frame.DataFrame)[source]¶
Determines the ID (integer index) of beacons specified by name.
- subnautica_carthography.positioning.distance_to_beacon(x: float, y: float, z: float, beacon_ID: int, reference_beacons: Optional[pandas.core.frame.DataFrame] = None) float[source]¶
Calculates the distance from a position to a beacon specified by beacon_ID.
- subnautica_carthography.positioning.fit_observations(distances: list, beacon_names: list, depth: Optional[float] = None, x_guess: float = 0, y_guess: float = 0, beacon_log= beacon x y z 0 LP5 0 0 0 1 N1 0 1000 0 2 E1 1000 0 0 3 S1 0 -1000 0 4 W1 -1000 0 0) dict[source]¶
Fits distance observations and returns the estimated x, y, z coordinates.
- Parameters
distances – observed distances in m
beacon_names – names of the beacons to which the reference measurements where made.
depth –
- supports different in put formats
None -> will attempt to determine depth based on observation.. float -> will take the depth as a known value. “>0” -> will attempt to determine the height above sea level based on
observations
”<0” -> will attempt to determine depth below sea level based on observations.
- Returns
a dictionary containing the keys, x, y, and z
- Return type
coordinates
Module contain functions to visualize/plot the carthographic data.
- subnautica_carthography.visualization.interpolate_heatmap(x, y, z, n: Optional[int] = None, interp_method: Literal[linear, nearest] = 'linear')[source]¶
The output of this method can directly be used for plt.imshow(z_grid, extent=extent, aspect=’auto’) where the extent is determined by the min and max of the x_grid and y_grid.
The output can also be used as input for ax.pcolormesh(x, y, Z,**kw)
- Parameters
x (
numpy.ndarray) – x data pointsy (
numpy.ndarray) – y data pointsz (
numpy.ndarray) – z data pointsn – number of points for each dimension on the interpolated grid if set to None will auto determine amount of points needed
interp_method – determines what interpolation method is used.
- Returns
x_grid (
numpy.ndarray) – N*1 array of x-values of the interpolated gridy_grid (
numpy.ndarray) – N*1 array of x-values of the interpolated gridz_grid (
numpy.ndarray) – N*N array of z-values that form a grid.
- subnautica_carthography.visualization.plot_nautical_chart(coords: pandas.core.frame.DataFrame, ax: Optional[matplotlib.axes._axes.Axes] = None, mark_depths: bool = False)[source]¶
Takes a pandas dataframe with x,y,z coordinates and creates a nautical chart based on a linear interpolation of the specified coordinates. Uses the topo colormap from cmocean
- Parameters
coords – Coordinates of measured depths should contain columns named “x”, “y”, “z”.
ax – the matplotlib axis to plot on. If no axis is specified, a new figure will be created.
mark_depths – if true plots the coordinates on which the interpolation is based.
- Returns
the figure and axis object
- Return type
f, ax