Skip to content

Commit 5f8ab5a

Browse files
author
“Aidan
committed
Update documentation
1 parent 43230f4 commit 5f8ab5a

File tree

3 files changed

+20
-20
lines changed

3 files changed

+20
-20
lines changed

README.md

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -97,21 +97,6 @@ Missing values in the time-series are imputed with the mean of the same timepoin
9797
For adjusted totals and daily statistics, 24h multiples are needed and will be imputed if necessary.
9898
Estimates will be NaN where data is still missing after imputation.
9999

100-
### Processing CSV files
101-
102-
If a CSV file is provided, it must have the following header: `time`, `x`, `y`, `z`.
103-
104-
Example:
105-
106-
```console
107-
time,x,y,z
108-
2013-10-21 10:00:08.000,-0.078923,0.396706,0.917759
109-
2013-10-21 10:00:08.010,-0.094370,0.381479,0.933580
110-
2013-10-21 10:00:08.020,-0.094370,0.366252,0.901938
111-
2013-10-21 10:00:08.030,-0.078923,0.411933,0.901938
112-
...
113-
```
114-
115100
### Processing multiple files
116101

117102
#### Windows

docs/source/usage.rst

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ Processing a CSV file
3939
4040
$ actinet data/sample.csv.gz
4141
42-
The CSV file must have at least four columns, named "time", "x", "y" and "z".
42+
The CSV file must have at least four columns, expected to be named "time", "x", "y" and "z".
4343
The "time" column should contain the date and time of each measurement as a string.
4444
The "x", "y" and "z" columns should contain the numeric tri-axial acceleration values.
4545
A template can be downloaded as follows:
@@ -54,9 +54,24 @@ A template can be downloaded as follows:
5454
2014-05-07 13:29:50.439+0100 [Europe/London],-0.514,0.07,1.671
5555
2014-05-07 13:29:50.449+0100 [Europe/London],-0.089,-0.805,-0.59
5656
57-
If your CSV is in a different format, you should first convert it to this format,
58-
before using the tool.
57+
If the CSV file has a different header, use the option --txyz to specify the time and x-y-z columns, in that order.
58+
The --csvStartRow option can be used to specify the first row of data in the CSV file, starting from the header row.
5959

60+
For example:
61+
.. code-block:: console
62+
SAMPLE CSV FILE
63+
64+
HEADER_TIMESTAMP,temperature,X,Y,Z
65+
2013-10-21 10:00:08.000,26.3,-0.078923,0.396706,0.917759
66+
2013-10-21 10:00:08.010,26.2,-0.094370,0.381479,0.933580
67+
2013-10-21 10:00:08.020,26.2,-0.094370,0.366252,0.901938
68+
2013-10-21 10:00:08.030,26.2,-0.078923,0.411933,0.901938
69+
...
70+
71+
Then run the command as follows:
72+
.. code-block:: console
73+
74+
$ actinet data/sample.csv.gz --txyz HEADER_TIMESTAMP,X,Y,Z --csvStartRow 3
6075
6176
Other accelerometer file formats
6277
--------------------------------

src/actinet/actinet.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ def main():
8282
"--csvStartRow",
8383
help="Row number to start reading a CSV file. Default: 0",
8484
type=int,
85-
default=0,
85+
default=1,
8686
)
8787
parser.add_argument("--txyz",
8888
help=("Use this option to specify the column names for time, x, y, z "
@@ -142,7 +142,7 @@ def main():
142142
data, info_read = read(
143143
args.filepath,
144144
args.txyz,
145-
args.csvStartRow -1, # -1 to convert to zero-based index
145+
args.csvStartRow-1, # -1 to convert to zero-based index
146146
resample_hz=None,
147147
sample_rate=args.sample_rate,
148148
verbose=verbose,

0 commit comments

Comments
 (0)