Skip to content

Commit e72fbc0

Browse files
committed
docs: improve README with optional parameters and fix examples
- Fixed ResampleRate value in example output (100.0 -> 50) to match usage - Added new "Optional parameters" section demonstrating: - Time filtering (start_time, end_time, skipdays, cutdays) - start_first_complete_minute parameter for minute alignment - kwargs support for calibrate_gravity and flag_nonwear - Fixed P.resample() example to use explicit sample rate value
1 parent 140c25f commit e72fbc0

1 file changed

Lines changed: 23 additions & 2 deletions

File tree

README.md

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ info [dict]
7373
NumTicks : 51391800
7474
WearTime(days) : 5.847725231481482
7575
NumInterrupts : 1
76-
ResampleRate : 100.0
76+
ResampleRate : 50
7777
NumTicksAfterResample : 25262174
7878
LowpassOK : 1
7979
LowpassCutoff(Hz) : 20.0
@@ -87,6 +87,27 @@ info [dict]
8787
```
8888
Refer to the [Glossary](GLOSSARY.md) for a comprehensive list of outputs.
8989

90+
### Optional parameters
91+
92+
You can also specify time ranges and additional options:
93+
94+
```python
95+
data, info = actipy.read_device(
96+
"sample.cwa.gz",
97+
lowpass_hz=20,
98+
calibrate_gravity=True,
99+
detect_nonwear=True,
100+
resample_hz=50,
101+
start_time="2014-05-07 18:00:00", # Start time (ISO format)
102+
end_time="2014-05-09 18:00:00", # End time (ISO format)
103+
skipdays=1, # Skip first day
104+
cutdays=2, # Cut last 2 days
105+
start_first_complete_minute=True, # Align to minute boundaries
106+
calibrate_gravity_kwargs={'stdtol_min': 0.01}, # Custom calibration params
107+
flag_nonwear_kwargs={'patience': '60m'} # Custom nonwear params
108+
)
109+
```
110+
90111
### Processing a custom CSV file
91112
You can also use the routines in `actipy.processing` to process custom CSV files, or for more fine-grained control:
92113

@@ -96,7 +117,7 @@ import actipy.processing as P
96117
data, info_lowpass = P.lowpass(data, 100, 20)
97118
data, info_calib = P.calibrate_gravity(data)
98119
data, info_nonwear = P.flag_nonwear(data)
99-
data, info_resample = P.resample(data, sample_rate)
120+
data, info_resample = P.resample(data, 50)
100121
```
101122

102123
See the [documentation](https://actipy.readthedocs.io/en/latest/) for more.

0 commit comments

Comments
 (0)