Skip to content

Commit

Permalink
Revise 04_LFP nb
Browse files Browse the repository at this point in the history
  • Loading branch information
CBroz1 committed Jul 28, 2023
1 parent b134470 commit 4d71854
Show file tree
Hide file tree
Showing 5 changed files with 418 additions and 672 deletions.
9 changes: 3 additions & 6 deletions franklab_scripts/nightly_cleanup.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,12 @@

import numpy as np

from spyglass.decoding.clusterless import (
MarkParameters,
UnitMarkParameters,
UnitMarks,
)
from spyglass.decoding.clusterless import MarkParameters, UnitMarkParameters, UnitMarks

warnings.simplefilter("ignore", category=DeprecationWarning)
warnings.simplefilter("ignore", category=ResourceWarning)
os.environ["SPIKE_SORTING_STORAGE_DIR"] = "/stelmo/nwb/spikesorting"
# NOTE: "SPIKE_SORTING_STORAGE_DIR" -> "SPYGLASS_SORTING_DIR"
os.environ["SPYGLASS_SORTING_DIR"] = "/stelmo/nwb/spikesorting"


# import tables so that we can call them easily
Expand Down
2 changes: 1 addition & 1 deletion franklab_scripts/sort.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ def main():

os.environ["SPYGLASS_BASE_DIR"] = str(data_dir)
os.environ["KACHERY_STORAGE_DIR"] = str(data_dir / "kachery-storage")
os.environ["SPIKE_SORTING_STORAGE_DIR"] = str(data_dir / "spikesorting")
os.environ["SPYGLASS_SORTING_DIR"] = str(data_dir / "spikesorting")

# session_id = 'jaq_01'
# nwb_file_name = (sg.common.Session() & {'session_id': session_id}).fetch1('nwb_file_name')
Expand Down
1,070 changes: 408 additions & 662 deletions notebooks/03_lfp.ipynb

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/spyglass/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
raw="raw",
analysis="analysis",
recording="recording",
spike_sorting_storage="spikesorting",
sorting="spikesorting", # "SPYGLASS_SORTING_DIR"
waveforms="waveforms",
temp="tmp",
),
Expand Down
7 changes: 5 additions & 2 deletions src/spyglass/spikesorting/spikesorting_sorting.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@

from ..common.common_lab import LabMember, LabTeam
from ..common.common_nwbfile import AnalysisNwbfile
from ..settings import load_config
from ..utils.dj_helper_fn import fetch_nwb
from .spikesorting_artifact import ArtifactRemovedIntervalList
from .spikesorting_recording import (
Expand Down Expand Up @@ -134,7 +135,7 @@ def make(self, key: dict):
(this is redundant with 2; will change in the future)
"""

# CBroz: does this not work w/o arg? as .populate() ?
recording_path = (SpikeSortingRecording & key).fetch1("recording_path")
recording = si.load_extractor(recording_path)

Expand Down Expand Up @@ -227,7 +228,9 @@ def make(self, key: dict):
key["time_of_sort"] = int(time.time())

print("Saving sorting results...")
sorting_folder = Path(os.getenv("SPYGLASS_SORTING_DIR"))

sorting_folder = Path(load_config().get("SPYGLASS_SORTING_DIR"))

sorting_name = self._get_sorting_name(key)
key["sorting_path"] = str(sorting_folder / Path(sorting_name))
if os.path.exists(key["sorting_path"]):
Expand Down

0 comments on commit 4d71854

Please sign in to comment.