fixed bug in removeExt, it did not work with .gz files

This commit is contained in:
Marco Cammarata 2017-03-13 17:42:38 +01:00
parent 8a92ce981b
commit 0ad7587ede
1 changed files with 2 additions and 2 deletions

View File

@ -69,11 +69,11 @@ def timeToStr(delay,fmt="%+.0f"):
def removeExt(fname): def removeExt(fname):
""" special remove extension meant to work with compressed files.edf and .edf.gz files """ """ special remove extension meant to work with compressed files.edf and .edf.gz files """
if fname[-3:] == ".gz": fname = fname[-3:] if fname[-3:] == ".gz": fname = fname[:-3]
return os.path.splitext(fname)[0] return os.path.splitext(fname)[0]
def getBasename(fname): def getBasename(fname):
return removeExt(os.path.basename(fname)); return os.path.basename(removeExt(fname));
def findSlice(array,lims): def findSlice(array,lims):
start = np.ravel(np.argwhere(array>lims[0]))[0] start = np.ravel(np.argwhere(array>lims[0]))[0]