示例#1
0
    def getXSDataInputFIT2DCake(self, _xsDataInputPowderIntegration):
        """
        """

        xsDataInputFIT2DCake = XSDataInputFIT2DCake()

        imageFile = _xsDataInputPowderIntegration.getImageFile()
        instrumentParameters = _xsDataInputPowderIntegration.getInstrumentParameters(
        )
        imageParameters = _xsDataInputPowderIntegration.getImageParameters()

        xsDataInputFIT2DCake.setInputFile(imageFile)

        xsDataInputFIT2DCake.setWavelength(
            instrumentParameters.get_diffrn_radiation_wavelength())
        xsDataInputFIT2DCake.setSampleToDetectorDistance(
            instrumentParameters.get_pd_instr_dist_spec_detc())

        xsDataInputFIT2DCake.setAngleOfTilt(
            imageParameters.get_pd_instr_special_details_tilt_angle())
        xsDataInputFIT2DCake.setTiltRotation(
            imageParameters.get_pd_instr_special_details_tilt_rotation())

        xsDataInputFIT2DCake.setDarkCurrentImageFile(
            imageParameters.get_file_correction_image_dark_current())
        xsDataInputFIT2DCake.setFlatFieldImageFile(
            imageParameters.get_file_correction_image_flat_field())
        xsDataInputFIT2DCake.setSpatialDistortionFile(
            imageParameters.get_file_correction_spline_spatial_distortion())

        fBeamCentreInMillimetersX = imageParameters.get_diffrn_detector_element_center_1(
        ).getValue()
        fBeamCentreInMillimetersY = imageParameters.get_diffrn_detector_element_center_2(
        ).getValue()
        fPixelSizeInMetersX = imageParameters.get_array_element_size_1(
        ).getValue()
        fPixelSizeInMetersY = imageParameters.get_array_element_size_2(
        ).getValue()
        xsDataInputFIT2DCake.setBeamCentreInPixelsX(
            XSDataLength(fBeamCentreInMillimetersX / fPixelSizeInMetersX /
                         1000))
        xsDataInputFIT2DCake.setBeamCentreInPixelsY(
            XSDataLength(fBeamCentreInMillimetersY / fPixelSizeInMetersX /
                         1000))
        xsDataInputFIT2DCake.setPixelSizeX(
            XSDataLength(fPixelSizeInMetersX * 1000))
        xsDataInputFIT2DCake.setPixelSizeY(
            XSDataLength(fPixelSizeInMetersY * 1000))

        xsDataInputFIT2DCake.setBufferSizeX(XSDataInteger(2048))
        xsDataInputFIT2DCake.setBufferSizeY(XSDataInteger(2048))
        xsDataInputFIT2DCake.setOutputFileType(XSDataString("CHIPLOT"))

        return xsDataInputFIT2DCake
 def testGenerateXSDataInputFIT2DCake(self):
     strReferenceInputFile = os.path.join(self.m_strDataPath, "XSDataInputPowderDiffraction_reference.xml")
     strXMLInput = EDUtilsTest.readAndParseFile(strReferenceInputFile)
     EDApplication.loadModule("XSDataDiffractionCTv1")
     from XSDataDiffractionCTv1 import XSDataInputPowderIntegration
     xsDataInputPowderIntegration = XSDataInputPowderIntegration.parseString(strXMLInput)
     from EDHandlerXSDataFIT2Dv1_0 import EDHandlerXSDataFIT2Dv1_0
     edHandlerXSDataFIT2Dv1_0 = EDHandlerXSDataFIT2Dv1_0()
     xsDataInputFIT2DCake = edHandlerXSDataFIT2Dv1_0.getXSDataInputFIT2DCake(xsDataInputPowderIntegration)
     strReferencePath = os.path.join(self.m_strDataPath, "XSDataInputFIT2DCake_reference.xml")
     strXMLInputReference = EDUtilsTest.readAndParseFile(strReferencePath)
     EDApplication.loadModule("XSDataFIT2Dv1_0")
     from XSDataFIT2Dv1_0 import XSDataInputFIT2DCake
     xsDataInputFIT2DCakeReference = XSDataInputFIT2DCake.parseString(strXMLInputReference)
     EDAssert.equal(xsDataInputFIT2DCakeReference.marshal(), xsDataInputFIT2DCake.marshal())
 def testGenerateXSDataInputFIT2DCake(self):
     strReferenceInputFile = os.path.join(
         self.m_strDataPath, "XSDataInputPowderDiffraction_reference.xml")
     strXMLInput = EDUtilsTest.readAndParseFile(strReferenceInputFile)
     EDApplication.loadModule("XSDataDiffractionCTv1")
     from XSDataDiffractionCTv1 import XSDataInputPowderIntegration
     xsDataInputPowderIntegration = XSDataInputPowderIntegration.parseString(
         strXMLInput)
     from EDHandlerXSDataFIT2Dv1_0 import EDHandlerXSDataFIT2Dv1_0
     edHandlerXSDataFIT2Dv1_0 = EDHandlerXSDataFIT2Dv1_0()
     xsDataInputFIT2DCake = edHandlerXSDataFIT2Dv1_0.getXSDataInputFIT2DCake(
         xsDataInputPowderIntegration)
     strReferencePath = os.path.join(self.m_strDataPath,
                                     "XSDataInputFIT2DCake_reference.xml")
     strXMLInputReference = EDUtilsTest.readAndParseFile(strReferencePath)
     EDApplication.loadModule("XSDataFIT2Dv1_0")
     from XSDataFIT2Dv1_0 import XSDataInputFIT2DCake
     xsDataInputFIT2DCakeReference = XSDataInputFIT2DCake.parseString(
         strXMLInputReference)
     EDAssert.equal(xsDataInputFIT2DCakeReference.marshal(),
                    xsDataInputFIT2DCake.marshal())
示例#4
0
 def testCheckParameters(self):
     edPluginFIT2D = self.createPlugin()
     edStringXMLInput = EDUtilsTest.readAndParseFile(self.m_edStringReferenceInputFileName)
     xsDataInputFIT2DCake = XSDataInputFIT2DCake.parseString(edStringXMLInput)
     edPluginFIT2D.setDataInput(xsDataInputFIT2DCake)
     edPluginFIT2D.checkParameters()