edf2csv 0.2.12 → 0.2.13
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.
- package/CHANGELOG.md +17 -0
- package/dist/cli.js +2 -2
- package/dist/edf/scale.d.ts +1 -1
- package/dist/edf/scale.js +2 -2
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,23 @@
|
|
|
3
3
|
Notable changes to edf2csv. Versions follow [semantic versioning](https://semver.org); while the
|
|
4
4
|
major version is 0, a minor bump may contain breaking changes.
|
|
5
5
|
|
|
6
|
+
## 0.2.13
|
|
7
|
+
|
|
8
|
+
### Fixed: the precision ceiling collapsed distinct samples on the finest channels
|
|
9
|
+
|
|
10
|
+
Decimal places are derived per channel so that two adjacent digital codes never round to the same
|
|
11
|
+
text — that is the invariant the whole precision rule exists to hold. The ceiling was 15, which the
|
|
12
|
+
comment beside it justified by pointing at channels calibrated in volts and tesla.
|
|
13
|
+
|
|
14
|
+
Tesla was in fact fine. Femtotesla was not, which is the unit MEG is actually recorded in: a channel
|
|
15
|
+
spanning ±1e-12 T over a 16-bit converter has a step near 3e-17 and needs 19 places, so at 15 it
|
|
16
|
+
printed **96 of every 100 adjacent codes identically**. Distinct measurements became the same string,
|
|
17
|
+
silently — exactly the outcome the rule is meant to prevent.
|
|
18
|
+
|
|
19
|
+
The ceiling is now 20, and `--decimals` accepts 0–20 to match. Adjacent codes stay distinct from
|
|
20
|
+
microvolts down to attotesla. Ordinary channels are untouched: a µV EEG channel still derives 3
|
|
21
|
+
places and a volt-scale channel still derives 9.
|
|
22
|
+
|
|
6
23
|
## 0.2.12
|
|
7
24
|
|
|
8
25
|
### Fixed: annotation channels were never pluralised
|
package/dist/cli.js
CHANGED
|
@@ -289,8 +289,8 @@ function optionalDecimals(raw) {
|
|
|
289
289
|
throw new OptionError('--decimals needs a number, for example --decimals 3.');
|
|
290
290
|
}
|
|
291
291
|
const value = Number(text);
|
|
292
|
-
if (!Number.isInteger(value) || value < 0 || value >
|
|
293
|
-
throw new OptionError(`--decimals must be a whole number between 0 and
|
|
292
|
+
if (!Number.isInteger(value) || value < 0 || value > 20) {
|
|
293
|
+
throw new OptionError(`--decimals must be a whole number between 0 and 20, got "${String(raw)}".`);
|
|
294
294
|
}
|
|
295
295
|
return value;
|
|
296
296
|
}
|
package/dist/edf/scale.d.ts
CHANGED
|
@@ -37,7 +37,7 @@ export declare function quantizationStep(signal: EdfSignal): number;
|
|
|
37
37
|
* resolution the hardware actually recorded, without padding the file with digits
|
|
38
38
|
* that carry no information.
|
|
39
39
|
*
|
|
40
|
-
* The ceiling is
|
|
40
|
+
* The ceiling is 20 rather than a tidier number because a channel calibrated in
|
|
41
41
|
* volts rather than microvolts has a step near 1e-7, and one in tesla smaller
|
|
42
42
|
* still. A lower cap would round genuinely different samples to the same text. It
|
|
43
43
|
* costs nothing for ordinary channels, whose step lands them at three or four.
|
package/dist/edf/scale.js
CHANGED
|
@@ -67,12 +67,12 @@ export function quantizationStep(signal) {
|
|
|
67
67
|
* resolution the hardware actually recorded, without padding the file with digits
|
|
68
68
|
* that carry no information.
|
|
69
69
|
*
|
|
70
|
-
* The ceiling is
|
|
70
|
+
* The ceiling is 20 rather than a tidier number because a channel calibrated in
|
|
71
71
|
* volts rather than microvolts has a step near 1e-7, and one in tesla smaller
|
|
72
72
|
* still. A lower cap would round genuinely different samples to the same text. It
|
|
73
73
|
* costs nothing for ordinary channels, whose step lands them at three or four.
|
|
74
74
|
*/
|
|
75
|
-
export function decimalsForSignal(signal, max =
|
|
75
|
+
export function decimalsForSignal(signal, max = 20) {
|
|
76
76
|
const step = quantizationStep(signal);
|
|
77
77
|
if (!(step > 0) || !Number.isFinite(step))
|
|
78
78
|
return 3;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "edf2csv",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.13",
|
|
4
4
|
"description": "Convert EDF, EDF+ and BDF biosignal recordings (European Data Format) to CSV from the command line. Local, streaming, and never resamples or alters units.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"edf",
|