.mtn error
jeffpagaduan opened this issue · comments
Hello Gregory,
I'm trying to open a .mtn file using the code:
import pyActigraphy
import matplotlib.pyplot as plt
read in .mtn file
act = pyActigraphy.read_mtn('C://Users//Jeffrey Pagaduan//Downloads//FTRAW.mtn')
plot actigraphy data
fig, ax = plt.subplots()
ax.plot(act['Time'], act['Activity'])
ax.set(xlabel='Time', ylabel='Activity', title='Actigraphy Data')
plt.show()
compute sleep parameters
sleep_params = pyActigraphy.get_sleep_params(act, interval=30, window=5)
print sleep parameters
print(sleep_params)
But I get this error:
Traceback (most recent call last):
File "C:\Users\Jeffrey Pagaduan\Downloads\mtn.py", line 5, in
act = pyActigraphy.read_mtn('C://Users//Jeffrey Pagaduan//Downloads//FTRAW.mtn')
AttributeError: module 'pyActigraphy' has no attribute 'read_mtn'
Thanks for the help.
Hello @jeffpagaduan
like the error message states, there is no such "read_mtn" function in pyActigraphy.
It is "read_raw_mtn". Please have a look at the online documentation (both the API, where the functions are listed, and the tutorials: https://ghammad.github.io/pyActigraphy/index.html
The rest of the code makes me think that you might be confused with another package because commands like:
act['Time']
or pyActigraphy.get_sleep_params
do not exist in pyActigraphy.
I am pretty sure that the tutorials will be helpful in this case.
Let me know if you face other issues.
Cheers,
Greg
@ghammad Thank you very much for this! It's working now.
Closing now. Feel free to reopen this issue if needed.