本文整理汇总了Python中EDUtilsUnit.EDUtilsUnit.getValue方法的典型用法代码示例。如果您正苦于以下问题:Python EDUtilsUnit.getValue方法的具体用法?Python EDUtilsUnit.getValue怎么用?Python EDUtilsUnit.getValue使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类EDUtilsUnit.EDUtilsUnit
的用法示例。
在下文中一共展示了EDUtilsUnit.getValue方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: getInputParameter
# 需要导入模块: from EDUtilsUnit import EDUtilsUnit [as 别名]
# 或者: from EDUtilsUnit.EDUtilsUnit import getValue [as 别名]
def getInputParameter(self):
"""
Read all the input parameters and store them in instance variables called self.dictGeometry and self.pathToInputFile
"""
self.DEBUG("EDPluginSPDCakev1_5.getInputParameter")
EDPluginSPDCorrectv10.getInputParameter(self)
if self.xsDataInputSPD.getStartAzimuth() is not None:
if self.xsDataInputSPD.getStartAzimuth().getUnit() is not None:
self.dictGeometry["StartAzimuth"] = EDUtilsUnit.getValue(self.xsDataInputSPD.getStartAzimuth(), "deg")
else:
self.WARNING("You did not specify the StartAzimuth Unit, Falling back to Deg (not Rad)")
self.dictGeometry["StartAzimuth"] = self.xsDataInputSPD.getStartAzimuth().getValue()
if self.xsDataInputSPD.getStopAzimuth() is not None:
if self.xsDataInputSPD.getStopAzimuth().getUnit() is not None:
self.dictGeometry["StopAzimuth"] = EDUtilsUnit.getValue(self.xsDataInputSPD.getStopAzimuth(), "deg")
else:
self.WARNING("You did not specify the StopAzimuth Unit, Falling back to Deg (not Rad)")
self.dictGeometry["StopAzimuth"] = self.xsDataInputSPD.getStopAzimuth().getValue()
if self.xsDataInputSPD.getStepAzimuth() is not None:
if self.xsDataInputSPD.getStepAzimuth().getUnit() is not None:
self.dictGeometry["StepAzimuth"] = EDUtilsUnit.getValue(self.xsDataInputSPD.getStepAzimuth(), "deg")
else:
self.WARNING("You did not specify the StepAzimuth Unit, Falling back to Deg (not Rad)")
self.dictGeometry["StepAzimuth"] = self.xsDataInputSPD.getStepAzimuth().getValue()
if self.xsDataInputSPD.getInnerRadius() is not None:
self.dictGeometry["InnerRadius"] = self.xsDataInputSPD.getInnerRadius().getValue()
if self.xsDataInputSPD.getOuterRadius() is not None:
self.dictGeometry["OuterRadius"] = self.xsDataInputSPD.getOuterRadius().getValue()
if self.xsDataInputSPD.getOutputDirCake() is not None:
self.dictGeometry["OutputDirCake"] = self.xsDataInputSPD.getOutputDirCake().getPath().getValue()
EDUtilsPath.createFolder(self.dictGeometry["OutputDirCake"])
if self.dictGeometry["OutputDirCake"] != self.dictGeometry["OutputDir"]:
self.setFireAndForget(False)
else:
self.dictGeometry["OutputDirCake"] = self.dictGeometry["OutputDir"]
if self.xsDataInputSPD.getMaskFile() is not None:
self.dictGeometry["MaskFile"] = self.xsDataInputSPD.getMaskFile().getPath().getValue()
if not os.path.isfile(self.dictGeometry["MaskFile"]):
self.ERROR("Mask file %s does not exist " % self.dictGeometry["MaskFile"])
self.dictGeometry.pop("MaskFile")
if self.xsDataInputSPD.getIntensityScaleFactor() is not None:
self.dictGeometry["IntensityScaleFactor"] = self.xsDataInputSPD.getIntensityScaleFactor().getValue()
if self.xsDataInputSPD.getDeleteCorImg() is not None:
self.bDeleteCorImg = (self.xsDataInputSPD.getDeleteCorImg().getValue() in ["1", 1, "true", "True", True])
if self.bDeleteCorImg:
self.setFireAndForget(False)
if self.xsDataInputSPD.getCorrectTiltMask() is not None:
self.bCorrectTiltMask = bool(self.xsDataInputSPD.getCorrectTiltMask().getValue())
示例2: unitTestGetValueLength
# 需要导入模块: from EDUtilsUnit import EDUtilsUnit [as 别名]
# 或者: from EDUtilsUnit.EDUtilsUnit import getValue [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 ")
示例3: unitTestGetValueTime
# 需要导入模块: from EDUtilsUnit import EDUtilsUnit [as 别名]
# 或者: from EDUtilsUnit.EDUtilsUnit import getValue [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 ")
示例4: unitTestGetValueAngle
# 需要导入模块: from EDUtilsUnit import EDUtilsUnit [as 别名]
# 或者: from EDUtilsUnit.EDUtilsUnit import getValue [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 ")
示例5: getInputParameter
# 需要导入模块: from EDUtilsUnit import EDUtilsUnit [as 别名]
# 或者: from EDUtilsUnit.EDUtilsUnit import getValue [as 别名]
def getInputParameter(self, _edObject=None):
"""
Read all the input parameters and store them in instance variables called self.dictGeometry and self.pathToInputFile
"""
self.DEBUG("EDPluginSPDCorrectv10.getInputParameter")
self.xsDataInputSPD = self.getDataInput()
self.pathToInputFile = self.xsDataInputSPD.getInputFile().getPath().getValue()
if not os.path.isfile(self.pathToInputFile):
edStringErrorMessage = EDMessage.ERROR_CANNOT_READ_FILE_02 % (
self.getPluginName() + ".preProcess",
self.pathToInputFile,
)
self.error(edStringErrorMessage)
self.addErrorMessage(edStringErrorMessage)
raise RuntimeError, edStringErrorMessage
if self.xsDataInputSPD.getDarkCurrentImageFile() is not None:
pathToDarkCurrentImageFile = self.xsDataInputSPD.getDarkCurrentImageFile().getPath().getValue()
if os.path.isfile(pathToDarkCurrentImageFile):
self.dictGeometry["DarkCurrentImageFile"] = pathToDarkCurrentImageFile
else:
edStringErrorMessage = EDMessage.ERROR_CANNOT_READ_FILE_02 % (
self.getPluginName() + ".preProcess",
pathToDarkCurrentImageFile,
)
self.error(edStringErrorMessage)
self.addErrorMessage(edStringErrorMessage)
self.addErrorMessage(edStringErrorMessage)
raise RuntimeError, edStringErrorMessage
if self.xsDataInputSPD.getFlatFieldImageFile() is not None:
pathToFlatFieldImageFile = self.xsDataInputSPD.getFlatFieldImageFile().getPath().getValue()
if os.path.isfile(pathToFlatFieldImageFile):
self.dictGeometry["FlatFieldImageFile"] = pathToFlatFieldImageFile
else:
edStringErrorMessage = EDMessage.ERROR_CANNOT_READ_FILE_02 % (
self.getPluginName() + ".preProcess",
pathToFlatFieldImageFile,
)
self.error(edStringErrorMessage)
self.addErrorMessage(edStringErrorMessage)
raise RuntimeError, edStringErrorMessage
if self.xsDataInputSPD.getSpatialDistortionFile() is not None:
pathToSpatialDistortionFile = self.xsDataInputSPD.getSpatialDistortionFile().getPath().getValue()
if os.path.isfile(pathToSpatialDistortionFile):
self.dictGeometry["SpatialDistortionFile"] = pathToSpatialDistortionFile
else:
edStringErrorMessage = EDMessage.ERROR_CANNOT_READ_FILE_02 % (
self.getPluginName() + ".preProcess",
pathToSpatialDistortionFile,
)
self.error(edStringErrorMessage)
self.addErrorMessage(edStringErrorMessage)
raise RuntimeError, edStringErrorMessage
if self.xsDataInputSPD.getAngleOfTilt() is not None:
if self.xsDataInputSPD.getAngleOfTilt().getUnit() is not None:
self.dictGeometry["AngleOfTilt"] = EDUtilsUnit.getValue(self.xsDataInputSPD.getAngleOfTilt(), "deg")
else: # Fall-back by default to deg
self.WARNING("You did not specify the AngleOfTilt unit ... I Guess it is deg")
self.dictGeometry["AngleOfTilt"] = self.xsDataInputSPD.getAngleOfTilt().getValue()
else:
self.dictGeometry["AngleOfTilt"] = 0
if self.xsDataInputSPD.getTiltRotation() is not None:
if self.xsDataInputSPD.getTiltRotation().getUnit() is not None:
self.dictGeometry["TiltRotation"] = EDUtilsUnit.getValue(self.xsDataInputSPD.getTiltRotation(), "deg")
else: # Fall-back by default to deg
self.WARNING("You did not specify the TiltRotation unit ... I Guess it is deg")
self.dictGeometry["TiltRotation"] = self.xsDataInputSPD.getTiltRotation().getValue()
else:
self.dictGeometry["TiltRotation"] = 0
if self.xsDataInputSPD.getBeamCentreInPixelsX() is not None:
self.dictGeometry["BeamCenterX"] = self.xsDataInputSPD.getBeamCentreInPixelsX().getValue()
if self.xsDataInputSPD.getBeamCentreInPixelsY() is not None:
self.dictGeometry["BeamCenterY"] = self.xsDataInputSPD.getBeamCentreInPixelsY().getValue()
if self.xsDataInputSPD.getBufferSizeX() is not None:
self.dictGeometry["BufferSizeX"] = self.xsDataInputSPD.getBufferSizeX().getValue()
if self.xsDataInputSPD.getBufferSizeY() is not None:
self.dictGeometry["BufferSizeY"] = self.xsDataInputSPD.getBufferSizeY().getValue()
if self.xsDataInputSPD.getDistortionFileX() is not None:
pathToDistortionFileX = self.xsDataInputSPD.getDistortionFileX().getPath().getValue()
if os.path.isfile(pathToDistortionFileX):
self.dictGeometry["DistortionFileX"] = pathToDistortionFileX
else:
edStringErrorMessage = EDMessage.ERROR_CANNOT_READ_FILE_02 % (
self.getPluginName() + ".preProcess",
pathToDistortionFileX,
)
self.error(edStringErrorMessage)
self.addErrorMessage(edStringErrorMessage)
raise RuntimeError, edStringErrorMessage
if self.xsDataInputSPD.getDistortionFileY() is not None:
pathToDistortionFileY = self.xsDataInputSPD.getDistortionFileY().getPath().getValue()
if os.path.isfile(pathToDistortionFileY):
self.dictGeometry["DistortionFileY"] = pathToDistortionFileY
else:
edStringErrorMessage = EDMessage.ERROR_CANNOT_READ_FILE_02 % (
self.getPluginName() + ".preProcess",
pathToDistortionFileY,
)
self.error(edStringErrorMessage)
#.........这里部分代码省略.........