diff --git a/xray/id9.py b/xray/id9.py index 7c90bef..6c94cb7 100644 --- a/xray/id9.py +++ b/xray/id9.py @@ -66,7 +66,7 @@ def findLogFile(folder): if len(files)>1: log.warn("Found more than one *.log file that is not diagnostics.log: %s"%files) return logfile -def readLogFile(fnameOrFolder,subtractDark=False): +def readLogFile(fnameOrFolder,subtractDark=False,skip_first=0,asDataStorage=True,last=None): """ read id9 style logfile """ if os.path.isdir(fnameOrFolder): fname = findLogFile(fnameOrFolder) @@ -88,6 +88,11 @@ def readLogFile(fnameOrFolder,subtractDark=False): if subtractDark: for diode in ['pd1ic','pd2ic','pd3ic','pd4ic']: if diode in darks: data[diode]=data[diode]-darks[diode]*data['timeic'] + data = data[skip_first:last] + if asDataStorage: + # rstrip("_") is used to clean up last _ that appera for some reason in file_ + data = storage.DataStorage( dict((name.rstrip("_"),data[name]) for name in data.dtype.names ) ) + data.file = data.file.astype(str) return data