コード例 #1
0
print('last_row imported')
# to Metrica Format
metrica_attack, metrica_defence = lrfot.lastrow_to_friendsoftracking(last_row)
metrica_attack = lrfot.lastrow_to_metric_coordinates(metrica_attack)
metrica_defence = lrfot.lastrow_to_metric_coordinates(metrica_defence)
metrica_attack, data_defence = lrfot.lastrow_to_single_playing_direction(
    metrica_attack, metrica_defence)

metrica_attack = pvm.lastrow_calc_player_velocities(metrica_attack,
                                                    smoothing=True)
metrica_defence = pvm.lastrow_calc_player_velocities(data_defence,
                                                     smoothing=True)

print('converted to metrica')
# Read in Events
events_dict, events_df = create.create_events(metrica_attack)

print('events imported')
# Real Shirt Mapping
shirt_mapping = sm.create_consistent_shirt_mapping(last_row)
events_df = sm.real_shirt_mapping(events_df, shirt_mapping)
print('shirts mapped')

# to Bokeh Format
bokeh_attack = mtb.tracking_to_bokeh_format(metrica_attack)
bokeh_defence = mtb.tracking_to_bokeh_format(metrica_defence)

print('converted to bokeh')
# List of available Matches
match_list = events_df.index.get_level_values(level=0).unique().tolist()
コード例 #2
0
ファイル: pre_analysis.py プロジェクト: danielrez/FSL
import pandas as pd

data_dir   	  = os.environ.get('DATA_DIR') or '/home/daniel/fsl-analysis/data'
study_name 	  = os.environ.get('STUDY_NAME') or 'AV'

raw_dir 	  = os.path.join(data_dir, 'raw')
behav_dir = os.path.join(data_dir, 'behavioral')
op = OpenFMRIData(data_dir, raw_dir, study_name)
# subject_names = ['HiAn'] # Specific subject names
subject_names = op.get_subject_names()  # All subjects

for name in subject_names:
    subject_dir = op.create_subject_dir(name, overwrite=True)
    #  if we want to create new data for analysis
    # subject_dir = op.create_subject_dir(name)
    #  if we want to load new data for analysis
    # subject_dir = op.load_subject_dir(subname=name)
    create_events(subject_dir, behav_dir)

    analyzer = OpenFMRIAnalyzer(op,[subject_dir])
    brain_image = analyzer.extract_brain(subject_dir)
    analyzer.estimate_bias_field(subject_dir, brain_image, overwrite=True)
    analyzer.anatomical_registration(subject_dir)
    analyzer.anatomical_smoothing(subject_dir)

    analyzer.slice_time_correction(subject_dir)
    analyzer.motion_correction(subject_dir)
    analyzer.functional_registration(subject_dir)
    analyzer.functional_smoothing(subject_dir)

コード例 #3
0
ファイル: Main_create_TEST.py プロジェクト: gbolzon/ogstm
import create_da_nc as DA
import create_fluxes

# MAIN PROGRAM

TEST_LIST = np.loadtxt('TEST_LIST.dat', dtype=test_conf, skiprows=1, ndmin=1)

for test in TEST_LIST:

    print(test['Dir'])

    DA.create_dataset(test)

    c_dom.create_Dom_Dec(test)

    c_mask.create_meshmask_nc(test)

    c_for.create_forcings_nc(test)

    c_ext.create_extinction_nc(test)

    c_bc.create_bc_nc(test)

    create_fluxes.create_fluxes(test)

    c_init.create_init_nc(test)

    d_code.deploy_code(test)

    c_events.create_events(test)