From 73cdaf93afd8e25675cdfb5df71b798605e73440 Mon Sep 17 00:00:00 2001 From: efish Date: Fri, 16 Nov 2018 09:26:37 +0100 Subject: [PATCH] Strip blanks from keys --- code/read_chirp_data.py | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/code/read_chirp_data.py b/code/read_chirp_data.py index e1181f3..c3afe76 100644 --- a/code/read_chirp_data.py +++ b/code/read_chirp_data.py @@ -15,11 +15,11 @@ def read_chirp_spikes(dataset): if "index" in l and "chirp" not in l: index = int(l.split(":")[-1]) if "deltaf" in l and "true" not in l: - df = l.split(":")[-1] + df = l.split(":")[-1].strip() if "contrast" in l and "true" not in l: - contrast = l.split(":")[-1] + contrast = l.split(":")[-1].strip() if "chirpsize" in l: - cs = l.split(":")[-1] + cs = l.split(":")[-1].strip() if "#Key" in l: spikes[(index, df, contrast, cs)] = {} if "chirp index" in l: @@ -45,11 +45,11 @@ def read_chirp_eod(dataset): if "index" in l and "chirp" not in l: index = int(l.split(":")[-1]) if "deltaf" in l and "true" not in l: - df = l.split(":")[-1] + df = l.split(":")[-1].strip() if "contrast" in l and "true" not in l: - contrast = l.split(":")[-1] + contrast = l.split(":")[-1].strip() if "chirpsize" in l: - cs = l.split(":")[-1] + cs = l.split(":")[-1].strip() if "#Key" in l: chirp_eod[(index, df, contrast, cs)] = ([], []) if len(l.strip()) != 0 and "#" not in l: @@ -73,11 +73,11 @@ def read_chirp_times(dataset): if "index" in l and "chirp" not in l: index = int(l.split(":")[-1]) if "deltaf" in l and "true" not in l: - df = l.split(":")[-1] + df = l.split(":")[-1].strip() if "contrast" in l and "true" not in l: - contrast = l.split(":")[-1] + contrast = l.split(":")[-1].strip() if "chirpsize" in l: - cs = l.split(":")[-1] + cs = l.split(":")[-1].strip() if "#Key" in l: chirp_times[(index, df, contrast, cs)] = [] if len(l.strip()) != 0 and "#" not in l: