當前位置: 首頁>>代碼示例>>Python>>正文


Python EDUtilsUnit.toXSD方法代碼示例

本文整理匯總了Python中EDUtilsUnit.EDUtilsUnit.toXSD方法的典型用法代碼示例。如果您正苦於以下問題:Python EDUtilsUnit.toXSD方法的具體用法?Python EDUtilsUnit.toXSD怎麽用?Python EDUtilsUnit.toXSD使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在EDUtilsUnit.EDUtilsUnit的用法示例。


在下文中一共展示了EDUtilsUnit.toXSD方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: unitTestToXSD

# 需要導入模塊: from EDUtilsUnit import EDUtilsUnit [as 別名]
# 或者: from EDUtilsUnit.EDUtilsUnit import toXSD [as 別名]
 def unitTestToXSD(self):
     """
     """
     EDVerbose.DEBUG("EDTestCaseEDUtilsUnit.unitTestToXSD")
     xsdObt = EDUtilsUnit.toXSD(XSDataLength, "1.5 mm")
     xsdExp = XSDataLength(1.5)
     xsdExp.setUnit(XSDataString("mm"))
     EDAssert.equal(xsdExp.marshal(), xsdObt.marshal(), "XML representation are the same")
開發者ID:gbourgh,項目名稱:edna,代碼行數:10,代碼來源:EDTestCaseEDUtilsUnit.py

示例2: unitTestGetValueLength

# 需要導入模塊: from EDUtilsUnit import EDUtilsUnit [as 別名]
# 或者: from EDUtilsUnit.EDUtilsUnit import toXSD [as 別名]
 def unitTestGetValueLength(self):
     """
     Test conversion in length 
     """
     EDVerbose.DEBUG("EDTestCaseEDUtilsUnit.unitTestGetValueLength")
     EDAssert.equal(0.0452, EDUtilsUnit.getValue(EDUtilsUnit.toXSD(XSDataLength, "45.2 um"), "mm"), "Length Conversion um -> mm ")
開發者ID:gbourgh,項目名稱:edna,代碼行數:8,代碼來源:EDTestCaseEDUtilsUnit.py

示例3: unitTestGetValueAngle

# 需要導入模塊: from EDUtilsUnit import EDUtilsUnit [as 別名]
# 或者: from EDUtilsUnit.EDUtilsUnit import toXSD [as 別名]
 def unitTestGetValueAngle(self):
     """
     Test conversion in length 
     """
     EDVerbose.DEBUG("EDTestCaseEDUtilsUnit.unitTestGetValueAngle")
     EDAssert.equal(100.0, EDUtilsUnit.getValue(EDUtilsUnit.toXSD(XSDataAngle, "90 deg"), "grad"), "Length Conversion deg -> grad ")
開發者ID:gbourgh,項目名稱:edna,代碼行數:8,代碼來源:EDTestCaseEDUtilsUnit.py

示例4: unitTestGetValueTime

# 需要導入模塊: from EDUtilsUnit import EDUtilsUnit [as 別名]
# 或者: from EDUtilsUnit.EDUtilsUnit import toXSD [as 別名]
 def unitTestGetValueTime(self):
     """
     Test conversion in Time 
     """
     EDVerbose.DEBUG("EDTestCaseEDUtilsUnit.unitTestGetValueTime")
     EDAssert.equal(60.0, EDUtilsUnit.getValue(EDUtilsUnit.toXSD(XSDataTime, "1 h"), "mn"), "Length Conversion h -> mn ")
開發者ID:gbourgh,項目名稱:edna,代碼行數:8,代碼來源:EDTestCaseEDUtilsUnit.py

示例5: doSuccessReadHeader

# 需要導入模塊: from EDUtilsUnit import EDUtilsUnit [as 別名]
# 或者: from EDUtilsUnit.EDUtilsUnit import toXSD [as 別名]
    def doSuccessReadHeader(self, _edPlugin=None):
        EDVerbose.DEBUG("EDPluginControlDiffractionCTv1_1.doSuccessReadHeader")
        self.retrieveSuccessMessages(_edPlugin, "EDPluginControlDiffractionCTv1_1.doSuccessReadHeader")
        # Translate dictionary to image and instrument objects
        xsDataInputPowderIntegration = XSDataInputPowderIntegration()
        self.xsDataDiffractionCTInstrument = XSDataDiffractionCTInstrument()
        self.xsDataDiffractionCTImage = XSDataDiffractionCTImage()
        xsDataDictionaryHeader = self.edPluginReadHeader.getDataOutput().getDictionary()
        for xsDataKeyValuePair in xsDataDictionaryHeader.getKeyValuePair():
            strKey = str(xsDataKeyValuePair.getKey().getValue())
            lstValue = xsDataKeyValuePair.getValue().getValue().split()
            if len(lstValue) == 2:
                strValue = lstValue[0]
                strUnit = lstValue[1]
            else:
                strValue = xsDataKeyValuePair.getValue().getValue()
                strUnit = None

            if (strKey == "_diffrn_radiation_wavelength"):
                xsd = EDUtilsUnit.toXSD(XSDataWavelength, strValue)
#                if strUnit is None: strUnit = "A"
#                xsd.setUnit(XSDataString(strUnit))
                self.xsDataDiffractionCTInstrument.set_diffrn_radiation_wavelength(xsd)
            elif (strKey == "_pd_instr_dist_spec/detc"):
                xsd = EDUtilsUnit.toXSD(XSDataLength, strValue)
#                if strUnit is None: strUnit = "mm"
#                xsd.setUnit(XSDataString(strUnit))
                self.xsDataDiffractionCTInstrument.set_pd_instr_dist_spec_detc(xsd)
            elif (strKey == "_pd_meas_2theta_range_max"):
                xsd = XSDataAngle(float(strValue))
                if strUnit is None: strUnit = "deg"
                xsd.setUnit(XSDataString(strUnit))
                self.xsDataDiffractionCTInstrument.set_pd_meas_2theta_range_max(xsd)
            elif (strKey == "_pd_meas_2theta_range_min"):
                xsd = XSDataAngle(float(strValue))
                if strUnit is None: strUnit = "deg"
                xsd.setUnit(XSDataString(strUnit))
                self.xsDataDiffractionCTInstrument.set_pd_meas_2theta_range_min(xsd)
            elif (strKey == "_pd_meas_2theta_range_inc"):
                xsd = XSDataAngle(float(strValue))
                if strUnit is None: strUnit = "deg"
                xsd.setUnit(XSDataString(strUnit))
                self.xsDataDiffractionCTInstrument.set_pd_meas_2theta_range_inc(xsd)
            elif (strKey == "_synchrotron_photon-flux"):
                self.xsDataDiffractionCTInstrument.set_synchrotron_photon_flux(XSDataFlux(float(strValue)))
            elif (strKey == "_synchrotron_ring-intensity"):
                self.xsDataDiffractionCTInstrument.set_synchrotron_ring_intensity(XSDataDouble(float(strValue)))
            elif (strKey == "_tomo_scan_ampl"):
                xsd = XSDataAngle(float(strValue))
                if strUnit is None: strUnit = "deg"
                xsd.setUnit(XSDataString(strUnit))
                self.xsDataDiffractionCTInstrument.set_tomo_scan_ampl(xsd)
            elif (strKey == "_tomo_scan_type"):
                self.xsDataDiffractionCTInstrument.set_tomo_scan_type(XSDataString(strValue))
            elif (strKey == "_tomo_spec_displ_rotation"):
                xsd = XSDataAngle(float(strValue))
                if strUnit is None: strUnit = "deg"
                xsd.setUnit(XSDataString(strUnit))
                self.xsDataDiffractionCTInstrument.set_tomo_spec_displ_rotation(xsd)
            elif (strKey == "_tomo_spec_displ_rotation_inc"):
                xsd = XSDataAngle(float(strValue))
                if strUnit is None: strUnit = "deg"
                xsd.setUnit(XSDataString(strUnit))
                self.xsDataDiffractionCTInstrument.set_tomo_spec_displ_rotation_inc(xsd)
            elif (strKey == "_tomo_spec_displ_x"):
                xsd = EDUtilsUnit.toXSD(XSDataLength, strValue)
#                if strUnit is None: strUnit = "mm"
#                xsd.setUnit(XSDataString(strUnit))
                self.xsDataDiffractionCTInstrument.set_tomo_spec_displ_x(xsd)
            elif (strKey == "_tomo_spec_displ_x_inc"):
                xsd = EDUtilsUnit.toXSD(XSDataLength, strValue)
#                if strUnit is None: strUnit = "mm"
#                xsd.setUnit(XSDataString(strUnit))
                self.xsDataDiffractionCTInstrument.set_tomo_spec_displ_x_inc(xsd)
            elif (strKey == "_tomo_spec_displ_x_max"):
                xsd = XSDataLength(float(strValue))
                if strUnit is None: strUnit = "mm"
                xsd.setUnit(XSDataString(strUnit))
                self.xsDataDiffractionCTInstrument.set_tomo_spec_displ_x_max(xsd)
            elif (strKey == "_tomo_spec_displ_x_min"):
                xsd = XSDataLength(float(strValue))
                if strUnit is None: strUnit = "mm"
                xsd.setUnit(XSDataString(strUnit))
                self.xsDataDiffractionCTInstrument.set_tomo_spec_displ_x_min(xsd)
            elif (strKey == "_tomo_spec_displ_z"):
                xsd = XSDataLength(float(strValue))
                if strUnit is None: strUnit = "mm"
                xsd.setUnit(XSDataString(strUnit))
                self.xsDataDiffractionCTInstrument.set_tomo_spec_displ_z(xsd)
            elif (strKey == "_tomo_spec_displ_z_inc"):
                xsd = XSDataLength(float(strValue))
                if strUnit is None: strUnit = "mm"
                xsd.setUnit(XSDataString(strUnit))
                self.xsDataDiffractionCTInstrument.set_tomo_spec_displ_z_inc(xsd)
            elif (strKey == "_tomo_spec_displ_z_max"):
                xsd = XSDataLength(float(strValue))
                if strUnit is None: strUnit = "mm"
                xsd.setUnit(XSDataString(strUnit))
                self.xsDataDiffractionCTInstrument.set_tomo_spec_displ_z_max(xsd)
            elif (strKey == "_tomo_spec_displ_z_min"):
#.........這裏部分代碼省略.........
開發者ID:gbourgh,項目名稱:edna,代碼行數:103,代碼來源:EDPluginControlDiffractionCTv1_1.py


注:本文中的EDUtilsUnit.EDUtilsUnit.toXSD方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。