-
Notifications
You must be signed in to change notification settings - Fork 25
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
L5 and M10 Sampling frequency #90
Comments
Hello @ChronoKatie Indeed, that is a common and annoying issue when dealing with large datasets acquired over several months/years. However, you can still read all the files by batch and do a loop, as illustrated in this part of the 'batch' tutorial. When answering to the issue #84 , in addition to the L5/M10 start times, I also provided a way to calculate the L5/M10 with resampled data. import pyActigraphy
import os
# Define path to test files (to be changed, of course)
fpath = os.path.join(os.path.dirname(pyActigraphy.__file__),'tests/data/')
# Read test files:
raw = pyActigraphy.io.read_raw(fpath+'example_0*.AWD', reader_type='AWD')
# Define dictionary for storing L5/M10 values with filenames as keys:
l5_ts = {}
l5 = {}
m10_ts = {}
m10 = {}
# Now loop over all the test files that have been read:
for iread in raw.readers:
# Resample data to a 5-min period
rs_data = iread.resampled_data('5min')
# Compute L5/M10
l5_ts[iread.name], l5[iread.name] = _lmx(rs_data, '5h', lowest=True)
m10_ts[iread.name], m10[iread.name] = _lmx(rs_data, '10h', lowest=False) By resampling all your data to a higher period (or equal to) than the highest acquisition period (for example, 5 min if you have actigraphy recording with 30s and 1min sampling period), you ensure that the L5/M10 calculations across recordings have been harmonised. Here I just took 5 min as an example. To be adapted to fit your analysis purposes. Hope that helps. Happy actigraphy. Greg |
Amazing! Thank you for your swift response and making my PhD a whole lot easier with this package 😄 |
Hi!
I just wondered if it was possible to alter the data acquisition period when calculating L5 and M10? Due to some actigraph initialisation issues, the sampling frequencies are inconsistent across the files. I.e for some files the epoch lengths are shorter than the others. This seems possible for some of the other non-parametric analyses through setting the sampling frequency. This might be best to achieve by setting a specific sampling frequency when reading files in by batch? Please advise.
Thanks,
Katie
The text was updated successfully, but these errors were encountered: