本文整理汇总了Python中Model.Model.load_saved_labels_log方法的典型用法代码示例。如果您正苦于以下问题:Python Model.load_saved_labels_log方法的具体用法?Python Model.load_saved_labels_log怎么用?Python Model.load_saved_labels_log使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Model.Model
的用法示例。
在下文中一共展示了Model.load_saved_labels_log方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from Model import Model [as 别名]
# 或者: from Model.Model import load_saved_labels_log [as 别名]
#.........这里部分代码省略.........
self.homeDir = homeDir
self.log = Logger(self.homeDir,configDict=self.configDict)
self.model.initialize(self.homeDir)
self.fileNameList = get_fcs_file_names(self.homeDir)
## this needs to be tested or modified for very large projects
self.eventsList = [self.model.get_events_from_file(fn) for fn in self.fileNameList]
if len(self.fileNameList) > 0:
self.fileChannels = self.model.get_file_channel_list(self.fileNameList[0])
else:
self.fileChannels = None
if self.channelDict == None:
self.channelDict = self.model.load_channel_dict()
def _labels_load(self,labelsID):
'''
load the labels from a given labelsID
Often the model run id is the labelsID
'''
if labelsID == None:
return
if self.labelsList.has_key(labelsID) == True:
return None
_labelsList = []
_logsList = []
for fileName in self.fileNameList:
_labels = self.model.load_saved_labels(fileName,labelsID)
modelLog = self.model.load_saved_labels_log(fileName,labelsID)
_labelsList.append(_labels)
_logsList.append(modelLog)
self.labelsList[labelsID] = _labelsList
self.labelsLogList[labelsID] = _logsList
def get_events(self,selectedFileName,subsample='original',filterName=None):
'''
input:
selectedFileName - string representing the file without the full path and without a file extension
subsample - any numeric string, int or float that specifies an already processed subsample
subsample - may also be a filterID such as 'filter1'
'''
## error checking
if selectedFileName not in self.fileNameList:
print "ERROR: Controller.get_events - Invalid selectedFile specified", selectedFileName
return None
## check to see if orig events are in memory otherwise load them from pickle
if len(self.eventsList) > 0:
origEvents = self.eventsList[self.fileNameList.index(selectedFileName)]
else:
origEvents = self.model.get_events_from_file(selectedFileName)
if subsample == 'original':
return origEvents
elif filterName != None:
if self.subsampleDict.has_key(filterName) == False:
print "WARNING: Controller.get_events -- invalid filterName"
return origEvents[self.subsampleDict[key],:]
else:
self.handle_subsampling(subsample)