This repository has been archived by the owner on Jul 30, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
41 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
# test script | ||
# will upload data as datalad directory later | ||
|
||
from BonsaiRecordingExtractor import BonsaiRecordingExtractor | ||
from BonsaiNwbConverter import * | ||
import json | ||
|
||
import pynwb | ||
from pynwb import NWBHDF5IO | ||
from pynwb import NWBFile | ||
from pynwb.ecephys import ElectricalSeries | ||
from pynwb.ecephys import ElectrodeGroup | ||
from pprint import pprint | ||
from pandas import read_csv | ||
|
||
|
||
# BonsaiRecordingExtractor inputs | ||
params = { | ||
"bonsai_dir": "data/jv_main", | ||
"metadata_file": "aquisition_oni.bonsai", | ||
"traces_file": "intan_2019-12-05T09_28_34.raw", | ||
"time": "intan-first-time_2019-12-05T09_28_34.csv", | ||
} | ||
|
||
|
||
RX = BonsaiRecordingExtractor(**params) | ||
md = RX.metadata | ||
|
||
# saves auto generated metadata, needs editing to generate NWB file | ||
with open('metadata_original.json', 'w') as outfile: | ||
json.dump(md, outfile, indent=4, sort_keys=True) | ||
|
||
# read edited metadata | ||
with open('metadata_edited.json', 'r') as infile: | ||
edited_md = json.load(infile) | ||
|
||
# use edited metadata to generate NWB | ||
edited_RX = RX | ||
edited_RX.metadata = edited_md | ||
create_nwb(edited_RX, 'bonsai.nwb') | ||
|