本文整理汇总了Python中parameters.Parameters.iteritems方法的典型用法代码示例。如果您正苦于以下问题:Python Parameters.iteritems方法的具体用法?Python Parameters.iteritems怎么用?Python Parameters.iteritems使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类parameters.Parameters
的用法示例。
在下文中一共展示了Parameters.iteritems方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: spike_detection_job
# 需要导入模块: from parameters import Parameters [as 别名]
# 或者: from parameters.Parameters import iteritems [as 别名]
def spike_detection_job(DatFileNames, ProbeFileName, output_dir, output_name):
"""
Top level function that starts a data processing job.
"""
for DatFileName in DatFileNames:
if not os.path.exists(DatFileName):
raise Exception("Dat file %s does not exist" % DatFileName)
DatFileNames = [os.path.abspath(DatFileName)
for DatFileName in DatFileNames]
probe = probes.Probe(ProbeFileName)
n_ch_dat = Parameters['NCHANNELS']
sample_rate = Parameters['SAMPLERATE']
high_frequency_factor = Parameters['F_HIGH_FACTOR']
set_globals_samples(sample_rate, high_frequency_factor)
Parameters['CHUNK_OVERLAP'] = int(
sample_rate * Parameters['CHUNK_OVERLAP_SECONDS'])
Parameters['N_CH'] = probe.num_channels
max_spikes = Parameters['MAX_SPIKES']
basename = basenamefolder = output_name
# OutDir = join(output_dir, basenamefolder)
OutDir = output_dir
with indir(OutDir):
# Create a log file
GlobalVariables['log_fd'] = open(basename + '.log', 'w')
if Parameters['DEBUG']:
GlobalVariables['debug_fd'] = open(basename + '.debug', 'w')
Channels_dat = np.arange(probe.num_channels)
# Print Parameters dictionary to .log file
log_message("\n".join(["{0:s} = {1:s}".format(key, str(value))
for key, value in sorted(Parameters.iteritems()) if not key.startswith('_')]))
spike_detection_from_raw_data(basename, DatFileNames, n_ch_dat,
Channels_dat, probe.channel_graph,
probe, max_spikes)
numwarn = GlobalVariables['warnings']
if numwarn:
log_message(
'WARNINGS ENCOUNTERED: ' + str(numwarn) + ', check log file.')
# Close the log file at the end.
if 'log_fd' in GlobalVariables:
GlobalVariables['log_fd'].close()