Exemplo n.º 1
0
 def buildChildren(self, child_, nodeName_):
     if child_.nodeType == Node.ELEMENT_NODE and \
      nodeName_ == 'mxv1ResultCharacterisation':
         obj_ = XSDataResultCharacterisation()
         obj_.build(child_)
         self.setMxv1ResultCharacterisation(obj_)
     elif child_.nodeType == Node.ELEMENT_NODE and \
      nodeName_ == 'mxv1ResultCharacterisation_Reference':
         obj_ = XSDataResultCharacterisation()
         obj_.build(child_)
         self.setMxv1ResultCharacterisation_Reference(obj_)
     elif child_.nodeType == Node.ELEMENT_NODE and \
      nodeName_ == 'mxv2DataCollection':
         obj_ = XSDataCollection()
         obj_.build(child_)
         self.setMxv2DataCollection(obj_)
     elif child_.nodeType == Node.ELEMENT_NODE and \
      nodeName_ == 'mxv2DataCollection_Reference':
         obj_ = XSDataCollection()
         obj_.build(child_)
         self.setMxv2DataCollection_Reference(obj_)
     elif child_.nodeType == Node.ELEMENT_NODE and \
      nodeName_ == 'suggestedStrategy':
         obj_ = XSDataResultStrategy()
         obj_.build(child_)
         self.setSuggestedStrategy(obj_)
     elif child_.nodeType == Node.ELEMENT_NODE and \
      nodeName_ == 'possibleOrientations':
         obj_ = kappa_alignment_response()
         obj_.build(child_)
         self.setPossibleOrientations(obj_)
     XSDataResultInterface.buildChildren(self, child_, nodeName_)
Exemplo n.º 2
0
    def writeKappaSettings(self):
        '''
        # future version for getting motor positions related to images under processing
        # checking in order:
        # - value got as input
        # - mosflm.descr file in process subdir (if BCM (like mxcube) registered it)
        # - {imageTemplate}_kappa_settings.xml file (if BCM (like DNA) registered it)
        # - read it now (and try to register as {imageTemplate}_kappa_settings.xml)
        # - just use the datum (0,0,0)
        '''

        #code for using a predefined datum (0;0;0)
        #EDUtilsFile.writeFile( EDDiskExplorer.mergePath( self.getWorkingDirectory(), "DNA_STAC_Kappa_Settings" ), "<?xml version=\"1.0\" encoding=\"ISO-8859-1\"?><kappa_collect_settings><motorSettings><motorName>Omega</motorName><motorValue>0</motorValue></motorSettings><motorSettings><motorName>Kappa</motorName><motorValue>0.000000</motorValue></motorSettings><motorSettings><motorName>Phi</motorName><motorValue>0</motorValue></motorSettings><motorSettings><motorName>X</motorName><motorValue>0.261444</motorValue></motorSettings><motorSettings><motorName>Y</motorName><motorValue>-0.085559</motorValue></motorSettings><motorSettings><motorName>Z</motorName><motorValue>0.659333</motorValue></motorSettings><comment>BCM query performed by STAC</comment></kappa_collect_settings>")

        # gonio settings from DC descriptor object
        EDFactoryPluginStatic.loadModule("XSDataMXv2")
        #import XSDataMXv2
        #dc = XSDataMXv2.XSDataCollection()
        from XSDataMXv2 import XSDataCollection
        dc = XSDataCollection()
        dc = self.getDataInput("dataCollection")[0]
        omega = dc.getXSSubWedge()[0].getXSRotationalGoniostatSetting().getBaseaxissetting()
        [kappa, phi] = dc.getXSSubWedge()[0].getXSRotationalGoniostatSetting().getAxissetting()
        EDUtilsFile.writeFile(os.path.join(self.getWorkingDirectory(), "DNA_STAC_Kappa_Settings"), "<?xml version=\"1.0\" encoding=\"ISO-8859-1\"?><kappa_collect_settings><motorSettings><motorName>Omega</motorName><motorValue>%e</motorValue></motorSettings><motorSettings><motorName>Kappa</motorName><motorValue>%e</motorValue></motorSettings><motorSettings><motorName>Phi</motorName><motorValue>%e</motorValue></motorSettings><motorSettings><motorName>X</motorName><motorValue>0.261444</motorValue></motorSettings><motorSettings><motorName>Y</motorName><motorValue>-0.085559</motorValue></motorSettings><motorSettings><motorName>Z</motorName><motorValue>0.659333</motorValue></motorSettings><comment>BCM query performed by STAC</comment></kappa_collect_settings>" % (omega.getValue(), kappa.getValue(), phi.getValue()))

        '''
Exemplo n.º 3
0
    def writeKappaSettings(self):
        '''
        # future version for getting motor positions related to images under processing
        # checking in order:
        # - value got as input
        # - mosflm.descr file in process subdir (if BCM (like mxcube) registered it)
        # - {imageTemplate}_kappa_settings.xml file (if BCM (like DNA) registered it)
        # - read it now (and try to register as {imageTemplate}_kappa_settings.xml)
        # - just use the datum (0,0,0)
        '''

        #code for using a predefined datum (0;0;0)
        #EDUtilsFile.writeFile( EDDiskExplorer.mergePath( self.getWorkingDirectory(), "DNA_STAC_Kappa_Settings" ), "<?xml version=\"1.0\" encoding=\"ISO-8859-1\"?><kappa_collect_settings><motorSettings><motorName>Omega</motorName><motorValue>0</motorValue></motorSettings><motorSettings><motorName>Kappa</motorName><motorValue>0.000000</motorValue></motorSettings><motorSettings><motorName>Phi</motorName><motorValue>0</motorValue></motorSettings><motorSettings><motorName>X</motorName><motorValue>0.261444</motorValue></motorSettings><motorSettings><motorName>Y</motorName><motorValue>-0.085559</motorValue></motorSettings><motorSettings><motorName>Z</motorName><motorValue>0.659333</motorValue></motorSettings><comment>BCM query performed by STAC</comment></kappa_collect_settings>")

        # gonio settings from DC descriptor object
        EDFactoryPluginStatic.loadModule("XSDataMXv2")
        #import XSDataMXv2
        #dc = XSDataMXv2.XSDataCollection()
        from XSDataMXv2 import XSDataCollection
        dc = XSDataCollection()
        dc = self.getDataInput("dataCollection")[0]
        omega = dc.getXSSubWedge()[0].getXSRotationalGoniostatSetting(
        ).getBaseaxissetting()
        [kappa, phi] = dc.getXSSubWedge()[0].getXSRotationalGoniostatSetting(
        ).getAxissetting()
        EDUtilsFile.writeFile(
            os.path.join(self.getWorkingDirectory(),
                         "DNA_STAC_Kappa_Settings"),
            "<?xml version=\"1.0\" encoding=\"ISO-8859-1\"?><kappa_collect_settings><motorSettings><motorName>Omega</motorName><motorValue>%e</motorValue></motorSettings><motorSettings><motorName>Kappa</motorName><motorValue>%e</motorValue></motorSettings><motorSettings><motorName>Phi</motorName><motorValue>%e</motorValue></motorSettings><motorSettings><motorName>X</motorName><motorValue>0.261444</motorValue></motorSettings><motorSettings><motorName>Y</motorName><motorValue>-0.085559</motorValue></motorSettings><motorSettings><motorName>Z</motorName><motorValue>0.659333</motorValue></motorSettings><comment>BCM query performed by STAC</comment></kappa_collect_settings>"
            % (omega.getValue(), kappa.getValue(), phi.getValue()))
        '''
Exemplo n.º 4
0
 def buildChildren(self, child_, nodeName_):
     if child_.nodeType == Node.ELEMENT_NODE and \
      nodeName_ == 'mxv1InputCharacterisation':
         obj_ = XSDataInputCharacterisation()
         obj_.build(child_)
         self.setMxv1InputCharacterisation(obj_)
     elif child_.nodeType == Node.ELEMENT_NODE and \
      nodeName_ == 'mxv1ResultCharacterisation_Reference':
         obj_ = XSDataResultCharacterisation()
         obj_.build(child_)
         self.setMxv1ResultCharacterisation_Reference(obj_)
     elif child_.nodeType == Node.ELEMENT_NODE and \
      nodeName_ == 'mxv2DataCollection':
         obj_ = XSDataCollection()
         obj_.build(child_)
         self.setMxv2DataCollection(obj_)
     elif child_.nodeType == Node.ELEMENT_NODE and \
      nodeName_ == 'mxv2DataCollection_Reference':
         obj_ = XSDataCollection()
         obj_.build(child_)
         self.setMxv2DataCollection_Reference(obj_)
     elif child_.nodeType == Node.ELEMENT_NODE and \
      nodeName_ == 'possibleOrientations':
         obj_ = kappa_alignment_response()
         obj_.build(child_)
         self.setPossibleOrientations(obj_)
     elif child_.nodeType == Node.ELEMENT_NODE and \
      nodeName_ == 'omega':
         obj_ = XSDataAngle()
         obj_.build(child_)
         self.setOmega(obj_)
     elif child_.nodeType == Node.ELEMENT_NODE and \
      nodeName_ == 'kappa':
         obj_ = XSDataAngle()
         obj_.build(child_)
         self.setKappa(obj_)
     elif child_.nodeType == Node.ELEMENT_NODE and \
      nodeName_ == 'phi':
         obj_ = XSDataAngle()
         obj_.build(child_)
         self.setPhi(obj_)
     XSDataInputInterface.buildChildren(self, child_, nodeName_)
 def setPluginInput(self, _edPlugin):
     EDApplicationMXv1Characterisation.setPluginInput(self, _edPlugin)
     if (not self.__strGeneratedTemplateFileMXv2 is None):
         _edPlugin.setDataInput(XSDataString(self.__strGeneratedTemplateFileMXv2), "generatedTemplateFileMXv2")
     if self.__bTemplateModeMXv2:
         # Delete the existing entry if any
         if _edPlugin.hasDataInput("templateMode"):
             _edPlugin.setDataInput(None, "templateMode")
         _edPlugin.setDataInput(XSDataBoolean(self.__bTemplateModeMXv2), "templateMode")
     if self.__strDataCollectionMXv2File:
         xsDataCollectionMXv2 = XSDataCollection_v2.parseFile(self.__strDataCollectionMXv2File)
         _edPlugin.setDataInput(xsDataCollectionMXv2, "mxv2DataCollection")
 def setPluginInput(self, _edPlugin):
     EDApplicationMXv1Characterisation.setPluginInput(self, _edPlugin)
     if (not self.__strGeneratedTemplateFileMXv2 is None):
         _edPlugin.setDataInput(
             XSDataString(self.__strGeneratedTemplateFileMXv2),
             "generatedTemplateFileMXv2")
     if self.__bTemplateModeMXv2:
         # Delete the existing entry if any
         if _edPlugin.hasDataInput("templateMode"):
             _edPlugin.setDataInput(None, "templateMode")
         _edPlugin.setDataInput(XSDataBoolean(self.__bTemplateModeMXv2),
                                "templateMode")
     if self.__strDataCollectionMXv2File:
         xsDataCollectionMXv2 = XSDataCollection_v2.parseFile(
             self.__strDataCollectionMXv2File)
         _edPlugin.setDataInput(xsDataCollectionMXv2, "mxv2DataCollection")