def merge_gdf(model_params, raw_label='<STR_LIT>', file_type='<STR_LIT>',<EOL>fileprefix='<STR_LIT>'):
<EOL>raw_gids = get_raw_gids(model_params)<EOL>pop_sizes = [raw_gids[i][<NUM_LIT:1>]-raw_gids[i][<NUM_LIT:0>]+<NUM_LIT:1><EOL>for i in np.arange(model_params.Npops)]<EOL>raw_first_gids =  [raw_gids[i][<NUM_LIT:0>] for i in np.arange(model_params.Npops)]<EOL>converted_first_gids = [int(<NUM_LIT:1> + np.sum(pop_sizes[:i]))<EOL>for i in np.arange(model_params.Npops)]<EOL>COMM.Barrier()<EOL>for pop_idx in np.arange(model_params.Npops):<EOL><INDENT>if pop_idx % SIZE == RANK:<EOL><INDENT>files = glob(os.path.join(model_params.raw_nest_output_path,<EOL>raw_label + '<STR_LIT>'.format(pop_idx,<EOL>file_type)))<EOL>gdf = [] <EOL>for f in files:<EOL><INDENT>new_gdf = helpers.read_gdf(f)<EOL>for line in new_gdf:<EOL><INDENT>line[<NUM_LIT:0>] = line[<NUM_LIT:0>] - raw_first_gids[pop_idx] + converted_first_gids[pop_idx]<EOL>gdf.append(line)<EOL><DEDENT><DEDENT>print('<STR_LIT>'.format(os.path.join(model_params.spike_output_path,<EOL>fileprefix + '<STR_LIT>'.format(model_params.X[pop_idx]))))<EOL>helpers.write_gdf(gdf, os.path.join(model_params.spike_output_path,<EOL>fileprefix + '<STR_LIT>'.format(model_params.X[pop_idx])))<EOL><DEDENT><DEDENT>COMM.Barrier()<EOL>return<EOL>
NEST produces one file per virtual process containing voltages. 
This function gathers and combines them into one single file per hybridLFPy.