speedandcurrent 2.3.4 → 2.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,219 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://github.com/meri-imperiumi/speedandcurrent/schema/correction-table.schema.json",
4
+ "title": "Speed and Current Correction Table",
5
+ "description": "Documentation of the current private correction-table format emitted by Table2D and CorrectionTable. Table identity is managed by the filename/plugin setting; the serialized id is retained for compatibility.",
6
+ "type": "object",
7
+ "additionalProperties": false,
8
+ "required": [
9
+ "id",
10
+ "row",
11
+ "col",
12
+ "parameters",
13
+ "table"
14
+ ,"displayAttributes"
15
+ ],
16
+ "properties": {
17
+ "id": {
18
+ "type": "string",
19
+ "minLength": 1
20
+ },
21
+ "row": {
22
+ "$ref": "#/$defs/axis",
23
+ "description": "Speed axis. The row index increases with speed."
24
+ },
25
+ "col": {
26
+ "$ref": "#/$defs/axis",
27
+ "description": "Heel axis. The column index increases from minimum to maximum heel."
28
+ },
29
+ "parameters": {
30
+ "$ref": "#/$defs/filterParameters",
31
+ "description": "Kalman filter model descriptor. `covariance` fields are never functions — they are either fixed matrices (legacy) or the literal marker \"per-observation\" (current), meaning the actual measurement-noise covariance is computed live in CorrectionEstimator.update() from sensor variances and is not persisted."
32
+ },
33
+ "table": {
34
+ "type": "array",
35
+ "minItems": 1,
36
+ "items": {
37
+ "type": "array",
38
+ "minItems": 1,
39
+ "items": {
40
+ "$ref": "#/$defs/cell"
41
+ }
42
+ },
43
+ "description": "Rows must contain one cell for each value on the row axis, and each row must contain one cell for each value on the column axis. Array dimensions are checked semantically because JSON Schema cannot calculate them from axis values."
44
+ },
45
+ "displayAttributes": {
46
+ "type": "object",
47
+ "additionalProperties": true
48
+ }
49
+ },
50
+ "$defs": {
51
+ "axis": {
52
+ "type": "object",
53
+ "additionalProperties": false,
54
+ "required": ["min", "max", "step"],
55
+ "properties": {
56
+ "min": {
57
+ "type": "number"
58
+ },
59
+ "max": {
60
+ "type": "number"
61
+ },
62
+ "step": {
63
+ "type": "number",
64
+ "exclusiveMinimum": 0
65
+ }
66
+ }
67
+ },
68
+ "filterParameters": {
69
+ "oneOf": [
70
+ { "$ref": "#/$defs/filterParametersV2" },
71
+ { "$ref": "#/$defs/filterParametersLegacy" }
72
+ ],
73
+ "description": "V2 (current) is written by all tables saved after per-observation covariance support was added. Legacy is what earlier versions of the plugin wrote; files in that format still load — the observation.covariance matrix they contain was never actually used for filtering and is ignored on load."
74
+ },
75
+ "filterParametersV2": {
76
+ "type": "object",
77
+ "additionalProperties": false,
78
+ "required": ["stability", "observation", "dynamic"],
79
+ "properties": {
80
+ "stability": {
81
+ "type": "number",
82
+ "description": "Determines the process-noise (Q) magnitude: 10^-stability."
83
+ },
84
+ "observation": { "$ref": "#/$defs/observationParametersV2" },
85
+ "dynamic": { "$ref": "#/$defs/dynamicParameters" }
86
+ }
87
+ },
88
+ "observationParametersV2": {
89
+ "type": "object",
90
+ "additionalProperties": false,
91
+ "required": ["stateProjection", "covariance", "dimension"],
92
+ "properties": {
93
+ "stateProjection": { "$ref": "#/$defs/matrix2" },
94
+ "covariance": {
95
+ "const": "per-observation",
96
+ "description": "Marker only. The measurement-noise covariance (R) is computed per observation from live sensor variances and supplied to the filter at runtime; it is not a persisted value."
97
+ },
98
+ "dimension": { "const": 2 }
99
+ }
100
+ },
101
+ "filterParametersLegacy": {
102
+ "type": "object",
103
+ "additionalProperties": false,
104
+ "required": ["observation", "dynamic"],
105
+ "properties": {
106
+ "observation": { "$ref": "#/$defs/observationParameters" },
107
+ "dynamic": { "$ref": "#/$defs/dynamicParameters" }
108
+ }
109
+ },
110
+ "observationParameters": {
111
+ "type": "object",
112
+ "additionalProperties": false,
113
+ "required": ["stateProjection", "covariance", "dimension"],
114
+ "properties": {
115
+ "stateProjection": { "$ref": "#/$defs/matrix2" },
116
+ "covariance": { "$ref": "#/$defs/matrix2" },
117
+ "dimension": { "const": 2 }
118
+ }
119
+ },
120
+ "dynamicParameters": {
121
+ "type": "object",
122
+ "additionalProperties": false,
123
+ "required": ["transition", "covariance"],
124
+ "properties": {
125
+ "transition": { "$ref": "#/$defs/matrix2" },
126
+ "covariance": { "$ref": "#/$defs/vector2" }
127
+ }
128
+ },
129
+ "matrix2": {
130
+ "type": "array",
131
+ "minItems": 2,
132
+ "maxItems": 2,
133
+ "prefixItems": [
134
+ { "$ref": "#/$defs/vector2" },
135
+ { "$ref": "#/$defs/vector2" }
136
+ ],
137
+ "items": false
138
+ },
139
+ "cell": {
140
+ "type": "object",
141
+ "additionalProperties": false,
142
+ "required": [
143
+ "state"
144
+ ],
145
+ "properties": {
146
+ "state": {
147
+ "oneOf": [
148
+ {
149
+ "type": "null"
150
+ },
151
+ {
152
+ "$ref": "#/$defs/filterState"
153
+ }
154
+ ]
155
+ }
156
+ }
157
+ },
158
+ "filterState": {
159
+ "type": "object",
160
+ "additionalProperties": false,
161
+ "required": [
162
+ "mean",
163
+ "covariance",
164
+ "index"
165
+ ],
166
+ "properties": {
167
+ "mean": {
168
+ "type": "array",
169
+ "minItems": 2,
170
+ "maxItems": 2,
171
+ "prefixItems": [
172
+ {
173
+ "$ref": "#/$defs/vector1"
174
+ },
175
+ {
176
+ "$ref": "#/$defs/vector1"
177
+ }
178
+ ],
179
+ "items": false,
180
+ "description": "Two-element column vector."
181
+ },
182
+ "covariance": {
183
+ "type": "array",
184
+ "minItems": 2,
185
+ "maxItems": 2,
186
+ "prefixItems": [
187
+ {
188
+ "$ref": "#/$defs/vector2"
189
+ },
190
+ {
191
+ "$ref": "#/$defs/vector2"
192
+ }
193
+ ],
194
+ "items": false
195
+ },
196
+ "index": {
197
+ "type": "integer",
198
+ "minimum": 0
199
+ }
200
+ }
201
+ },
202
+ "vector2": {
203
+ "type": "array",
204
+ "minItems": 2,
205
+ "maxItems": 2,
206
+ "items": {
207
+ "type": "number"
208
+ }
209
+ },
210
+ "vector1": {
211
+ "type": "array",
212
+ "minItems": 1,
213
+ "maxItems": 1,
214
+ "items": {
215
+ "type": "number"
216
+ }
217
+ }
218
+ }
219
+ }
@@ -0,0 +1,134 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://github.com/meri-imperiumi/speedandcurrent/schema/correction-table-v2.schema.json",
4
+ "title": "Speed and Current Correction Table v2",
5
+ "description": "Version 2 stores the last accepted update for every learned cell as UTC epoch milliseconds. Empty cells use null.",
6
+ "type": "object",
7
+ "additionalProperties": false,
8
+ "required": ["schemaVersion", "id", "row", "col", "parameters", "table", "displayAttributes"],
9
+ "properties": {
10
+ "schemaVersion": { "const": 2 },
11
+ "id": { "type": "string", "minLength": 1 },
12
+ "row": { "$ref": "#/$defs/axis" },
13
+ "col": { "$ref": "#/$defs/axis" },
14
+ "parameters": { "$ref": "#/$defs/parameters" },
15
+ "table": {
16
+ "type": "array",
17
+ "minItems": 1,
18
+ "items": { "type": "array", "minItems": 1, "items": { "$ref": "#/$defs/cell" } }
19
+ },
20
+ "displayAttributes": { "type": "object", "additionalProperties": true }
21
+ },
22
+ "$defs": {
23
+ "axis": {
24
+ "type": "object",
25
+ "additionalProperties": false,
26
+ "required": ["min", "max", "step"],
27
+ "properties": {
28
+ "min": { "type": "number" },
29
+ "max": { "type": "number" },
30
+ "step": { "type": "number", "exclusiveMinimum": 0 }
31
+ }
32
+ },
33
+ "parameters": {
34
+ "oneOf": [
35
+ { "$ref": "#/$defs/currentParameters" },
36
+ { "$ref": "#/$defs/legacyParameters" }
37
+ ]
38
+ },
39
+ "currentParameters": {
40
+ "type": "object",
41
+ "additionalProperties": false,
42
+ "required": ["processNoiseRate", "observation", "dynamic"],
43
+ "properties": {
44
+ "processNoiseRate": {
45
+ "type": "number",
46
+ "minimum": 0,
47
+ "description": "SI process-noise rate in (m/s)^2 per second. The UI expresses this as correction drift in knots per 30-day month."
48
+ },
49
+ "observation": {
50
+ "type": "object",
51
+ "additionalProperties": false,
52
+ "required": ["stateProjection", "covariance", "dimension"],
53
+ "properties": {
54
+ "stateProjection": { "$ref": "#/$defs/matrix2" },
55
+ "covariance": { "const": "per-observation" },
56
+ "dimension": { "const": 2 }
57
+ }
58
+ },
59
+ "dynamic": {
60
+ "type": "object",
61
+ "additionalProperties": false,
62
+ "required": ["transition", "covariance"],
63
+ "properties": {
64
+ "transition": { "$ref": "#/$defs/matrix2" },
65
+ "covariance": { "$ref": "#/$defs/vector2" }
66
+ }
67
+ }
68
+ }
69
+ },
70
+ "legacyParameters": {
71
+ "type": "object",
72
+ "additionalProperties": false,
73
+ "required": ["stability", "observation", "dynamic"],
74
+ "properties": {
75
+ "stability": { "type": "number" },
76
+ "observation": { "$ref": "#/$defs/legacyObservation" },
77
+ "dynamic": {
78
+ "type": "object",
79
+ "additionalProperties": false,
80
+ "required": ["transition", "covariance"],
81
+ "properties": {
82
+ "transition": { "$ref": "#/$defs/matrix2" },
83
+ "covariance": { "$ref": "#/$defs/vector2" }
84
+ }
85
+ }
86
+ }
87
+ },
88
+ "legacyObservation": {
89
+ "type": "object",
90
+ "additionalProperties": false,
91
+ "required": ["stateProjection", "covariance", "dimension"],
92
+ "properties": {
93
+ "stateProjection": { "$ref": "#/$defs/matrix2" },
94
+ "covariance": { "$ref": "#/$defs/matrix2" },
95
+ "dimension": { "const": 2 }
96
+ }
97
+ },
98
+ "cell": {
99
+ "type": "object",
100
+ "additionalProperties": false,
101
+ "required": ["state", "lastAcceptedAt"],
102
+ "properties": {
103
+ "state": {
104
+ "oneOf": [
105
+ { "type": "null" },
106
+ {
107
+ "type": "object",
108
+ "additionalProperties": false,
109
+ "required": ["mean", "covariance", "index"],
110
+ "properties": {
111
+ "mean": { "$ref": "#/$defs/mean" },
112
+ "covariance": { "$ref": "#/$defs/matrix2" },
113
+ "index": { "type": "integer", "minimum": 0 }
114
+ }
115
+ }
116
+ ]
117
+ },
118
+ "lastAcceptedAt": { "oneOf": [{ "type": "null" }, { "type": "integer", "minimum": 0 }] }
119
+ }
120
+ },
121
+ "matrix2": {
122
+ "type": "array", "minItems": 2, "maxItems": 2,
123
+ "prefixItems": [{ "$ref": "#/$defs/vector2" }, { "$ref": "#/$defs/vector2" }],
124
+ "items": false
125
+ },
126
+ "vector2": { "type": "array", "minItems": 2, "maxItems": 2, "items": { "type": "number" } },
127
+ "mean": {
128
+ "type": "array", "minItems": 2, "maxItems": 2,
129
+ "prefixItems": [{ "$ref": "#/$defs/vector1" }, { "$ref": "#/$defs/vector1" }],
130
+ "items": false
131
+ },
132
+ "vector1": { "type": "array", "minItems": 1, "maxItems": 1, "items": { "type": "number" } }
133
+ }
134
+ }
@@ -0,0 +1,219 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://github.com/meri-imperiumi/speedandcurrent/schema/correction-table.schema.json",
4
+ "title": "Speed and Current Correction Table",
5
+ "description": "Documentation of the current private correction-table format emitted by Table2D and CorrectionTable. Table identity is managed by the filename/plugin setting; the serialized id is retained for compatibility.",
6
+ "type": "object",
7
+ "additionalProperties": false,
8
+ "required": [
9
+ "id",
10
+ "row",
11
+ "col",
12
+ "parameters",
13
+ "table"
14
+ ,"displayAttributes"
15
+ ],
16
+ "properties": {
17
+ "id": {
18
+ "type": "string",
19
+ "minLength": 1
20
+ },
21
+ "row": {
22
+ "$ref": "#/$defs/axis",
23
+ "description": "Speed axis. The row index increases with speed."
24
+ },
25
+ "col": {
26
+ "$ref": "#/$defs/axis",
27
+ "description": "Heel axis. The column index increases from minimum to maximum heel."
28
+ },
29
+ "parameters": {
30
+ "$ref": "#/$defs/filterParameters",
31
+ "description": "Kalman filter model descriptor. `covariance` fields are never functions — they are either fixed matrices (legacy) or the literal marker \"per-observation\" (current), meaning the actual measurement-noise covariance is computed live in CorrectionEstimator.update() from sensor variances and is not persisted."
32
+ },
33
+ "table": {
34
+ "type": "array",
35
+ "minItems": 1,
36
+ "items": {
37
+ "type": "array",
38
+ "minItems": 1,
39
+ "items": {
40
+ "$ref": "#/$defs/cell"
41
+ }
42
+ },
43
+ "description": "Rows must contain one cell for each value on the row axis, and each row must contain one cell for each value on the column axis. Array dimensions are checked semantically because JSON Schema cannot calculate them from axis values."
44
+ },
45
+ "displayAttributes": {
46
+ "type": "object",
47
+ "additionalProperties": true
48
+ }
49
+ },
50
+ "$defs": {
51
+ "axis": {
52
+ "type": "object",
53
+ "additionalProperties": false,
54
+ "required": ["min", "max", "step"],
55
+ "properties": {
56
+ "min": {
57
+ "type": "number"
58
+ },
59
+ "max": {
60
+ "type": "number"
61
+ },
62
+ "step": {
63
+ "type": "number",
64
+ "exclusiveMinimum": 0
65
+ }
66
+ }
67
+ },
68
+ "filterParameters": {
69
+ "oneOf": [
70
+ { "$ref": "#/$defs/filterParametersV2" },
71
+ { "$ref": "#/$defs/filterParametersLegacy" }
72
+ ],
73
+ "description": "V2 (current) is written by all tables saved after per-observation covariance support was added. Legacy is what earlier versions of the plugin wrote; files in that format still load — the observation.covariance matrix they contain was never actually used for filtering and is ignored on load."
74
+ },
75
+ "filterParametersV2": {
76
+ "type": "object",
77
+ "additionalProperties": false,
78
+ "required": ["stability", "observation", "dynamic"],
79
+ "properties": {
80
+ "stability": {
81
+ "type": "number",
82
+ "description": "Determines the process-noise (Q) magnitude: 10^-stability."
83
+ },
84
+ "observation": { "$ref": "#/$defs/observationParametersV2" },
85
+ "dynamic": { "$ref": "#/$defs/dynamicParameters" }
86
+ }
87
+ },
88
+ "observationParametersV2": {
89
+ "type": "object",
90
+ "additionalProperties": false,
91
+ "required": ["stateProjection", "covariance", "dimension"],
92
+ "properties": {
93
+ "stateProjection": { "$ref": "#/$defs/matrix2" },
94
+ "covariance": {
95
+ "const": "per-observation",
96
+ "description": "Marker only. The measurement-noise covariance (R) is computed per observation from live sensor variances and supplied to the filter at runtime; it is not a persisted value."
97
+ },
98
+ "dimension": { "const": 2 }
99
+ }
100
+ },
101
+ "filterParametersLegacy": {
102
+ "type": "object",
103
+ "additionalProperties": false,
104
+ "required": ["observation", "dynamic"],
105
+ "properties": {
106
+ "observation": { "$ref": "#/$defs/observationParameters" },
107
+ "dynamic": { "$ref": "#/$defs/dynamicParameters" }
108
+ }
109
+ },
110
+ "observationParameters": {
111
+ "type": "object",
112
+ "additionalProperties": false,
113
+ "required": ["stateProjection", "covariance", "dimension"],
114
+ "properties": {
115
+ "stateProjection": { "$ref": "#/$defs/matrix2" },
116
+ "covariance": { "$ref": "#/$defs/matrix2" },
117
+ "dimension": { "const": 2 }
118
+ }
119
+ },
120
+ "dynamicParameters": {
121
+ "type": "object",
122
+ "additionalProperties": false,
123
+ "required": ["transition", "covariance"],
124
+ "properties": {
125
+ "transition": { "$ref": "#/$defs/matrix2" },
126
+ "covariance": { "$ref": "#/$defs/vector2" }
127
+ }
128
+ },
129
+ "matrix2": {
130
+ "type": "array",
131
+ "minItems": 2,
132
+ "maxItems": 2,
133
+ "prefixItems": [
134
+ { "$ref": "#/$defs/vector2" },
135
+ { "$ref": "#/$defs/vector2" }
136
+ ],
137
+ "items": false
138
+ },
139
+ "cell": {
140
+ "type": "object",
141
+ "additionalProperties": false,
142
+ "required": [
143
+ "state"
144
+ ],
145
+ "properties": {
146
+ "state": {
147
+ "oneOf": [
148
+ {
149
+ "type": "null"
150
+ },
151
+ {
152
+ "$ref": "#/$defs/filterState"
153
+ }
154
+ ]
155
+ }
156
+ }
157
+ },
158
+ "filterState": {
159
+ "type": "object",
160
+ "additionalProperties": false,
161
+ "required": [
162
+ "mean",
163
+ "covariance",
164
+ "index"
165
+ ],
166
+ "properties": {
167
+ "mean": {
168
+ "type": "array",
169
+ "minItems": 2,
170
+ "maxItems": 2,
171
+ "prefixItems": [
172
+ {
173
+ "$ref": "#/$defs/vector1"
174
+ },
175
+ {
176
+ "$ref": "#/$defs/vector1"
177
+ }
178
+ ],
179
+ "items": false,
180
+ "description": "Two-element column vector."
181
+ },
182
+ "covariance": {
183
+ "type": "array",
184
+ "minItems": 2,
185
+ "maxItems": 2,
186
+ "prefixItems": [
187
+ {
188
+ "$ref": "#/$defs/vector2"
189
+ },
190
+ {
191
+ "$ref": "#/$defs/vector2"
192
+ }
193
+ ],
194
+ "items": false
195
+ },
196
+ "index": {
197
+ "type": "integer",
198
+ "minimum": 0
199
+ }
200
+ }
201
+ },
202
+ "vector2": {
203
+ "type": "array",
204
+ "minItems": 2,
205
+ "maxItems": 2,
206
+ "items": {
207
+ "type": "number"
208
+ }
209
+ },
210
+ "vector1": {
211
+ "type": "array",
212
+ "minItems": 1,
213
+ "maxItems": 1,
214
+ "items": {
215
+ "type": "number"
216
+ }
217
+ }
218
+ }
219
+ }