feat: initial project
This commit is contained in:
@@ -0,0 +1,37 @@
|
||||
set term qt
|
||||
set datafile separator " "
|
||||
set title "Subject 1066528 Sleep"
|
||||
|
||||
# Get the magnitude of the derivative-vector.
|
||||
# We need 3 sets of delta variables, hence we have 3 functions.
|
||||
# Return NaN for first point, otherwise delta y or (delta y)/(delta x)
|
||||
d1(y) = ($0 == 0) ? (y11 = y, NaN) : (y21 = y11, y11 = y, y11-y21)
|
||||
d2(y) = ($0 == 0) ? (y12 = y, NaN) : (y22 = y12, y12 = y, y12-y22)
|
||||
d3(y) = ($0 == 0) ? (y13 = y, NaN) : (y23 = y13, y13 = y, y13-y23)
|
||||
mag(x,y,z) = sqrt((x**2) + (y**2) + (z**2))
|
||||
scale = 1 # 1024 # bma425's default scaling is 1024 (+1g to -1g).
|
||||
dmag(x,y,z) = mag( \
|
||||
abs(d1(x)/scale), \
|
||||
abs(d2(y)/scale), \
|
||||
abs(d3(z)/scale) \
|
||||
)
|
||||
|
||||
|
||||
set multiplot
|
||||
|
||||
set yrange [-0.1:2 < * < 10] extend
|
||||
set xrange [-1000:30000] extend
|
||||
unset ytics
|
||||
plot "data/1066528_acceleration.txt" using 1:(dmag($2,$3,$4)) w l t "Motion" lw 1 lc "gray"
|
||||
|
||||
unset title
|
||||
unset xtics
|
||||
unset border
|
||||
|
||||
set yrange [-2:8]
|
||||
set ytics ("Wake" 0, "N1" 1, "N2" 2, "N3" 3, "REM" 5)
|
||||
plot "data/1066528_labeled_sleep.txt" using 1:2 w l t "Sleep" lw 3 lc "blue"
|
||||
|
||||
set y2range [0:200]
|
||||
set datafile separator ","
|
||||
plot "data/1066528_heartrate.txt" using 1:2 w l axes x1y2 t "HR" lc "red"
|
||||
+4
-2
@@ -7,10 +7,12 @@ authors = [
|
||||
{ name = "Asger Gitz-Johansen", email = "asger.gitz@hotmail.com" }
|
||||
]
|
||||
requires-python = ">=3.12"
|
||||
dependencies = []
|
||||
dependencies = [
|
||||
"torch"
|
||||
]
|
||||
|
||||
[project.scripts]
|
||||
sleep-detection = "sleep_detection:main"
|
||||
sleep-detection = "sleep_detection.main:main"
|
||||
|
||||
[build-system]
|
||||
requires = ["uv_build>=0.12.0,<0.13.0"]
|
||||
|
||||
@@ -1,2 +1 @@
|
||||
def main() -> None:
|
||||
print("Hello from sleep-detection!")
|
||||
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
"""Main entrypoint."""
|
||||
|
||||
from sleep_detection.main import main
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
@@ -0,0 +1,6 @@
|
||||
"""Main Entrypoint codebase."""
|
||||
|
||||
|
||||
def main():
|
||||
"""The Main entrypoint function."""
|
||||
print("Hello from sleep-detection!")
|
||||
Reference in New Issue
Block a user