def _get_array_dicts(templates, stream, copy_streams=True):
<EOL>template_dict = {}<EOL>stream_dict = {}<EOL>pad_dict = {}<EOL>t_starts = []<EOL>stream.sort(['<STR_LIT>', '<STR_LIT>', '<STR_LIT:location>', '<STR_LIT>'])<EOL>for template in templates:<EOL><INDENT>template.sort(['<STR_LIT>', '<STR_LIT>', '<STR_LIT:location>', '<STR_LIT>'])<EOL>t_starts.append(min([tr.stats.starttime for tr in template]))<EOL><DEDENT>seed_ids = [tr.id + '<STR_LIT:_>' + str(i) for i, tr in enumerate(templates[<NUM_LIT:0>])]<EOL>for i, seed_id in enumerate(seed_ids):<EOL><INDENT>temps_with_seed = [template[i].data for template in templates]<EOL>t_ar = np.array(temps_with_seed).astype(np.float32)<EOL>template_dict.update({seed_id: t_ar})<EOL>stream_dict.update(<EOL>{seed_id: stream.select(<EOL>id=seed_id.split('<STR_LIT:_>')[<NUM_LIT:0>])[<NUM_LIT:0>].data.astype(np.float32)})<EOL>pad_list = [<EOL>int(round(template[i].stats.sampling_rate *<EOL>(template[i].stats.starttime - t_starts[j])))<EOL>for j, template in zip(range(len(templates)), templates)]<EOL>pad_dict.update({seed_id: pad_list})<EOL><DEDENT>return stream_dict, template_dict, pad_dict, seed_ids<EOL>
prepare templates and stream, return dicts