def post_execute(self): BaseQueueEntry.post_execute(self) params = [] #JNtodo, disable end_multicollect for dataset less than 1, or energy scan # Start grouped processing, get information from each collection # and call autoproc with grouped processing option for child in self.get_data_model().get_children(): for grand_child in child.get_children(): if isinstance(grand_child, queue_model_objects.DataCollection): xds_dir = grand_child.acquisitions[0].path_template.xds_dir residues = grand_child.processing_parameters.num_residues anomalous = grand_child.processing_parameters.anomalous space_group = grand_child.processing_parameters.space_group cell = grand_child.processing_parameters.get_cell_str() inverse_beam = grand_child.acquisitions[0].acquisition_parameters.inverse_beam params.append({'collect_id': grand_child.id, 'xds_dir': xds_dir, 'residues': residues, 'anomalous' : anomalous, 'spacegroup': space_group, 'cell': cell, 'inverse_beam': inverse_beam}) try: programs = self.beamline_setup.collect_hwobj["auto_processing"] except IndexError: # skip autoprocessing of the data pass else: autoprocessing.start(programs, "end_multicollect", params) self._set_background_color() self._view.setText(1, "")
def trigger_auto_processing( self, process_event, xds_dir, EDNA_files_dir=None, anomalous=None, residues=200, do_inducedraddam=False, spacegroup=None, cell=None, ): # quick fix for anomalous, do_inducedraddam... passed as a string!!! # (comes from the queue) if isinstance(anomalous, str): anomalous = anomalous == "True" if isinstance(do_inducedraddam, str): do_inducedraddam = do_inducedraddam == "True" if isinstance(residues, str): try: residues = int(residues) except Exception: residues = 200 # residues = zero should be interpreted as if no value was provided # use default of 200 if residues == 0: residues = 200 processAnalyseParams = {} processAnalyseParams["EDNA_files_dir"] = EDNA_files_dir try: if isinstance(xds_dir, list): processAnalyseParams["collections_params"] = xds_dir else: processAnalyseParams["datacollect_id"] = self.collection_id processAnalyseParams["xds_dir"] = xds_dir processAnalyseParams["anomalous"] = anomalous processAnalyseParams["residues"] = residues processAnalyseParams["spacegroup"] = spacegroup processAnalyseParams["cell"] = cell except Exception as msg: logging.getLogger().exception("DataCollect:processing: %r" % str(msg)) else: # logging.info("AUTO PROCESSING: %s, %s, %s, %s, %s, %s, %r, %r", process_event, EDNA_files_dir, anomalous, residues, do_inducedraddam, spacegroup, cell) try: autoprocessing.start( self["auto_processing"], process_event, processAnalyseParams ) except Exception: logging.getLogger().exception("Error starting processing") if process_event == "after" and do_inducedraddam: try: autoprocessing.startInducedRadDam(processAnalyseParams) except Exception: logging.exception("Error starting induced rad.dam")
def trigger_auto_processing( self, process_event, xds_dir, EDNA_files_dir=None, anomalous=None, residues=200, do_inducedraddam=False, spacegroup=None, cell=None, ): # quick fix for anomalous, do_inducedraddam... passed as a string!!! # (comes from the queue) if isinstance(anomalous, types.StringType): anomalous = anomalous == "True" if isinstance(do_inducedraddam, types.StringType): do_inducedraddam = do_inducedraddam == "True" if isinstance(residues, types.StringType): try: residues = int(residues) except BaseException: residues = 200 # residues = zero should be interpreted as if no value was provided # use default of 200 if residues == 0: residues = 200 processAnalyseParams = {} processAnalyseParams["EDNA_files_dir"] = EDNA_files_dir try: if isinstance(xds_dir, types.ListType): processAnalyseParams["collections_params"] = xds_dir else: processAnalyseParams["datacollect_id"] = self.collection_id processAnalyseParams["xds_dir"] = xds_dir processAnalyseParams["anomalous"] = anomalous processAnalyseParams["residues"] = residues processAnalyseParams["spacegroup"] = spacegroup processAnalyseParams["cell"] = cell except Exception as msg: logging.getLogger().exception("DataCollect:processing: %r" % str(msg)) else: # logging.info("AUTO PROCESSING: %s, %s, %s, %s, %s, %s, %r, %r", process_event, EDNA_files_dir, anomalous, residues, do_inducedraddam, spacegroup, cell) try: autoprocessing.start( self["auto_processing"], process_event, processAnalyseParams ) except BaseException: logging.getLogger().exception("Error starting processing") if process_event == "after" and do_inducedraddam: try: autoprocessing.startInducedRadDam(processAnalyseParams) except BaseException: logging.exception("Error starting induced rad.dam")
processAnalyseParams["anomalous"] = anomalous processAnalyseParams["residues"] = residues processAnalyseParams["inverse_beam"] = inverse_beam processAnalyseParams["spacegroup"] = spacegroup processAnalyseParams["cell"] = cell except Exception, msg: logging.getLogger().exception("DataCollect:processing: %r" % msg) else: logging.info( "AUTO PROCESSING: %s, %s, %s, %s, %s, %s, %r, %r", process_event, EDNA_files_dir, anomalous, residues, inverse_beam, do_inducedraddam, spacegroup, cell, ) try: autoprocessing.start(self["auto_processing"], process_event, processAnalyseParams) except: logging.getLogger().exception("Error starting processing") if process_event == "after" and do_inducedraddam: try: autoprocessing.startInducedRadDam(processAnalyseParams) except: logging.exception("Error starting induced rad.dam")
try: if type(xds_dir) == types.ListType: processAnalyseParams["collections_params"] = xds_dir else: processAnalyseParams['datacollect_id'] = self.collection_id processAnalyseParams['xds_dir'] = xds_dir processAnalyseParams['anomalous'] = anomalous processAnalyseParams['residues'] = residues processAnalyseParams['inverse_beam'] = inverse_beam processAnalyseParams["spacegroup"] = spacegroup processAnalyseParams["cell"] = cell except Exception, msg: logging.getLogger().exception("DataCollect:processing: %r" % msg) else: logging.info("AUTO PROCESSING: %s, %s, %s, %s, %s, %s, %r, %r", process_event, EDNA_files_dir, anomalous, residues, inverse_beam, do_inducedraddam, spacegroup, cell) try: autoprocessing.start(self["auto_processing"], process_event, processAnalyseParams) except: logging.getLogger().exception("Error starting processing") if process_event == "after" and do_inducedraddam: try: autoprocessing.startInducedRadDam(processAnalyseParams) except: logging.exception("Error starting induced rad.dam")