0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

約19年周期の地球の自転速度の揺れ?

Last updated at Posted at 2025-01-17

図1.png

グリニッジ恒星時のデータ

  1. 理科年表プレミアムで グリニッジ恒星時 のデータ 1960 〜 2025 年(66年分)をダウンロード('25/1/14)
  2. 前日との差分(秒)を作ると 236.5 か 236.6 らしい
    1960/1/1 は前日のデータがないので 236.5 とした
  3. 236.5 または 236.6 ではなく前後と異質な値を発見
  4. 紙データを電子化したときの入力ミスと思われるので、データを修正(概ね各一文字)
  5. 前日との差分(秒)を再作成

修正情報

日付 誤 h m s 修 h m s
1960/11/12 03:24:20.4 03:24:29.4 20.4 → 29.4 (0 → 9)
1964/11/14 03:32:29.0 03:32:29.2 29.0 → 29.2 (0 → 9)
1967/03/03 10:40:10.6 10:40:19.6 10.6 → 19.6 (0 → 9)
1967/05/03 14:40:40.5 14:40:49.5 40.5 → 49.5 (0 → 9)
1967/11/08 03:55:08.6 03:05:58.6 3 55 8.6
3 5 58.6
1967/12/11 05:10:05.0 05:16:05.0 10   → 16   (0 → 6)
1968/01/21 07:57:48.9 07:57:43.9 48.9 → 43.9 (8 → 3)
1968/05/17 18:39:00.8 15:39:00.8 18   → 15   (8 → 5)
1968/09/05 22:50:38.7 22:56:38.7 50   → 56   (0 → 6)
1968/09/25 00:15:20.7 00:15:29.7 20.7 → 29.7 (0 → 9)
1968/10/08 01:06:44.0 01:06:44.9 44.0 → 44.9 (0 → 9)
1968/10/28 02:25:30.0 02:25:36.0 30.0 → 36.0 (0 → 6)
1968/10/31 02:34:25.7 02:37:25.7 34   → 37   (4 → 7)
1968/12/08 05:07:14.0 05:07:14.9 14.0 → 14.9 (0 → 9)
1970/01/10 07:06:24.4 07:16:24.4 7 6 24.4
7 16 24.4
1974/12/04 04:49:52.6 04:49:42.6 52.6 → 42.6 (5 → 4)
1977/03/05 10:50:03.6 10:50:30.6 10 50 3.6
10 50 30.6
1977/06/01 16:37:27.8 16:37:27.3 27.8 → 27.3 (8 → 3)
1979/03/29 12:13:12.6 12:23:12.6 13   → 23   (1 → 2)
1979/05/01 14:38:18.8 14:33:18.8 38   → 33   (8 → 3)
1979/05/21 15:22:09.9 15:52:09.9 22   → 52   (2 → 5)
1979/12/16 05:35:09.8 05:36:09.8 35   → 36   (5 → 6)
1980/07/16 19:35:26.1 19:35:56.1 26.1 → 56.1 (2 → 5)
1981/08/16 21:37:11.4 21:37:11.7 11.4 → 11.7 (4 → 7)
1981/11/14 03:22:01.5 03:32:01.5 22   → 32   (2 → 3)
1981/11/19 03:51:11.3 03:51:44.3 11.3 → 44.3 (1 → 4)
1982/03/29 12:24:16.8 12:24:16.5 16.8 → 16.5 (8 → 5)
1982/11/02 02:43:43.5 02:43:45.5 43.5 → 45.5 (3 → 5)
1984/03/24 12:16:35.8 12:06:35.8 12 16 35.8
12 6 35.8
1984/11/15 03:37:02.5 03:37:02.8  2.5 →  2.8 (5 → 8)
1992/12/09 05:11:05.0 05:11:57.0 5 11 5.0
5 11 57.0
diff -rU 0 orig/c160x03201.csv mod/c160x03201.csv
--- orig/c160x03201.csv	2025-01-17 18:35:17
+++ mod/c160x03201.csv	2025-01-17 18:41:57
@@ -14 +14 @@
-12,7 22 0.4,9 24 13.7,11 18 33.7,13 20 46.8,15 19 3.4,17 21 16.6,19 19 33.3,21 21 46.5,23 23 59.7,1 22 16.2,3 24 20.4,5 22 46.1
+12,7 22 0.4,9 24 13.7,11 18 33.7,13 20 46.8,15 19 3.4,17 21 16.6,19 19 33.3,21 21 46.5,23 23 59.7,1 22 16.2,3 24 29.4,5 22 46.1
diff -rU 0 orig/c164x03201.csv mod/c164x03201.csv
--- orig/c164x03201.csv	2025-01-17 18:35:45
+++ mod/c164x03201.csv	2025-01-17 18:41:57
@@ -16 +16 @@
-14,7 29 59.9,9 32 13.2,11 26 33.2,13 28 46.3,15 27 3.0,17 29 16.3,19 27 33.0,21 29 46.2,23 31 59.4,1 30 16.0,3 32 29.0,5 30 45.9
+14,7 29 59.9,9 32 13.2,11 26 33.2,13 28 46.3,15 27 3.0,17 29 16.3,19 27 33.0,21 29 46.2,23 31 59.4,1 30 16.0,3 32 29.2,5 30 45.9
diff -rU 0 orig/c167x03201.csv mod/c167x03201.csv
--- orig/c167x03201.csv	2025-01-17 18:36:07
+++ mod/c167x03201.csv	2025-01-17 18:41:57
@@ -5 +5 @@
-3,6 47 42.8,8 49 56.1,10 40 10.6,12 42 32.8,14 40 40.5,16 43 2.7,18 41 19.5,20 43 32.8,22 45 46.0,0 44 2.6,2 46 15.8,4 44 32.5
+3,6 47 42.8,8 49 56.1,10 40 19.6,12 42 32.8,14 40 49.5,16 43 2.7,18 41 19.5,20 43 32.8,22 45 46.0,0 44 2.6,2 46 15.8,4 44 32.5
@@ -10 +10 @@
-8,7 7 25.6,9 9 38.9,11 0 2.4,13 2 15.6,15 0 32.2,17 2 45.5,19 1 2.3,21 3 15.5,23 5 28.7,1 3 45.3,3 55 8.6,5 4 15.3
+8,7 7 25.6,9 9 38.9,11 0 2.4,13 2 15.6,15 0 32.2,17 2 45.5,19 1 2.3,21 3 15.5,23 5 28.7,1 3 45.3,3 5 58.6,5 4 15.3
@@ -13 +13 @@
-11,7 19 15.3,9 21 28.6,11 11 52.1,13 14 5.2,15 12 21.9,17 14 35.2,19 12 51.9,21 15 5.2,23 17 18.4,1 15 35.0,3 17 48.2,5 10 5.0
+11,7 19 15.3,9 21 28.6,11 11 52.1,13 14 5.2,15 12 21.9,17 14 35.2,19 12 51.9,21 15 5.2,23 17 18.4,1 15 35.0,3 17 48.2,5 16 5.0
diff -rU 0 orig/c168x03201.csv mod/c168x03201.csv
--- orig/c168x03201.csv	2025-01-17 18:36:22
+++ mod/c168x03201.csv	2025-01-17 18:41:57
@@ -7 +7 @@
-5,6 54 38.9,8 56 52.2,10 51 12.3,12 53 25.5,14 51 42.1,16 53 55.4,18 52 12.2,20 54 25.5,22 50 38.7,0 54 55.3,2 57 8.5,4 55 25.2
+5,6 54 38.9,8 56 52.2,10 51 12.3,12 53 25.5,14 51 42.1,16 53 55.4,18 52 12.2,20 54 25.5,22 56 38.7,0 54 55.3,2 57 8.5,4 55 25.2
@@ -10 +10 @@
-8,7 6 28.6,9 8 41.9,11 3 2.0,13 5 15.2,15 3 31.8,17 5 45.1,19 4 1.8,21 6 15.1,23 8 28.3,1 6 44.0,3 8 58.1,5 7 14.0
+8,7 6 28.6,9 8 41.9,11 3 2.0,13 5 15.2,15 3 31.8,17 5 45.1,19 4 1.8,21 6 15.1,23 8 28.3,1 6 44.9,3 8 58.1,5 7 14.9
@@ -19 +19 @@
-17,7 41 57.6,9 44 10.9,11 38 31.0,13 40 44.1,18 39 0.8,17 41 14.1,19 39 30.9,21 41 44.1,23 43 57.3,1 42 13.9,3 44 27.1,5 42 43.9
+17,7 41 57.6,9 44 10.9,11 38 31.0,13 40 44.1,15 39 0.8,17 41 14.1,19 39 30.9,21 41 44.1,23 43 57.3,1 42 13.9,3 44 27.1,5 42 43.9
@@ -23 +23 @@
-21,7 57 48.9,9 59 57.1,11 54 17.2,13 56 30.4,15 54 47.1,17 57 0.3,19 55 17.1,21 57 30.4,23 59 43.5,1 58 0.1,4 0 13.4,5 58 30.2
+21,7 57 43.9,9 59 57.1,11 54 17.2,13 56 30.4,15 54 47.1,17 57 0.3,19 55 17.1,21 57 30.4,23 59 43.5,1 58 0.1,4 0 13.4,5 58 30.2
@@ -27 +27 @@
-25,8 13 30.1,10 15 43.3,12 10 3.4,14 12 16.6,16 10 33.3,18 12 46.6,20 11 3.3,22 13 16.6,0 15 20.7,2 13 46.4,4 15 59.6,6 14 16.4
+25,8 13 30.1,10 15 43.3,12 10 3.4,14 12 16.6,16 10 33.3,18 12 46.6,20 11 3.3,22 13 16.6,0 15 29.7,2 13 46.4,4 15 59.6,6 14 16.4
@@ -30 +30 @@
-28,8 25 19.8,10 27 33.0,12 21 53.1,14 24 6.2,16 22 22.9,18 24 36.3,20 22 53.0,22 25 6.2,0 27 19.4,2 25 30.0,4 27 49.3,6 26 6.1
+28,8 25 19.8,10 27 33.0,12 21 53.1,14 24 6.2,16 22 22.9,18 24 36.3,20 22 53.0,22 25 6.2,0 27 19.4,2 25 36.0,4 27 49.3,6 26 6.1
@@ -33 +33 @@
-31,8 37 9.5,,12 33 42.7,,16 34 12.6,,20 34 42.7,22 36 55.9,,2 34 25.7,,6 37 55.7
+31,8 37 9.5,,12 33 42.7,,16 34 12.6,,20 34 42.7,22 36 55.9,,2 37 25.7,,6 37 55.7
diff -rU 0 orig/c170x03201.csv mod/c170x03201.csv
--- orig/c170x03201.csv	2025-01-17 18:36:39
+++ mod/c170x03201.csv	2025-01-17 18:41:57
@@ -12 +12 @@
-10,7 6 24.4,9 18 37.7,11 9 1.2,13 11 14.3,15 9 31.0,17 11 44.3,19 10 1.1,21 12 14.3,23 14 27.5,1 12 44.1,3 14 57.3,5 13 14.1
+10,7 16 24.4,9 18 37.7,11 9 1.2,13 11 14.3,15 9 31.0,17 11 44.3,19 10 1.1,21 12 14.3,23 14 27.5,1 12 44.1,3 14 57.3,5 13 14.1
diff -rU 0 orig/c174x03201.csv mod/c174x03201.csv
--- orig/c174x03201.csv	2025-01-17 18:36:59
+++ mod/c174x03201.csv	2025-01-17 18:41:57
@@ -6 +6 @@
-4,6 52 53.2,8 55 6.5,10 45 30.0,12 47 43.1,14 45 59.7,16 48 13.0,18 46 29.7,20 48 43.0,22 50 56.1,0 49 12.7,2 51 25.9,4 49 52.6
+4,6 52 53.2,8 55 6.5,10 45 30.0,12 47 43.1,14 45 59.7,16 48 13.0,18 46 29.7,20 48 43.0,22 50 56.1,0 49 12.7,2 51 25.9,4 49 42.6
diff -rU 0 orig/c177x03201.csv mod/c177x03201.csv
--- orig/c177x03201.csv	2025-01-17 18:37:14
+++ mod/c177x03201.csv	2025-01-17 18:41:57
@@ -3 +3 @@
-1,6 42 7.7,8 44 20.9,10 34 44.4,12 36 57.6,14 35 14.1,16 37 27.8,18 35 44.1,20 37 57.3,22 40 10.4,0 38 27.0,2 40 40.1,4 38 56.8
+1,6 42 7.7,8 44 20.9,10 34 44.4,12 36 57.6,14 35 14.1,16 37 27.3,18 35 44.1,20 37 57.3,22 40 10.4,0 38 27.0,2 40 40.1,4 38 56.8
@@ -7 +7 @@
-5,6 57 53.9,9 0 7.2,10 50 3.6,12 52 43.7,14 51 0.3,16 53 13.6,18 51 30.3,20 53 43.5,22 55 56.6,0 54 13.2,2 56 26.4,4 54 43.0
+5,6 57 53.9,9 0 7.2,10 50 30.6,12 52 43.7,14 51 0.3,16 53 13.6,18 51 30.3,20 53 43.5,22 55 56.6,0 54 13.2,2 56 26.4,4 54 43.0
diff -rU 0 orig/c179x03201.csv mod/c179x03201.csv
--- orig/c179x03201.csv	2025-01-17 18:37:28
+++ mod/c179x03201.csv	2025-01-17 18:41:57
@@ -3 +3 @@
-1,6 40 12.4,8 42 25.7,10 32 49.1,12 35 2.2,14 38 18.8,16 35 32.1,18 33 48.7,20 36 2.0,22 38 15.1,0 36 31.7,2 38 44.8,4 37 1.5
+1,6 40 12.4,8 42 25.7,10 32 49.1,12 35 2.2,14 33 18.8,16 35 32.1,18 33 48.7,20 36 2.0,22 38 15.1,0 36 31.7,2 38 44.8,4 37 1.5
@@ -18 +18 @@
-16,7 39 20.8,9 41 34.0,11 31 57.4,13 34 10.5,15 32 27.2,17 34 40.4,19 32 57.1,21 35 10.3,23 37 23.4,1 35 40.0,3 37 53.2,5 35 9.8
+16,7 39 20.8,9 41 34.0,11 31 57.4,13 34 10.5,15 32 27.2,17 34 40.4,19 32 57.1,21 35 10.3,23 37 23.4,1 35 40.0,3 37 53.2,5 36 9.8
@@ -23 +23 @@
-21,7 59 3.5,10 1 16.7,11 51 40.2,13 53 53.3,15 22 9.9,17 54 23.2,19 52 39.9,21 54 53.1,23 57 6.2,1 55 22.7,3 57 35.9,5 55 52.6
+21,7 59 3.5,10 1 16.7,11 51 40.2,13 53 53.3,15 52 9.9,17 54 23.2,19 52 39.9,21 54 53.1,23 57 6.2,1 55 22.7,3 57 35.9,5 55 52.6
@@ -31 +31 @@
-29,8 30 36.0,,12 13 12.6,14 25 25.7,16 23 42.4,18 25 55.6,20 24 12.3,22 26 25.5,0 28 38.6,2 26 55.2,4 29 8.4,6 27 25.1
+29,8 30 36.0,,12 23 12.6,14 25 25.7,16 23 42.4,18 25 55.6,20 24 12.3,22 26 25.5,0 28 38.6,2 26 55.2,4 29 8.4,6 27 25.1
diff -rU 0 orig/c180x03201.csv mod/c180x03201.csv
--- orig/c180x03201.csv	2025-01-17 18:37:45
+++ mod/c180x03201.csv	2025-01-17 18:41:57
@@ -18 +18 @@
-16,7 38 23.1,9 40 36.3,11 34 56.4,13 37 9.5,15 35 26.1,17 37 39.4,19 35 26.1,21 38 9.2,23 40 22.4,1 38 38.9,3 40 52.1,5 39 8.8
+16,7 38 23.1,9 40 36.3,11 34 56.4,13 37 9.5,15 35 26.1,17 37 39.4,19 35 56.1,21 38 9.2,23 40 22.4,1 38 38.9,3 40 52.1,5 39 8.8
diff -rU 0 orig/c181x03201.csv mod/c181x03201.csv
--- orig/c181x03201.csv	2025-01-17 18:38:26
+++ mod/c181x03201.csv	2025-01-17 18:41:57
@@ -16 +16 @@
-14,7 33 29.0,9 35 42.2,11 26 5.7,13 28 18.8,15 26 35.4,17 28 48.7,19 27 5.4,21 29 18.6,23 31 31.8,1 29 48.3,3 22 1.5,5 30 18.2
+14,7 33 29.0,9 35 42.2,11 26 5.7,13 28 18.8,15 26 35.4,17 28 48.7,19 27 5.4,21 29 18.6,23 31 31.8,1 29 48.3,3 32 1.5,5 30 18.2
@@ -18 +18 @@
-16,7 41 22.1,9 43 35.3,11 33 58.8,13 36 11.9,15 34 28.5,17 36 41.8,19 34 58.5,21 37 11.4,23 39 24.9,1 37 41.4,3 39 54.6,5 38 11.4
+16,7 41 22.1,9 43 35.3,11 33 58.8,13 36 11.9,15 34 28.5,17 36 41.8,19 34 58.5,21 37 11.7,23 39 24.9,1 37 41.4,3 39 54.6,5 38 11.4
@@ -21 +21 @@
-19,7 53 11.8,9 55 25.0,11 45 48.5,13 48 1.6,15 46 18.2,17 48 31.5,19 46 48.2,21 49 1.4,23 51 14.5,1 49 31.1,3 51 11.3,5 50 1.0
+19,7 53 11.8,9 55 25.0,11 45 48.5,13 48 1.6,15 46 18.2,17 48 31.5,19 46 48.2,21 49 1.4,23 51 14.5,1 49 31.1,3 51 44.3,5 50 1.0
diff -rU 0 orig/c182x03201.csv mod/c182x03201.csv
--- orig/c182x03201.csv	2025-01-17 18:38:49
+++ mod/c182x03201.csv	2025-01-17 18:41:57
@@ -4 +4 @@
-2,6 45 12.8,8 47 26.1,10 37 49.6,12 40 2.7,14 38 19.4,16 40 32.6,18 38 49.3,20 41 2.6,22 43 15.7,0 41 32.3,2 43 43.5,4 42 2.2
+2,6 45 12.8,8 47 26.1,10 37 49.6,12 40 2.7,14 38 19.4,16 40 32.6,18 38 49.3,20 41 2.6,22 43 15.7,0 41 32.3,2 43 45.5,4 42 2.2
@@ -31 +31 @@
-29,8 31 39.9,,12 24 16.8,14 26 29.7,16 24 46.4,18 26 59.6,20 25 16.3,22 27 29.5,0 29 42.7,2 27 59.3,4 30 12.5,6 28 29.2
+29,8 31 39.9,,12 24 16.5,14 26 29.7,16 24 46.4,18 26 59.6,20 25 16.3,22 27 29.5,0 29 42.7,2 27 59.3,4 30 12.5,6 28 29.2
diff -rU 0 orig/c184x03201.csv mod/c184x03201.csv
--- orig/c184x03201.csv	2025-01-17 18:39:11
+++ mod/c184x03201.csv	2025-01-17 18:41:57
@@ -17 +17 @@
-15,7 34 33.5,9 36 46.7,11 31 6.8,13 33 19.9,15 31 36.6,17 33 49.9,19 32 6.6,21 34 19.9,23 36 33.0,1 34 49.6,3 37 2.5,5 35 19.6
+15,7 34 33.5,9 36 46.7,11 31 6.8,13 33 19.9,15 31 36.6,17 33 49.9,19 32 6.6,21 34 19.9,23 36 33.0,1 34 49.6,3 37 2.8,5 35 19.6
@@ -26 +26 @@
-24,8 10 2.5,10 12 15.7,12 16 35.8,14 8 48.9,16 7 5.6,18 9 18.9,20 7 35.6,22 9 48.8,0 12 2.0,2 10 18.6,4 12 31.8,6 10 48.6
+24,8 10 2.5,10 12 15.7,12 6 35.8,14 8 48.9,16 7 5.6,18 9 18.9,20 7 35.6,22 9 48.8,0 12 2.0,2 10 18.6,4 12 31.8,6 10 48.6
diff -rU 0 orig/c192x03201.csv mod/c192x03201.csv
--- orig/c192x03201.csv	2025-01-17 18:39:35
+++ mod/c192x03201.csv	2025-01-17 18:41:57
@@ -11 +11 @@
-9,7 11 11.0,9 13 24.3,11 7 44.3,13 9 57.5,15 8 14.1,17 10 27.4,19 8 44.1,21 10 57.4,23 13 10.5,1 11 27.1,3 13 40.3,5 11 5.0
+9,7 11 11.0,9 13 24.3,11 7 44.3,13 9 57.5,15 8 14.1,17 10 27.4,19 8 44.1,21 10 57.4,23 13 10.5,1 11 27.1,3 13 40.3,5 11 57.0

前日との差分(秒)の年平均

グリニッジ恒星時の情報は 0.1 秒単位で表現されていますが、省略桁の部分は次の日に含まれていると考えることができます。ある程度の日数で平均すると 0.1 秒未満の平均速度が得られます。年単位で平均をとり、66年分の平均との差(百万分の一秒単位)が以下になります。これをグラフにしたものが先頭の図(MS-Excelで作成)です。

以下に表示している値はテキトーに作業した結果で、演算誤差等が大いに含まれています。

66年分の平均 = 236.55538225411706

前日差の年平均(秒) 66年分平均との差
百万分の一秒単位
1960 236.55437158469942 -1010.669417638610000
1961 236.55452054794520 -861.706171860987500
1962 236.55479452054794 -587.733569119564000
1963 236.55479452054794 -587.733569119564000
1964 236.55546448087432 82.226757257330970
1965 236.55561643835617 234.184239104706650
1966 236.55616438356165 782.129444587553700
1967 236.55589041095888 508.156841817708500
1968 236.55628415300550 901.898888429286700
1969 236.55643835616440 1056.102047328977300
1970 236.55616438356165 782.129444587553700
1971 236.55616438356165 782.129444587553700
1972 236.55573770491802 355.450800952894500
1973 236.55561643835617 234.184239104706650
1974 236.55506849315070 -313.760966349718730
1975 236.55479452054794 -587.733569119564000
1976 236.55464480874318 -737.445373886203000
1977 236.55452054794520 -861.706171860987500
1978 236.55452054794520 -861.706171860987500
1979 236.55424657534246 -1135.678774602411000
1980 236.55464480874318 -737.445373886203000
1981 236.55479452054794 -587.733569119564000
1982 236.55534246575343 -39.788363636716895
1983 236.55534246575343 -39.788363636716895
1984 236.55573770491802 355.450800952894500
1985 236.55643835616440 1056.102047328977300
1986 236.55616438356165 782.129444587553700
1987 236.55616438356165 782.129444587553700
1988 236.55628415300550 901.898888429286700
1989 236.55616438356165 782.129444587553700
1990 236.55616438356165 782.129444587553700
1991 236.55561643835617 234.184239104706650
1992 236.55546448087432 82.226757257330970
1993 236.55506849315070 -313.760966349718730
1994 236.55452054794520 -861.706171860987500
1995 236.55479452054794 -587.733569119564000
1996 236.55437158469942 -1010.669417638610000
1997 236.55424657534246 -1135.678774602411000
1998 236.55452054794520 -861.706171860987500
1999 236.55479452054794 -587.733569119564000
2000 236.55491803278690 -464.221330162217800
2001 236.55534246575343 -39.788363636716895
2002 236.55561643835617 234.184239104706650
2003 236.55589041095888 508.156841817708500
2004 236.55601092896174 628.674844676879700
2005 236.55616438356165 782.129444587553700
2006 236.55643835616440 1056.102047328977300
2007 236.55616438356165 782.129444587553700
2008 236.55628415300550 901.898888429286700
2009 236.55589041095888 508.156841817708500
2010 236.55534246575343 -39.788363636716895
2011 236.55534246575343 -39.788363636716895
2012 236.55519125683060 -190.997286466654260
2013 236.55452054794520 -861.706171860987500
2014 236.55452054794520 -861.706171860987500
2015 236.55424657534246 -1135.678774602411000
2016 236.55464480874318 -737.445373886203000
2017 236.55424657534246 -1135.678774602411000
2018 236.55479452054794 -587.733569119564000
2019 236.55534246575343 -39.788363636716895
2020 236.55519125683060 -190.997286466654260
2021 236.55589041095888 508.156841817708500
2022 236.55589041095888 508.156841817708500
2023 236.55616438356165 782.129444587553700
2024 236.55628415300550 901.898888429286700
2025 236.55643835616440 1056.102047328977300

Python スクリプト

#!/usr/bin/env python3

import os


def celltomsec(cell):
    h, m, s = cell.replace('  ', ' ').split(' ')
    return int(h) * 3600000 + int(m) * 60000 + int(float(s) * 10) * 100


def checkfilename(name):
    return (name[-4:] == '.csv' and
            name[:2] in ('c1', 'c2') and
            name[4:-4] in ('x03201', 'x02801'))


def read_csv(path, year):
    with open(path, encoding='sjis') as fp:
        lines = [[c.strip() for c in r.strip().split(',')] for r in fp.readlines()]
    return [[f'{year}/{month+1:02}/{day+1:02}', celltomsec(cell)]
            for day, line in enumerate(lines[2:])
            for month, cell in enumerate(line[1:]) if cell]


def read_data(srcdir):
    data = sorted(sum((
        read_csv(f'{srcdir}/{file}', 1800 + int(file[1:4]))
        for file in sorted(filter(checkfilename, os.listdir(srcdir)))), []))
    pms = None
    for day in data:
        cms = day[1]
        dms = 236_500 if pms is None else cms - pms + (0 if cms > pms else 86400_000)
        if dms not in (236_500, 236_600):
            raise Exception(f'{day[0]}: 前日のデータが無いか壊れてます : {dms}')
        day[1] = (day[1], dms)
        pms = cms
    return data


if __name__ == '__main__':
    import argparse
    import sys

    def main():
        parser = argparse.ArgumentParser()
        parser.add_argument('-D', '--directory', metavar='DIR', default='.')
        args = parser.parse_args()
        data = read_data(args.directory)

        yave = {}
        all = []
        for dt, val in data:
            y = int(dt[:4])
            vl = yave.get(y, [])
            vl.append(val[1])
            all.append(val[1])
            yave[y] = vl

        ave = sum(all) / len(all) / 1000
        print(ave)

        def avediff(l):
            a = sum(l) / len(l) / 1000
            return [a, (a - ave) * 1000_000]

        table = [[k, avediff(v)] for k,v in sorted(yave.items())]
        for y, d in table:
            print(f'{y}, {d[0]}, {d[1]}')

    sys.exit(main())
実行結果
236.55538225411706
1960, 236.55437158469945, -1010.6694176101882
1961, 236.5545205479452, -861.7061718609875
1962, 236.55479452054794, -587.733569119564
1963, 236.55479452054794, -587.733569119564
1964, 236.5554644808743, 82.22675722890926
1965, 236.55561643835617, 234.18423910470665
1966, 236.55616438356165, 782.1294445875537
1967, 236.5558904109589, 508.1568418461302
1968, 236.55628415300546, 901.898888400865
1969, 236.55643835616436, 1056.1020473005556
1970, 236.55616438356165, 782.1294445875537
1971, 236.55616438356165, 782.1294445875537
1972, 236.55573770491802, 355.4508009528945
1973, 236.55561643835617, 234.18423910470665
1974, 236.55506849315069, -313.76096637814044
1975, 236.55479452054794, -587.733569119564
1976, 236.55464480874318, -737.445373886203
1977, 236.5545205479452, -861.7061718609875
1978, 236.5545205479452, -861.7061718609875
1979, 236.55424657534246, -1135.678774602411
1980, 236.55464480874318, -737.445373886203
1981, 236.55479452054794, -587.733569119564
1982, 236.55534246575343, -39.788363636716895
1983, 236.55534246575343, -39.788363636716895
1984, 236.55573770491802, 355.4508009528945
1985, 236.55643835616436, 1056.1020473005556
1986, 236.55616438356165, 782.1294445875537
1987, 236.55616438356165, 782.1294445875537
1988, 236.55628415300546, 901.898888400865
1989, 236.55616438356165, 782.1294445875537
1990, 236.55616438356165, 782.1294445875537
1991, 236.55561643835617, 234.18423910470665
1992, 236.5554644808743, 82.22675722890926
1993, 236.55506849315069, -313.76096637814044
1994, 236.5545205479452, -861.7061718609875
1995, 236.55479452054794, -587.733569119564
1996, 236.55437158469945, -1010.6694176101882
1997, 236.55424657534246, -1135.678774602411
1998, 236.5545205479452, -861.7061718609875
1999, 236.55479452054794, -587.733569119564
2000, 236.5549180327869, -464.2213301622178
2001, 236.55534246575343, -39.788363636716895
2002, 236.55561643835617, 234.18423910470665
2003, 236.5558904109589, 508.1568418461302
2004, 236.55601092896174, 628.6748446768797
2005, 236.55616438356165, 782.1294445875537
2006, 236.55643835616436, 1056.1020473005556
2007, 236.55616438356165, 782.1294445875537
2008, 236.55628415300546, 901.898888400865
2009, 236.5558904109589, 508.1568418461302
2010, 236.55534246575343, -39.788363636716895
2011, 236.55534246575343, -39.788363636716895
2012, 236.55519125683062, -190.99728643823255
2013, 236.5545205479452, -861.7061718609875
2014, 236.5545205479452, -861.7061718609875
2015, 236.55424657534246, -1135.678774602411
2016, 236.55464480874318, -737.445373886203
2017, 236.55424657534246, -1135.678774602411
2018, 236.55479452054794, -587.733569119564
2019, 236.55534246575343, -39.788363636716895
2020, 236.55519125683062, -190.99728643823255
2021, 236.5558904109589, 508.1568418461302
2022, 236.5558904109589, 508.1568418461302
2023, 236.55616438356165, 782.1294445875537
2024, 236.55628415300546, 901.898888400865
2025, 236.55643835616436, 1056.1020473005556

個人的には 236.55538225411706 が得られればよかったのですが、よく分からないものが出てきました…

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?