Skip to content

Commit

Permalink
pass settings to pynm backend, enable return spectrum
Browse files Browse the repository at this point in the history
  • Loading branch information
timonmerk committed Nov 8, 2024
1 parent 6a8683b commit 39fb89a
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 127 deletions.
4 changes: 2 additions & 2 deletions py_neuromodulation/default_settings.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ fft_settings:
median: false
std: false
max: false
return_spectrum: false
return_spectrum: true

welch_settings:
windowlength_ms: 1000
Expand All @@ -101,7 +101,7 @@ welch_settings:
median: false
std: false
max: false
return_spectrum: false
return_spectrum: true

stft_settings:
windowlength_ms: 500
Expand Down
2 changes: 1 addition & 1 deletion py_neuromodulation/features/oscillatory.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class OscillatorySettings(NMBaseModel):
features: OscillatoryFeatures = OscillatoryFeatures(
mean=True, median=False, std=False, max=False
)
return_spectrum: bool = False
return_spectrum: bool = True


ESTIMATOR_DICT = {
Expand Down
15 changes: 9 additions & 6 deletions py_neuromodulation/gui/backend/app_pynm.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ async def start_run_function(

self.logger.info("setup stream Process")

self.stream.settings = self.settings

asyncio.create_task(self.stream.run(
out_dir=out_dir,
experiment_name=experiment_name,
Expand Down Expand Up @@ -93,9 +95,10 @@ def setup_lsl_stream(
line_noise=line_noise,
channels=channels,
sampling_rate_features_hz=sampling_rate_features,
settings=self.settings,
)
self.logger.info("stream setup")
self.settings: NMSettings = NMSettings(sampling_rate_features=sfreq)
#self.settings: NMSettings = NMSettings(sampling_rate_features=sfreq)
self.logger.info("settings setup")
break

Expand All @@ -120,12 +123,12 @@ def setup_offline_stream(
target_keywords=None,
)

self.settings: NMSettings = NMSettings(
sampling_rate_features=sampling_rate_features
)

self.settings.preprocessing = []
# self.settings: NMSettings = NMSettings(
# sampling_rate_features=sampling_rate_features
# )

# self.settings.preprocessing = []
self.logger.info(f"settings: {self.settings}")
self.stream: Stream = Stream(
settings=self.settings,
sfreq=sfreq,
Expand Down
112 changes: 0 additions & 112 deletions sub_SETTINGS.yaml

This file was deleted.

6 changes: 0 additions & 6 deletions sub_SIDECAR.json

This file was deleted.

0 comments on commit 39fb89a

Please sign in to comment.