This is a python script allowing a user to monitor and measure their watch accuracy.
The script analyzes a data file watch1.txt
containing the next human readable data:
# some comment lines starting with '#'
--- YYYY-MM
=== space separated watch list
DDHH diff1[/corr1] diff2[/corr2] ...
DDHH diff1[/corr1] diff2[/corr2] ...
...
=== another watch list
DDHH diff3[/corr3] ...
...
--- YYYY-MM
DDHH diff3[/corr3] ...
...
The file shall contain
- Month directive (e.g.
--- 2023-08
) that activates the chosen month until the next month directive appears - Watch list (e.g.
=== watch1 watch2 watch3
) that activates the list until the next watch list appears - Data point (e.g.
2010 +0.5 -65/+60 -3
) containing day, hour and space separated measurements consisting of the time difference (e.g. the actual time is 10:00:00, the watch shows 09:58:55 so the difference is -65) and the user correction if the watch is corrected after the time measurement (e.g. seeing 09:58:55 and adding a minute yields -65/+60). A data point could be skipped. In this case just leave a minus sign instead the measurement.
One can monitor multiple watch sets at the time, mention months and watches in any order and multiple times. However, the data points of the same watch shall be sorted by time.
The example could be found in watch.txt
.
The script calculates the average accuracy and its error.
The accuracy value is defined as a1
for linear approximation a1 t + a0
of the measures accuracy data.
The error is defined as (sigma + 1) / (measurement period)
where sigma
is RMS of the approximation deviation from the measured accuracy data.
- Drawing graphs for all mentioned watches:
# cd to the directory containing watch.py python watch1.py
- Drawing graphs for the chosen watches:
Output:# cd to the directory containing watch.py python watch1.py Watch3 Watch4 Watch5
Watch3 0.16 ± 0.05 Watch4 0.08 ± 0.05 Watch5 0.29 ± 0.09
python
interpreternumpy
andmatplotlib
packages