コード例 #1
0
def functionXMLin(_strFilename):
    """Here we create the XML string to be passed to the EDNA plugin from the input strFilename
    This can / should be modified by the final user
    
    @param _strFilename: full path of the input file
    @type _strFilename: python string representing the path
    @return: string  
    """
    EDVerbose.screen("Starting processing of image %s" % (_strFilename))
    # First check if the filename end with .img or .mccd:
    strXML = None
    if _strFilename.endswith(".img") or _strFilename.endswith(".mccd") or _strFilename.endswith(".cbf"):
        xsDataInputGridScreening = XSDataInputGridScreening()
        xsDataDiffractionPlan = XSDataDiffractionPlan()
        xsDataDiffractionPlan.setMaxExposureTimePerDataCollection(
            XSDataTime(EDParallelExecuteGridScreening.fMaxExposureTime)
        )
        xsDataInputGridScreening.setDiffractionPlan(xsDataDiffractionPlan)
        xsDataFile = XSDataFile()
        xsDataFile.setPath(XSDataString(_strFilename))
        xsDataInputGridScreening.setImageFile(xsDataFile)
        if EDParallelExecuteGridScreening.bOnlyImageQualityIndicators:
            xsDataInputGridScreening.setDoOnlyImageQualityIndicators(XSDataBoolean(True))
        if EDParallelExecuteGridScreening.bStoreInISPyB:
            xsDataInputGridScreening.setStoreImageQualityIndicatorsInISPyB(XSDataBoolean(True))
        if EDParallelExecuteGridScreening.bDoOnlyIntegrationWithXMLOutput:
            xsDataInputGridScreening.setDoOnlyIntegrationWithXMLOutput(XSDataBoolean(True))
        strXML = xsDataInputGridScreening.marshal()
    else:
        EDVerbose.screen("File name not ending with .img or .mccd - ignored : %s" % _strFilename)
    return strXML
コード例 #2
0
def functionXMLin(_strFilename):
    """Here we create the XML string to be passed to the EDNA plugin from the input strFilename
    This can / should be modified by the final user
    
    @param _strFilename: full path of the input file
    @type _strFilename: python string representing the path
    @return: string  
    """
    EDVerbose.screen("Starting processing of image %s" % (_strFilename))
    # First check if the filename end with .img or .mccd:
    strXML = None
    if (_strFilename.endswith(".img") or _strFilename.endswith(".mccd") or _strFilename.endswith(".cbf")):
        xsDataInputGridScreening = XSDataInputGridScreening()
        xsDataDiffractionPlan = XSDataDiffractionPlan()
        xsDataDiffractionPlan.setMaxExposureTimePerDataCollection(XSDataTime(EDParallelExecuteGridScreening.fMaxExposureTime))
        xsDataInputGridScreening.setDiffractionPlan(xsDataDiffractionPlan)
        xsDataFile = XSDataFile()
        xsDataFile.setPath(XSDataString(_strFilename))
        xsDataInputGridScreening.setImageFile(xsDataFile)
        if EDParallelExecuteGridScreening.bOnlyImageQualityIndicators:
            xsDataInputGridScreening.setDoOnlyImageQualityIndicators(XSDataBoolean(True))
        if EDParallelExecuteGridScreening.bStoreInISPyB:
            xsDataInputGridScreening.setStoreImageQualityIndicatorsInISPyB(XSDataBoolean(True))
        if EDParallelExecuteGridScreening.bDoOnlyIntegrationWithXMLOutput:
            xsDataInputGridScreening.setDoOnlyIntegrationWithXMLOutput(XSDataBoolean(True))
        strXML = xsDataInputGridScreening.marshal()
    else:
        EDVerbose.screen("File name not ending with .img or .mccd - ignored : %s" % _strFilename)
    return strXML
コード例 #3
0
 strPathToTempDir = tempfile.mkdtemp(
     prefix="edna-image-quality-indicators_")
 os.chdir(strPathToTempDir)
 EDVerbose.setLogFileName(os.path.join(strPathToTempDir, "edna.log"))
 # Popolate input data
 EDVerbose.screen("Starting EDNA image quality indicators processing")
 EDVerbose.screen("Arguments: %r" % sys.argv)
 bVerbose = False
 bDebug = False
 listPaths = []
 for iIndex, strArg in enumerate(sys.argv[1:]):
     strarg = strArg.lower()
     if strarg == "--verbose":
         EDVerbose.setVerboseOn()
     elif strarg == "--debug":
         EDVerbose.setVerboseDebugOn()
     if os.path.exists(strArg):
         listPaths.append(os.path.abspath(strArg))
 for strPath in listPaths:
     xsDataInputGridScreening = XSDataInputGridScreening()
     xsDataFile = XSDataFile()
     xsDataFile.setPath(XSDataString(strPath))
     xsDataInputGridScreening.setImageFile(xsDataFile)
     xsDataInputGridScreening.setDoOnlyImageQualityIndicators(
         XSDataBoolean(True))
     xsDataInputGridScreening.setStoreImageQualityIndicatorsInISPyB(
         XSDataBoolean(True))
     edPluginGridScreening = EDFactoryPluginStatic.loadPlugin(
         "EDPluginControlGridScreeningv1_0")
     edPluginGridScreening.setDataInput(xsDataInputGridScreening)
     edPluginGridScreening.executeSynchronous()
コード例 #4
0
from XSDataGridScreeningv1_0 import XSDataInputGridScreening


if __name__ == '__main__':
    strPathToTempDir = tempfile.mkdtemp(prefix="edna-image-quality-indicators_")
    os.chdir(strPathToTempDir)
    EDVerbose.setLogFileName(os.path.join(strPathToTempDir, "edna.log"))
    # Popolate input data
    EDVerbose.screen("Starting EDNA image quality indicators processing")
    EDVerbose.screen("Arguments: %r" % sys.argv)
    bVerbose = False
    bDebug = False
    listPaths = []
    for iIndex, strArg in enumerate(sys.argv[1:]):
        strarg = strArg.lower()
        if strarg == "--verbose":
            EDVerbose.setVerboseOn()
        elif strarg == "--debug":
            EDVerbose.setVerboseDebugOn()
        if os.path.exists(strArg):
            listPaths.append(os.path.abspath(strArg))
    for strPath in listPaths:
        xsDataInputGridScreening = XSDataInputGridScreening()
        xsDataFile = XSDataFile()
        xsDataFile.setPath(XSDataString(strPath))
        xsDataInputGridScreening.setImageFile(xsDataFile)
        xsDataInputGridScreening.setDoOnlyImageQualityIndicators(XSDataBoolean(True))
        xsDataInputGridScreening.setStoreImageQualityIndicatorsInISPyB(XSDataBoolean(True))
        edPluginGridScreening = EDFactoryPluginStatic.loadPlugin("EDPluginControlGridScreeningv1_0")
        edPluginGridScreening.setDataInput(xsDataInputGridScreening)
        edPluginGridScreening.executeSynchronous()