Thursday, August 27, 2026

Automatic Motor Routing in qtVlm

Since the very onset of electronic position finding (from LORAN on up to GPS), we have taught that these aids are wonderful tools for telling us where we are, but we must still master traditional navigation skills, because the electronics will not tell us the best, safe, efficient route to where we want to go.

Well... that is still true, but there is now a huge new caveat to the topic: namely, most modern navigation apps, called electronic charting systems (ECS), offer some form of automatic routing. In short, they do indeed now offer to tell us how to get to where we want to go. 

When this first came out, we made jokes about their advertisements, because the results were terrible and dangerous. Some still are. 

But now, more sophisticated ECS like qtVlm have worked on this exercise using official electronic navigational charts (ENC) plus a lot more respect for traditional navigation routing that can be implemented, because of their careful rendition of the ENCs, which include more information than third party proprietary charts used by some apps.

In all cases, the ECS must warn the navigator to carefully check the results before activating the route and blindly following it, which would be negligent. This is, of course, also true with qtVlm automatic routes, but qtVlm already had in place a top quality route checker function, which can be applied to the routes with a button click, plus they present multiple alerts in areas that should be double checked.

qtVlm calls such routes "S57 Motor Routes," because they are based on S-57 internationally standardized ENC and the assumption is you are under power, so you can steer any direction you choose.

Then, when planning ahead and not in the boat already, you move the boat to the place you want to start, and then go to your desired destination and place a mark at that location, then right click that mark, and choose S57 Motor Route.  That will initiate the  computation of a proposed route (in the form of a pathway), taking multiple factors into account, which we go over below.

The route depends on the dimensions of our boat to account for water depth, bridge clearance, transiting locks, narrow channels, and even entering and leaving marinas! Also, there is the option for larger vessels to follow traffic separation schemes (TSS, "shipping lanes"), or (the default) for smaller recreational boat who would like to avoid traffic and must interact with the TSS according to Rule 10 in the COLREGS.

Prior to computing a route we need to enter a few permanent settings:

• Draft (keel depth below waterline, plus your safety margin)

• Air draft (max height above waterline, plus your safety margin)

• Length overall (A+B in the GPS location diagram)

• Beam (C+D in the GPS location diagram) 

• Intended start time and date

• Intended knotmeter speed (so you can export a route plan with times)

 If LOA (A+B)  > 20m (66 ft) you can choose to participate in TSS

The time and speed inputs are important to qtVlm, but not a usual input for other ECS, because qtVlm can load tide and current forecasts from the Operational Forecast System (OFS) model, which provides tide height and tidal currents across most US waters by GRIB download. When those data are loaded, or coastal current data from coastal models such as NCOM or RTOFS, the routes will take that into account when finding the most efficient route. 

Forecasted water depth can be accounted for because qtVlm has the unique capability to also extract from the OFS data the actual water depths at every point on the chart, so it will account for those when applying your draft and air draft plus safety factors.

If you do not have OFS water depth or current GRIB data loaded, then the motor route ignores both tide and current. The depths controlling the route will then be the depth areas between contours, which you can read with a cursor pick on the chart. If the depth area is 6 to 30 ft, meaning its shallow side is defined by the 6-ft depth contour, and you entered a draft plus safety factor of 8 ft, then the motor route will not cross the 6-ft contour.

On the other hand, with OFS tides loaded and the tide in the area is 5 ft during your selected time of the voyage, then that depth area is effectively 11 to 35 ft and the route could cross it.  Clearly in cases like this, we have to be sure we are traveling at the time we said we were — but there are various alerts to warn of deviations.  

(To be a bit more specific: in routes with tides, the computation does not use OFS tides + charted depths, but rather it uses the OFS water depth, which is computed based on its own digital bathymetry of the area.)

With OFS tidal currents loaded, you could have the option of passing either side of an island, with favorable current on one side and unfavorable on the other. The route would typically choose the favorable side. Without current data loaded, the choice of side could be different. 

Likewise, taking a notable shortcut under a bridge can depend on the tide height, because the charted clearance is relative to MHW. At near-zero tide, you could pick up a lot of extra clearance in some areas.

If you wish to avoid a particular region, qtVlm lets you draw in a barrier line or area that the route will not cross. 

Once the route is computed, you can view and export a detailed route log with times, distances, and headings on each leg. The export could be as CSV for printing or as a GPX file to load the actual route into another device.

The video below illustrates some of these features.


[ to be added ]






Monday, August 10, 2026

How the Fit-Slope Method Works

Since we first proposed the Fit-slope method many years ago, and have used it continually since then, I have just realized that the base reason the procedure works is not as obvious as we might have implied in various descriptions of it. The procedure does often lead to improved sight data; it is mentioned in the latest edition of Bowditch: American Practical Navigator. 

A look at basic least squares fit analysis forces us to find the subtlety that makes it such an important aid to celestial sight analysis. But first, a bit of background.

See also our new Fit-slope tool to expedite the analysis described at the end plus video demo.

__________

In celestial navigation, we take a series of sextant sights of a specific body whose height is changing with time, so we end up with a list of times (x) and sextant heights (y). Over a short period of time, the celestial body height changes in a linear way. But our measurements always include some random errors, along with possible systematic errors, as well as periodic blunders. The data points then scatter about a straight line that represents the rise or fall of the height with time as perceived from our moving vessel.

Random errors come from varying judgements on best alignment of the body and the horizon as well as random errors in reading and recording the time of the alignment. Systematic errors might be due to a fading horizon during an evening twilight session. Blunders happen by reading the micrometer incorrectly, or reading 12 on the sextant dial or watch, and then writing down 21.

Such sights might be for an LOP from any celestial body, or they could be a series of lunar distance measurements. The process and initial analysis we discuss here is the same.

We take a series of sights of any one body with the goal of getting just one value, a single time and height that best represents the series of measurements, hopefully averaging out at least the random errors, and catching and removing the blunders. An important procedure we follow to improve on this is to try to take at least 4 sights of 3 different bodies, as near to 120ยบ apart as possible, and we alternate the sights, rather than take all of one body, then all of the next. This method also ensures we get a fix as soon as possible, in case we are somehow interrupted.


An exception occurs with evening sights of Venus, because we can often get a whole series of Venus sights with a sharp bright horizon before we can even see the stars we want to combine with it.


We end up with 4 or 5 sights of each body, and do the following for each set. We plot the Hs (y) vs. time (x) and then draw a straight line through the points, which is intended to represent what the values would be if we did them all precisely. Then we can choose any point on this line to represent the full set of measurements of that body. 


Doing this by hand, we lay a clear plastic ruler on the data so as to go through the most points possible, adjusting the line to leave as many points above as below the line. The difference between any data point and the line is called the residual, with plus above and minus below. The goal is have the sum of these residuals near zero. Points notably off the line could be ignored or weighed less when choosing the line's position. Note we can move the line up and down and we can rotate it to get the best alignment. 


This process is essentially a manual "least squares fit" to a straight line. Using a spreadsheet program like Excel, we would plot the data and then add a linear trend line, which gives us the equation of the best fit line, y = a + bx, where b is the slope and a is the intercept, meaning value of y when x = 0.


Knowing this mathematically correct best-fit line (we get from Excel), we can compare it with what we get when doing it by eye, no math involved. And it turns out that with a bit of practice, the human eye can do a remarkably good job in choosing the best fit, and thus we do not really add much to the analysis with Excel—assuming that is all we wanted out of Excel: the best fit line so we could choose a single sight that we could consider an average of the set for that body.


I think of the above as standard procedure in cel nav, without introducing the Fit-slope Method, which we will look at now.


The principle behind the Fit-slope Method is simple: we can compute the slope of the Hs vs. time line, so when fitting the line, with Excel or by eye with a parallel plotter, we can keep the slope constant as we look for the best fit. That restricts the choice of best fit line position and hence our choice of best representative sight. 


We compute the slope by computing Hc1 at a time at the start of the sight session from the DR at that time (t1) and then again from the DR at the end of the sight session (Hc2 at t2). The slope of the line is then (Hc2-Hc1)/(t2-t1). Plotting by hand we do not need this numeric value, we just plot Hc2 and Hc1 on the same plot as the actual Hs sights and draw a line between them. These Hc values will need a new scale, because they differ from the Hs values by the sum of the altitude corrections. Once on the same plot, we just align a roller plotter with the computed slope and then move it up and down, without rotation, to find the best fit.


That is pretty much the extent of the explanation we have given on how to use the method, followed usually by a couple examples. The Fit-slope Method almost always leads to an improved fix from a set of sights.


____________


But if we look at the details of least squares fitting, we can see that the above discussion has not focused in on why the method actually gets us better averages. It is implied, but not stated, and now I want to clarify how this works


I will state the key points, then at the end show the related math derivations. 


As mentioned above, a linear least squares fit to a table of x vs. y values gives the equation of the best line as y = a + bx. That best-fit line will always pass through the mid point of each axis (x-bar, y-bar), which is called the centroid point of the data set. x-bar is the average of all the sight times and y-bar is the average of all the Hs values.


Thus if the whole goal of the process is to find a single point on the best fit line using all of the sights, then you do not have to plot anything at all. Just choose Hs (best) = the average of all Hs values, and assume this is the value at time T = the average of all the sight times. That collapses the entire analysis to just averaging all of the sight data you have.


A less obvious result to many—though mathematically even simpler—is, if you force the least squares fit to have a fixed, specific slope (i.e., constant b) then the best-fit line will also go through the same centroid point of the data set, and you could again choose the midpoints as best representative of the set. The Hs values at any other time than the centroid will be different, but if the goal is just find a single point on the best fit line, the centroid point will still do the job.


According to that analysis, there is no difference between fit-slope and no fit-slope on choosing a single sight to represent the best average of the set!


The subtlety underlying why the fit-sope gets us a better average in light of the above mathematical facts is that we have assumed we are averaging all of the sights in both cases. 


In most cases, however, we are not using the same set of data in both cases. When using the proper slope we can better tell which sights are likely wrong or outliers, and remove them from the computation of the average. When we change the sights in the average, the average changes, so there is not in practice a common sight solution to the fit-slope vs. no-fit slope solution. Removing only one sight in the set can have a notable effect on the fitted line and centroid value. 


In the end, the fit-slope method is not so much a mathematical result. It is simply a guide to helping the human navigator choose which sights belong in the full set to be averaged. It is easy to find sets of real data that show that using the right slope changes the sights we consider too high or too low. 


In good conditions, we are looking for small corrections to what we might consider a good set of sights to begin with. In poor conditions, with hit and miss sights, of say a sun popping in and out of the clouds, or sights in big seas where we have to wait for a good view of the real horizon, then we might have a large scatter in the data points and the fit slope method is a hope to pull an improved fix out of poor data.


Note that fitting with fixed slope (b) in Excel is not as easy as just "Add trend line" that fits both a and b, but as noted we can do this all manually just as fast or faster than with Excel.


Another note is for the fit-slope method, we must indeed compute the Hc at the beginning and end using some app or formula to get the right slope. Pub 229 does not work for this as we need values for specific DR positions and those corrections in Pub 229 are tedious, and Pub 249 is not accurate enough.


___________


Here is Claude's proof that the best fit line goes through the centroid without a fixed slope and also with a fixed slope.





Below is then the same proof for a fixed slope:




___________________


• They are samples of real data from the book Hawaii By Sextant.   

Sample data 1
hh,mm,ss,Hs-deg,Hs-min
14,55,12,28,50.2
14,56,34,29,03.2
15,01,40,29,55.6
15,15,25,31,55.2

Ref 1
14,55,00,28,35.7

Ref 2
15,16,00,32,12.5

Desired sight time
15,00,00

Known slope
14866.29

------------
Hawaii By Sextant, Prob 27, sights #38b, Capella (12)
7/21/1982z
C=232, S=7.6

DR 1455 = 22 07.8n, 155 08.1w, with Hc = 28 35.7
DR 1516 = 22 06.2n, 155 10.4w, with Hc = 32 12.5

=========================
Sample data 2
hh,mm,ss,Hs-deg,Hs-min
04,53,55,48,56.0
04,54,45,48,50.5
04,56,47,48,40.0
04,58,17,48,32.7
04,59,17,48,27.0

Ref 1
04,53,00,49,09.0

Ref 2
05,00,00,48,34.4

Desired sight time
04,56,00

Known slope
-7117.71

-------------------
Hawaii by Sextant, Prob 18, sights #28a, Jupiter
7/17/1982z
C=247, S=7.7

DR at 0453 = 27 47.0n, 144 39.4w, with Hc = 49 09.0
DR at 0500 = 27 46.6n, 144,30.0w, with Hc = 48 34.4

===========================
Sample data 3
hh,mm,ss,Hs-deg,Hs-min
05,35,24,22,44.8
05,37,08,23,09.0
05,38,19,23,23.2
05,40,06,23,49.0

Ref 1
05,30,00,21,24.0

Ref 2
05,40,00,23,42.1

Desired sight time
5,38,00

Known slope
19886.40

------------
Hawaii by Sextant, Prob 26, sights #37c, Altair (51)
7/21/1982z
C=217, S=5.7

DR 0530 = 22 49.7n, 154 05.1w, with Hc = 21 24.0
DR 0540 = 22 48.9n, 154 05.7w, with Hc = 23 42.1

=========================

The app only reads the data above the single dashed line.





Monday, June 29, 2026

Lunar Distance Revisited with a 1939 C.Plath Kriegsmarine Sextant

We happen to have on consignment a C Plath sextant made for the Kriegsmarine in 1939 Germany. It is a prized collector's item, but we wanted to demonstrate that it remains a top of the line instrument for practical celestial navigation, and likely will for another generation or two, and there is no better way to do this than to show it can be used for lunar distance measurements, considered the epitome of sextant sights.



These sights require measuring sextant angles and index correction to within 0.1' of arc, which is the practical limit for marine sextant sights. Not having done this for a while, I was reminded of several tips that we outline elsewhere, and will note again here. The distance measured was between the moon and Venus on two consecutive nights. We will see that the moon moves to the east of the stars and planets by about 12ยบ per night (360ยบ/30 days).



I did two sets of sights. One with the 4x40 scope that is stock for the instrument and one set where I replaced that with a 6x30 monocular scope (made by the modern C Plath company), which is preferred for this measurement, because it makes the edge of the moon sharper. The spread in the data were smaller with the 6x30 scope, but the resulting UTC and Lon found from the measurements was actually better with the 4x40. That was just an accident, as there is always some luck involved with these sights. The higher power scope should in the longer run get better results.

This early C Plath sextant is ideal for lunars in that it is high precision and very light weight (2 lb 10z), being made from an aluminum alloy that C Plath pioneered for sextant manufacture in that era. Lunar sights take longer than conventional sights, which reminded me of the ludicrous presumptions we periodically see in advertising claiming heavy brass sextants weighing almost twice as much are preferred for their inertia and stability doing sights! Those sextants weigh more than a half a gallon of milk. Hold a full milk carton up to your nose with your head leaned back a bit for a minute or so to get the picture. The lighter sextant is always preferred and always the top of line in sextants. 

For these sights, we even want more support if we can rig it. With an eye cup that lets us press the head against the sextant, and ideally a support to lean your elbow on. Then tune the scope to show the moon's edge as sharp as possible. The star or planet, however, will always be a point of light... in principle. In fact, that point of light will have a fuzzy halo around it when looking as close as we can, and that puts a limit on the accuracy. This could be optics or it could be we just needed some eye drops!

Here are results of the first set of sights taken from a pocket beach on Puget Sound (47ยบ 40.5'N, 122ยบ 24.5'W), 0.4 nmi due west of our office. These sights used the stock 4x40 scope from 1939. 

These were typed into Excel then plotted, and then fit with a straight line, which we can add with a button click, called "Add trend line." This produces a least squares fit of the data, with the equation showing.

On the other hand, we can just plot the data manually and then do the fit by eye, lay a transparent ruler across the plot such that it goes though or near the most points, leaving as many below as above the line. If any are notably far from the line, just remove them, as likely in error. The goal is remove the blunders and fit the random errors.

One way or the other, however, it is crucial to make the plot to find the best representative of the full set. One or two sights alone are not enough for this process, nor in fact for traditional cel nav sights.

Note that in the analysis, we do not have to take values that we actually measured. In principle we should take a value that is on the line. Ideally we would have at least one sight right on the line and we could use that one, but not in this case.

Many lunar clearing procedures (how we get measured time and longitude from these sights) do not work well for Venus or Mars (the two closest planets) nor for LD less than 10ยบ or so, but the Frank Reed app online at fer3.com should cover these, which is what we used. (Sample output screen at the end here.)

Here an easy first choice might be to use a LD= 4ยบ 8.0' at 10:01:56 PM PDT 6/17 = 05:01:56 UTC 6/18. That measurement (#1) leads to a discovered Lon error of 3.3' as shown in the list below, which corresponds to a time error of 13s.

Since we know the equation for the fit to the data, we can do maybe better since our choice was not exactly on the line. If we use the equation to find the precise time (#2) corresponding to 4ยบ 8.0' it would be 10:02:11 PDT or time error of just 3s. But both analyses have to be considered on the fortuitous side. Generally it is considered good lunar work to find the correct time to within 30s, and these measurements, no matter how careful, can yield even larger errors.

For example, if we remove the 3rd and 4th sights, which are off the most from the fit, we get a new best fit line, and that yields a 4ยบ 8.0' LD of 10:02:29, shown below as #3, which now has the best looking data fit, but the Lon and time errors are larger.

#    UTC          LD            LD error   Lon error    Time error    Position error 
1    050156    4ยบ  8.0'     +0.1'           3.3'             13s                    2.2 nmi
2   050211     4ยบ 8.0'      -0.02'         0.7'               3s                   0.4 nmi    
3   050229    4ยบ 8.0'      -0.2'           5.4'             22s                    3.6 nmi 

The main goal at hand for these sights were to show that right out of the box, the 1939 C Plath sextant we have on sale could do high precision lunars. These very good results, however, must still be considered fortuitous, especially since the index correction measurement was not as precise as we would want. It was set to zero using a direct view of Venus, which was not as sharp as it could be with more work. In the next set of sights, the IC was readjusted and measured more carefully with the solar index method.

________

For the second set, the next night, I changed to 4x40 to 6x30 and got these results for 6/18 PDT. The IC was 1.2' on the scale (see notes at the end here)



We see slightly better on the data scatter, and again if we were to take just one it would likely be the middle one right on the linear fit to the line, that leads to sight #4, which was not as good as the earlier session, though it seems the sights were better. In sight #4, the measured LD of 17ยบ 37.7' was corrected for the IC ("If it's on; take it off!").

#    UTC          LD            LD error   Lon error    Time error    Position error 
4    054354    17ยบ  36.5'     -0.5'           14.1'             56s                    14.1 nmi
5    054405    17ยบ  36.8'    -0.3'             8.1              32s                    5.4 nmi  

In sight #5, to get a better fit, I removed the 3rd sight, which was off the most from the line, and then got a new slope, and used that slope to compute what time would correspond to 17ยบ 38.0', the sextant value without IC = -1.2' applied. Note that with the third sight removed, the middle sight was no longer on the best fit line.


Excel keeps track of times in terms of fractions of 24 hr, i.e., x = (38.0+376.89)/927.58 = 0.44728). This sight is more typical of practitioners like myself who do these only infrequently. Experts can average about 15s. Note that even with fairly large Lon errors, the actual position errors are not that large at mid to higher latitudes. The position error is all Lon error since we rightfully assume that we can find accurate Lat with out accurate UTC.

Here is a sample output from the fer3.com lunar clearing solution:


The index correction was measured with the solar method using the 6x30 scope the following day. This is the preferred method for best accuracy. It requires a couple custom filters, which the article explains how to make. We have an app online that does the simple math to find the SD from two solar measurements.



So the IC was 1.2' On the scale. The actual SD at the time was 15.75', so this IC is likely accurate to within a few tenths of a minute, but normally one would take more sights than just two.

Later I will try to post more notes about using Excel to analyze cel nav sights.







Friday, June 26, 2026

Polar Wave Spectra

 


This is a place holder for soon to follow instructions on the use of our polar wave spectra plots for understanding the seaway and for setting up optimum routing corrections for waves, including how to generate the plots with our new, free 

 Polar Wave Spectrum Plotter app

get the spectra data at this custom link we made

NDBC Buoys with Spectra Data

Thanks to the staff at NDBC for providing notes on the computation (References).


________________________

INSTRUCTIONS

1) Enter the NDBC buoy no, such as 41010

2) That will generate the link to the spectra data on the right

3) Click the link below that line to open that page in a new tab.

4) cmd+A or ctrl+A to select the full set of data, the cmd+C or ctrl+C to copy it

5) Paste it into the space provided

6) Click plot pasted data, which would typically load 5 days, with data every 30 min. This may vary with buoy.

7) The slide bar steps through the data.

Here is a sample of what the data should look like 

Not: period (sec) = 1/frequency(Hz)

YYYY MM DD hh mm bands
freq bandwidth energy r1 r2 alpha1 alpha2
2026 06 27 22 50 46
0.033 0.005  0.000 999.00 999.00 999 999 = 30s period
0.038 0.005  0.000 999.00 999.00 999 999
0.043 0.005  0.000 999.00 999.00 999 999
0.048 0.005  0.000 999.00 999.00 999 999
0.053 0.005  0.000 999.00 999.00 999 999
0.058 0.005  0.000 999.00 999.00 999 999
0.063 0.005  0.000 999.00 999.00 999 999
0.068 0.005  0.000   0.27   0.53 120 112 = 14.7s period
0.073 0.005  0.043   0.43   0.49 116 116
0.078 0.005  0.100   0.59   0.18 104 100
0.083 0.005  0.100   0.38   0.21 116 176
0.088 0.005  0.143   0.35   0.27 112 156
0.093 0.005  0.315   0.63   0.35 108 108
0.100 0.010  0.529   0.85   0.68 108 108
0.110 0.010  0.958   0.87   0.67 124 124
0.120 0.010  1.430   0.88   0.61 120 124
0.130 0.010  1.301   0.91   0.76 128 128
0.140 0.010  0.758   0.84   0.55 124 124
0.150 0.010  1.115   0.91   0.73 112 112
0.160 0.010  0.601   0.85   0.63 128 132
0.170 0.010  0.601   0.86   0.57 128 128
0.180 0.010  0.586   0.88   0.66 128 124
0.190 0.010  0.529   0.82   0.46 132 132
0.200 0.010  0.300   0.69   0.08 144 168
0.210 0.010  0.300   0.80   0.42 136 140
0.220 0.010  0.157   0.75   0.38 128 136
0.230 0.010  0.129   0.68   0.19 152 148
0.240 0.010  0.200   0.72   0.23 136 156
0.250 0.010  0.086   0.61   0.46 124  96
0.260 0.010  0.100   0.67   0.05 140 128
0.270 0.010  0.043   0.73   0.33 128 136
0.280 0.010  0.057   0.72   0.30 132 120
0.290 0.010  0.043   0.61   0.10 156 172
0.300 0.010  0.057   0.76   0.41 156 160
0.310 0.010  0.014   0.55   0.21 132  84
0.320 0.010  0.043   0.69   0.25 160 184
0.330 0.010  0.014   0.66   0.42 160 180
0.340 0.010  0.029   0.55   0.14 144 188
0.350 0.010  0.014   0.66   0.30 148 124
0.365 0.020  0.014   0.41   0.21 164 196 = 2.7s period
0.385 0.020  0.000   0.48   0.46 208 220
0.405 0.020  0.000   0.57   0.47 144 136 
0.425 0.020  0.000 999.00 999.00 999 999
0.445 0.020  0.000 999.00 999.00 999 999
0.465 0.020  0.000 999.00 999.00 999 999
0.485 0.020  0.000 999.00 999.00 999 999

All 9s means no data for those specs. We only plot 4s to 25s.


Back soon with notes on what the plots show and how we can use them.

Periods of 3 to 8 sec are waves (global mean ~ 5s) ; periods over 10 sec are swells, with global mean of about 11s... but with large variations on ocean and season (~8 to 18s). 

Note that not all NDBC buoys have spectra data. Ones we know about are in the interactive link above.


___________________


References

NDBC Technical Document 03-01:
Nondirectional andDirectional WaveData AnalysisProcedures 

See also:  https://www.ndbc.noaa.gov/faq/measdes.shtml Section on Spectral Wave Data.

See also SOFAR Spotter Buoy Reference Manual