def run_analysis(self):
   """ Run analysis of integrated images """
   from iota.components.iota_analysis import Analyzer
   analysis = Analyzer(init=self.init, all_objects=self.img_objects)
   analysis.print_results()
   analysis.unit_cell_analysis()
   analysis.print_summary()
   analysis.make_prime_input()
示例#2
0
 def run_analysis(self):
   ''' Run analysis of integrated images '''
   cmd.Command.start("Analyzing results ")
   analysis = Analyzer(self.init, self.img_objects, iota_version)
   cmd.Command.end("Analyzing results -- DONE")
   analysis.print_results()
   analysis.unit_cell_analysis()
   analysis.print_summary()
   analysis.make_prime_input()
示例#3
0
 def run_analysis(self):
     ''' Run analysis of integrated images '''
     cmd.Command.start("Analyzing results ")
     analysis = Analyzer(init=self.init,
                         all_objects=self.img_objects,
                         gui_mode=False)
     cmd.Command.end("Analyzing results -- DONE")
     analysis.print_results()
     analysis.unit_cell_analysis()
     analysis.print_summary()
     analysis.make_prime_input()
示例#4
0
    def prepare_PRIME_input(self):
        """ Prepare the list of integrated pickles as well as pertinent
    parameters; create a PRIME input file """

        # Check if any pg/uc information is available; pg/uc info from UI
        # supercedes pg/uc from Cluster

        if self.best_pg is None:
            self.best_pg = self.info.best_pg

        if self.best_uc is None:
            self.best_uc = self.info.best_uc
        else:
            uc_params = str(self.best_uc).rsplit()
            self.best_uc = [float(i) for i in uc_params]

        # Only run PRIME if both pg and uc are provided
        if self.best_pg and self.best_uc:
            from iota.components.iota_analysis import Analyzer

            # Create a file with list of integrated pickles (overwrite old file)
            int_pickles_file = os.path.join(self.info.int_base,
                                            'int_pickles.lst')
            with open(int_pickles_file, 'w') as ff:
                ff.write('\n'.join(self.info.categories['integrated'][0]))

            # Create PRIME input file
            analyzer = Analyzer(info=self.info, params=self.params)
            analyzer.prime_data_path = int_pickles_file
            analyzer.best_pg = self.best_pg
            analyzer.best_uc = self.best_uc

            prime_phil = analyzer.make_prime_input(filename='live_prime.phil',
                                                   run_zero=True)
            self.pparams = prime_phil.extract()

            # Modify specific options based in IOTA settings
            # Queue options
            if (self.params.mp.method == 'lsf'
                    and self.params.mp.queue is not None):
                self.pparams.queue.mode = 'bsub'
                self.pparams.queue.qname = self.params.mp.queue

            # Number of processors (automatically, 1/2 of IOTA procs)
            self.pparams.n_processors = int(self.params.mp.n_processors / 2)

            # Generate command args
            cmd_args_list = [
                'n_postref_cycle=0',
                'queue.mode={}'.format(self.pparams.queue.mode),
                'queue.qname={}'.format(self.pparams.queue.qname),
                'n_processors={}'.format(self.pparams.n_processors)
            ]
            if self.pparams.queue.mode == 'bsub':
                cmd_args_list.append('timeout_seconds=120')
            cmd_args = ' '.join(cmd_args_list)

            return cmd_args
        else:
            return None