当前位置: 首页>>代码示例>>Python>>正文


Python Parameters.iteritems方法代码示例

本文整理汇总了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()
开发者ID:kylerbrown,项目名称:spikedetekt,代码行数:52,代码来源:core.py


注:本文中的parameters.Parameters.iteritems方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。