The problem of making a section plot for each inlet was broken down into three parts:
- Find or generate a thalweg for the given inlet
- Transform the thalweg into a series of distance/depth pairs
- Convert the distance/depth pairs into a chart to get a sense for the shape of the inlet
The thalwegs were generated in two phases: a first guess, and an interative improvement phase. The first guess was generated by applying a shortest path algorithm to the bathymetry of the inlet. In cases where this first guess was not helpful enough or passed over too much land, weights were applied in order to better approximate the desired thalweg. These weights were determined such that deeper points weighed less, encouraging the search algorithm to favour paths which included the deepest points along the inlet.
Once the path was generated, it was iteratively modified by searching for the deepest point along the inlet that wasn't too close to the other points along the path. When points got too close during this process, they were merged so that a single point would be present at that location on the next pass. Once the path was as deep as it could be given these constraints, it was smoothed in order to avoid loops or other unhelpful features.
If the automated method failed to provide adequate results, a manually created thalweg was used in its place.
Once a usable thalweg was found, the path was populated with more points from the bathymetry in order to ensure the section plot would include more details along the thalweg.
The distance/depth pairs were generated by starting at the point along the thalweg closest to the head of the inlet, and calculating the Haversine distance between succeeding pairs of points. This distance was totalled to give a distance from the head to the given point, and the depth at that point was recorded.
Once the distance/depth pairs were recorded, plotting was done using Matplotlib. Depth was converted into negative elevation in order to make the resulting plot more closely resemble the floor along the inlet, but remains positive depth along the axis of the plot.