示例#1
0
 mi_file = MIfile.MIfile(mi_fname, meta_fname)
 corr_maps = CorrMaps.CorrMaps(mi_file, out_folder, lag_list, kernel_specs, img_range, crop_roi)
 
 # Calculate correlation maps
 if ('-skip_cmap' not in cmd_list):
     if ('-silent' not in cmd_list):
         print('    - Computing correlation maps (multiprocess mode to be implemented)')
     corr_maps.Compute(silent=True, return_maps=False)
     
 if (('-skip_vmap' not in cmd_list) or (num_proc > 1 and '-skip_vmap_assemble' not in cmd_list) or ('-skip_displ' not in cmd_list) or ('-skip_grad' not in cmd_list)):
     
     # Read options for velocity calculation
     vmap_kw = VelMaps._get_kw_from_config(conf, section='velmap_parameters')
     
     # Initialize MelMaps object
     vel_maps = VelMaps.VelMaps(corr_maps, **SharedFunctions.filter_kwdict_funcparams(vmap_kw, VelMaps.VelMaps.__init__))
     
 # Calculate velocity maps
 if ('-skip_vmap' not in cmd_list):
     
     if (num_proc == 1):
         if ('-silent' not in cmd_list):
             print('    - Computing velocity maps (single process)')
         vel_maps.Compute(**SharedFunctions.filter_kwdict_funcparams(vmap_kw, VelMaps.VelMaps.Compute))
     else:
         if ('-silent' not in cmd_list):
             print('    - Computing velocity maps (splitting computaton in {0} processes)'.format(num_proc))
         vel_maps.ComputeMultiproc(num_proc, px_per_chunk, assemble_after=False,\
                                   **SharedFunctions.filter_kwdict_funcparams(vmap_kw, VelMaps.VelMaps.ComputeMultiproc))
                             
 if (num_proc > 1 and '-skip_vmap_assemble' not in cmd_list):
 mi_file = MIfile.MIfile(mi_fname, meta_fname)
 corr_maps = CorrMaps.CorrMaps(mi_file, out_folder, lag_list, kernel_specs, img_range, crop_roi)
 
 # Calculate correlation maps
 if ('-skip_cmap' not in cmd_list):
     if ('-silent' not in cmd_list):
         print('    - Computing correlation maps (multiprocess mode to be implemented)')
     corr_maps.Compute(silent=True, return_maps=False)
     
 if (('-skip_vmap' not in cmd_list) or (num_proc > 1 and '-skip_vmap_assemble' not in cmd_list) or ('-skip_displ' not in cmd_list) or ('-skip_grad' not in cmd_list)):
     
     # Read options for velocity calculation
     vmap_kw = VelMaps._get_kw_from_config(conf, section='velmap_parameters')
     
     # Initialize MelMaps object
     vel_maps = VelMaps.VelMaps(corr_maps, **SharedFunctions.filter_kwdict_funcparams(vmap_kw, VelMaps.VelMaps.__init__))
     
 # Calculate velocity maps
 if ('-skip_vmap' not in cmd_list):
     
     if (num_proc == 1):
         if ('-silent' not in cmd_list):
             print('    - Computing velocity maps (single process)')
         vel_maps.Compute(**SharedFunctions.filter_kwdict_funcparams(vmap_kw, VelMaps.VelMaps.Compute))
     else:
         if ('-silent' not in cmd_list):
             print('    - Computing velocity maps (splitting computaton in {0} processes)'.format(num_proc))
         vel_maps.ComputeMultiproc(num_proc, px_per_chunk, assemble_after=False,\
                                   **SharedFunctions.filter_kwdict_funcparams(vmap_kw, VelMaps.VelMaps.ComputeMultiproc))
                             
 if (num_proc > 1 and '-skip_vmap_assemble' not in cmd_list):