Esempio n. 1
0
def test_save():
    """ Test saving raw"""
    raw = Raw(fif_fname, preload=True)
    assert_raises(ValueError, raw.save, fif_fname)
    new_fname = op.join(op.abspath(op.curdir), 'break.fif')
    raw.save(op.join(tempdir, new_fname))
    new_raw = Raw(op.join(tempdir, new_fname))
    assert_raises(ValueError, new_raw.save, new_fname)
    new_raw.close()
    os.remove(new_fname)
mf_params_defaults = {'input_file': None, 'output_file': None,
             'autobad': 'on', 'st': True, 'movecomp': True,
             'st_corr': 0.96, 'st_buflen': 16, 'mv_hp': False,
             'origin_head': [0,0,40], 'radius_head': None,
             'bad': None, 'hpicons': True, 'linefreq': 50.,
             'cal': cal_db, 'ctc': ctc_db,
             'force': True, 'verbose': True, 'maxfilter_bin': mx_cmd,
             'logfile': None}


for subj in anadict.analysis_dict.keys():

    in_fname = anadict.analysis_dict[subj]['raw']['FFA']['files'][0] # Any file with HPI will do!
    raw = Raw(in_fname)
    radius_head, origin_head, origin_devive = fit_sphere_to_headshape(raw.info,ylim=0.070,verbose=VERBOSE)
    raw.close()        
    
    # This assumes the key does not already exist...
    anadict.analysis_dict[subj].update({'tsss_initial': {}})
    
    for task in anadict.analysis_dict[subj]['raw'].keys():

        # Start with a fresh copy of the defaults
        # needs to be here in case mf_params was altered (empty_room)
        mf_params = mf_params_defaults.copy()
        # Needs to be reset here if previous task was "empty_room"
        mf_params['movecomp'] = mf_params_defaults['movecomp']
        mf_params['hpicons'] = mf_params_defaults['hpicons']
        mf_params['origin_head'] = origin_head
        mf_params['radius_head'] = radius_head