lunapi 0.1.2__cp39-cp39-musllinux_1_1_x86_64.whl → 1.2.1__cp39-cp39-musllinux_1_1_x86_64.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- lunapi/lunapi0.cpython-39-x86_64-linux-gnu.so +0 -0
- lunapi/lunapi1.py +45 -46
- {lunapi-0.1.2.dist-info → lunapi-1.2.1.dist-info}/METADATA +2 -1
- lunapi-1.2.1.dist-info/RECORD +10 -0
- lunapi-0.1.2.dist-info/RECORD +0 -10
- {lunapi-0.1.2.dist-info → lunapi-1.2.1.dist-info}/WHEEL +0 -0
- {lunapi-0.1.2.dist-info → lunapi-1.2.1.dist-info}/licenses/LICENSE +0 -0
Binary file
|
lunapi/lunapi1.py
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
"""lunapi1 module: a high-level wrapper around lunapi0 module functions"""
|
2
2
|
|
3
3
|
# Luna Python interface (lunapi)
|
4
|
-
#
|
4
|
+
# v1.2.1, 03-Jan-2025
|
5
5
|
|
6
6
|
import lunapi.lunapi0 as _luna
|
7
7
|
|
@@ -33,7 +33,7 @@ class resources:
|
|
33
33
|
POPS_LIB = 's2'
|
34
34
|
MODEL_PATH = '/build/luna-models/'
|
35
35
|
|
36
|
-
lp_version = "
|
36
|
+
lp_version = "v1.2.1"
|
37
37
|
|
38
38
|
# C++ singleton class (engine & sample list)
|
39
39
|
# lunapi_t --> luna
|
@@ -842,40 +842,6 @@ class inst:
|
|
842
842
|
#df = df.drop(columns = ['ID','TP','MID','INTERVAL'] )
|
843
843
|
return df
|
844
844
|
|
845
|
-
# --------------------------------------------------------------------------------
|
846
|
-
def psd( self, ch, var = 'PSD' , minf = None, maxf = 25, minp = None, maxp = None , xlines = None , ylines = None ):
|
847
|
-
"""Generates a PSD plot (from PSD or MTM)"""
|
848
|
-
if ch is None: return
|
849
|
-
if type(ch) is not list: ch = [ ch ]
|
850
|
-
|
851
|
-
if var == 'PSD':
|
852
|
-
self.eval( 'PSD spectrum dB max=' + str(maxf) + ' sig=' + ','.join(ch) )
|
853
|
-
df = self.table( 'PSD' , 'CH_F' )
|
854
|
-
else:
|
855
|
-
self.eval( 'MTM tw=15 dB max=' + str(maxf) + ' sig=' + ','.join(ch) )
|
856
|
-
df = self.table( 'MTM' , 'CH_F' )
|
857
|
-
|
858
|
-
psd( df = df , ch = ch , var = var ,
|
859
|
-
minf = minf , maxf = maxf , minp = minp , maxp = maxp ,
|
860
|
-
xlines = xlines , ylines = ylines )
|
861
|
-
|
862
|
-
|
863
|
-
# --------------------------------------------------------------------------------
|
864
|
-
def spec( self, ch, var = 'PSD' , mine = None, maxe = None, minf = None, maxf = 25 , w = 0.025 ):
|
865
|
-
"""Generates an epoch-level PSD spectrogram (from PSD or MTM)"""
|
866
|
-
if ch is None: return
|
867
|
-
if type(ch) is not list: ch = [ ch ]
|
868
|
-
|
869
|
-
if var == 'PSD':
|
870
|
-
self.eval( 'PSD epoch-spectrum dB max=' + str(maxf) + ' sig=' + ','.join(ch) )
|
871
|
-
df = self.table( 'PSD' , 'CH_E_F' )
|
872
|
-
else:
|
873
|
-
self.eval( 'MTM epoch-spectra epoch epoch-output dB tw=15 max=' + str(maxf) + ' sig=' + ','.join(ch) )
|
874
|
-
df = self.table( 'MTM' , 'CH_E_F' )
|
875
|
-
|
876
|
-
spec( df = df , ch = None , var = var ,
|
877
|
-
mine = mine , maxe = maxe , minf = minf , maxf = maxf , w = w )
|
878
|
-
|
879
845
|
|
880
846
|
# --------------------------------------------------------------------------------
|
881
847
|
# tfview : spectral regional viewer
|
@@ -1163,7 +1129,49 @@ class inst:
|
|
1163
1129
|
if type(ch) is not list: ch = [ ch ]
|
1164
1130
|
return self.edf.has_channels( ch )
|
1165
1131
|
|
1166
|
-
# --------------------------------------------------------------------------------
|
1132
|
+
# --------------------------------------------------------------------------------
|
1133
|
+
# def psd(self, ch, minf = None, maxf = 25, minp = None, maxp = None , xlines = None , ylines = None ):
|
1134
|
+
# """Spectrogram plot for a given channel 'ch'"""
|
1135
|
+
# if type( ch ) is not str: return
|
1136
|
+
# if all( self.has( ch ) ) is not True: return
|
1137
|
+
# res = self.silent_proc( 'PSD spectrum dB max=' + str(maxf) + ' sig=' + ','.join(ch) )[ 'PSD: CH_F' ]
|
1138
|
+
# return psd( res , ch, minf = minf, maxf = maxf, minp = minp, maxp = maxp , xlines = xlines , ylines = ylines )
|
1139
|
+
|
1140
|
+
# --------------------------------------------------------------------------------
|
1141
|
+
def psd( self, ch, var = 'PSD' , minf = None, maxf = 25, minp = None, maxp = None , xlines = None , ylines = None ):
|
1142
|
+
"""Generates a PSD plot (from PSD or MTM) for one or more channel(s)"""
|
1143
|
+
if ch is None: return
|
1144
|
+
if type(ch) is not list: ch = [ ch ]
|
1145
|
+
|
1146
|
+
if var == 'PSD':
|
1147
|
+
res = self.silent_proc( 'PSD spectrum dB max=' + str(maxf) + ' sig=' + ','.join(ch) )
|
1148
|
+
df = res[ 'PSD: CH_F' ]
|
1149
|
+
else:
|
1150
|
+
res = self.silent_proc( 'MTM tw=15 dB max=' + str(maxf) + ' sig=' + ','.join(ch) )
|
1151
|
+
df = res[ 'MTM: CH_F' ]
|
1152
|
+
|
1153
|
+
psd( df = df , ch = ch , var = var ,
|
1154
|
+
minf = minf , maxf = maxf , minp = minp , maxp = maxp ,
|
1155
|
+
xlines = xlines , ylines = ylines )
|
1156
|
+
|
1157
|
+
|
1158
|
+
# --------------------------------------------------------------------------------
|
1159
|
+
# def spec( self, ch, var = 'PSD' , mine = None, maxe = None, minf = None, maxf = 25 , w = 0.025 ):
|
1160
|
+
# """Generates an epoch-level PSD spectrogram (from PSD or MTM)"""
|
1161
|
+
# if ch is None: return
|
1162
|
+
# if type(ch) is not list: ch = [ ch ]
|
1163
|
+
#
|
1164
|
+
# if var == 'PSD':
|
1165
|
+
# self.eval( 'PSD epoch-spectrum dB max=' + str(maxf) + ' sig=' + ','.join(ch) )
|
1166
|
+
# df = self.table( 'PSD' , 'CH_E_F' )
|
1167
|
+
# else:
|
1168
|
+
# self.eval( 'MTM epoch-spectra epoch epoch-output dB tw=15 max=' + str(maxf) + ' sig=' + ','.join(ch) )
|
1169
|
+
# df = self.table( 'MTM' , 'CH_E_F' )
|
1170
|
+
#
|
1171
|
+
# spec( df = df , ch = None , var = var ,
|
1172
|
+
# mine = mine , maxe = maxe , minf = minf , maxf = maxf , w = w )
|
1173
|
+
|
1174
|
+
# --------------------------------------------------------------------------------
|
1167
1175
|
def spec(self,ch,mine = None , maxe = None , minf = None, maxf = None, w = 0.025 ):
|
1168
1176
|
"""PSD given channel 'ch'"""
|
1169
1177
|
if type( ch ) is not str:
|
@@ -1173,15 +1181,6 @@ class inst:
|
|
1173
1181
|
res = self.silent_proc( "PSD epoch-spectrum dB sig="+ch )[ 'PSD: CH_E_F' ]
|
1174
1182
|
return spec( res , ch=ch, var='PSD', mine=mine,maxe=maxe,minf=minf,maxf=maxf,w=w)
|
1175
1183
|
|
1176
|
-
# --------------------------------------------------------------------------------
|
1177
|
-
def psd(self, ch, minf = None, maxf = 25, minp = None, maxp = None , xlines = None , ylines = None ):
|
1178
|
-
"""Spectrogram plot for a given channel 'ch'"""
|
1179
|
-
if type( ch ) is not str:
|
1180
|
-
return
|
1181
|
-
if all( self.has( ch ) ) is not True:
|
1182
|
-
return
|
1183
|
-
res = self.silent_proc( 'PSD spectrum dB max=' + str(maxf) + ' sig=' + ','.join(ch) )[ 'PSD: CH_F' ]
|
1184
|
-
return psd( res , ch, minf = minf, maxf = maxf, minp = minp, maxp = maxp , xlines = xlines , ylines = ylines )
|
1185
1184
|
|
1186
1185
|
|
1187
1186
|
# --------------------------------------------------------------------------------
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: lunapi
|
3
|
-
Version:
|
3
|
+
Version: 1.2.1
|
4
4
|
Summary: Python interface to the Luna toolset for sleep signal analysis
|
5
5
|
Keywords: Sleep,EEG,PSG,Luna,Signal processing
|
6
6
|
Author-Email: Shaun Purcell <smpurcell@bwh.harvard.edu>, Senthil Palanivelu <spalanivelu@mgh.harvard.edu>, Nataliia Kozhemiako <nkozhemiako@bwh.harvard.edu>
|
@@ -28,6 +28,7 @@ Requires-Dist: plotly<6,>=5
|
|
28
28
|
Requires-Dist: nbformat<6,>=5
|
29
29
|
Requires-Dist: ipywidgets<9,>=8
|
30
30
|
Requires-Dist: tqdm<5,>=4
|
31
|
+
Requires-Dist: requests<3,>=2
|
31
32
|
Requires-Dist: IPython
|
32
33
|
Description-Content-Type: text/markdown
|
33
34
|
|
@@ -0,0 +1,10 @@
|
|
1
|
+
lunapi.libs/libgcc_s-a04fdf82.so.1,sha256=YxqJNaesQMhDswHEQpXsiLnVvMBBbYO6KYMDZFPWKSM,81257
|
2
|
+
lunapi.libs/libstdc++-a9383cce.so.6.0.28,sha256=Wy9UCdwS1rwI9GU5e7qE61S0AkRqqwti1q_adWSs-Rk,2447393
|
3
|
+
lunapi-1.2.1.dist-info/RECORD,,
|
4
|
+
lunapi-1.2.1.dist-info/METADATA,sha256=kQ3-SdHdIbgO1Q1ezIdqswJQE71NUuOdYhZ1iggYKPw,1519
|
5
|
+
lunapi-1.2.1.dist-info/WHEEL,sha256=5BWtd_OF8K8_rJFbU-bNy_28TyQEKd6sBkjNtrj0-Nw,115
|
6
|
+
lunapi-1.2.1.dist-info/licenses/LICENSE,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
|
7
|
+
lunapi/lunapi0.cpp,sha256=nQ5cwNdm4fvZ5TSDSxrgWu8Luw1r6NyDsvDWu9sLv7I,13053
|
8
|
+
lunapi/lunapi1.py,sha256=phnWVTJ1vbCsNk96Sfz4qk-hHmFqng5zCaxuFDL-M90,92343
|
9
|
+
lunapi/lunapi0.cpython-39-x86_64-linux-gnu.so,sha256=a9ZvfXMU-HNXNqlKf8UQQNRLe1grUOtaaLLKZ4NW32M,26373393
|
10
|
+
lunapi/__init__.py,sha256=cDep9d2N4KKUt81AzHUyFsuRdGwxCD1rqqFmptsAqsk,352
|
lunapi-0.1.2.dist-info/RECORD
DELETED
@@ -1,10 +0,0 @@
|
|
1
|
-
lunapi.libs/libgcc_s-a04fdf82.so.1,sha256=YxqJNaesQMhDswHEQpXsiLnVvMBBbYO6KYMDZFPWKSM,81257
|
2
|
-
lunapi.libs/libstdc++-a9383cce.so.6.0.28,sha256=Wy9UCdwS1rwI9GU5e7qE61S0AkRqqwti1q_adWSs-Rk,2447393
|
3
|
-
lunapi-0.1.2.dist-info/RECORD,,
|
4
|
-
lunapi-0.1.2.dist-info/METADATA,sha256=4UDU9iWO816l1GO-_UmLTWQt3x-bbaEN9Lttdkls9Ic,1489
|
5
|
-
lunapi-0.1.2.dist-info/WHEEL,sha256=5BWtd_OF8K8_rJFbU-bNy_28TyQEKd6sBkjNtrj0-Nw,115
|
6
|
-
lunapi-0.1.2.dist-info/licenses/LICENSE,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
|
7
|
-
lunapi/lunapi0.cpp,sha256=nQ5cwNdm4fvZ5TSDSxrgWu8Luw1r6NyDsvDWu9sLv7I,13053
|
8
|
-
lunapi/lunapi1.py,sha256=J1Bzz8Hz_6ybgfBcbhtQMAWSuJrYZ7aI4lGEPyP1zao,92373
|
9
|
-
lunapi/lunapi0.cpython-39-x86_64-linux-gnu.so,sha256=j8t0Wj3dge06dt6LsKUwJQfkZMMUnqOfcdx3D6G6sFE,26310569
|
10
|
-
lunapi/__init__.py,sha256=cDep9d2N4KKUt81AzHUyFsuRdGwxCD1rqqFmptsAqsk,352
|
File without changes
|
File without changes
|