|
@@ -3,8 +3,8 @@ import re
|
|
|
import pandas as pd
|
|
|
|
|
|
import tools.pyrelacs as pr
|
|
|
-from tools.helper import stimulation_metadata_raw
|
|
|
-
|
|
|
+from tools.definitions import METADATA_FOLDER, RECORDINGS_FOLDER, OUTPUT_FOLDER, HELPER_TABLE_FOLDER, \
|
|
|
+ STIMULATION_METADATA_RAW
|
|
|
|
|
|
def extract_value_unit(value_unit_string):
|
|
|
value_unit_pattern = re.compile('(\d+[e][+]\d*|[-+]?\d*\.\d+|\d+)\s*(\w+)')
|
|
@@ -18,7 +18,7 @@ def convert_to_sec(time_value, time_unit):
|
|
|
return time_value
|
|
|
|
|
|
|
|
|
-overview_of_recordings = "metadata/cells.csv"
|
|
|
+overview_of_recordings = METADATA_FOLDER+"cells.csv"
|
|
|
test_protocol_for_pa = "SingleStimulus"
|
|
|
|
|
|
print "# Extract stimulation protocols"
|
|
@@ -57,7 +57,7 @@ for cell in cells:
|
|
|
recording_counter = 0
|
|
|
for _, recording in cell_recordings[cell_recordings["CellId"] == cell].iterrows():
|
|
|
cell_id = cell
|
|
|
- recording_dir = "recordings/"+recording["Recording"]
|
|
|
+ recording_dir = RECORDINGS_FOLDER+recording["Recording"]
|
|
|
for info, key, dat in pr.iload('%s/stimuli.dat' % (recording_dir,)):
|
|
|
if info[1]['RePro'] != test_protocol_for_pa:
|
|
|
continue
|
|
@@ -116,7 +116,8 @@ dictionary_of_stimulations = {
|
|
|
|
|
|
dictionary_of_stimulations.update(parameter_dict)
|
|
|
|
|
|
-pd.DataFrame(data=dictionary_of_stimulations).set_index("stimulation_id").to_csv(path_or_buf=stimulation_metadata_raw)
|
|
|
+stimulus_table_saving_path = OUTPUT_FOLDER+HELPER_TABLE_FOLDER+STIMULATION_METADATA_RAW
|
|
|
+pd.DataFrame(data=dictionary_of_stimulations).set_index("stimulation_id").to_csv(path_or_buf=stimulus_table_saving_path)
|
|
|
|
|
|
-print "Gathered meta data for each stimulation and saved to {}".format(stimulation_metadata_raw)
|
|
|
+print "Gathered meta data for each stimulation and saved to {}".format(stimulus_table_saving_path)
|
|
|
print ""
|