def testCheckParameters(self):
     xsDataInputJesf = XSDataInputJesf()
     numpyData = numpy.genfromtxt(os.path.join(self.getPluginTestsDataHome(),"spectra.dat"))
     xsDataArray = EDUtilsArray.arrayToXSData(numpyData)
     xsDataInputJesf.setData(xsDataArray)
     #print xsDataInputJesf.marshal()
     xsDataInputJesf.exportToFile(os.path.join(self.getPluginTestsDataHome(),"XSDataInputJesfv1_0_reference.xml"))
     edPluginExecJesf = self.createPlugin()
     edPluginExecJesf.setDataInput(xsDataInputJesf)
     edPluginExecJesf.checkParameters()
Ejemplo n.º 2
0
    def launchJesfPlugins(self, _numpyDataArray, _numpyEnergyCalibrationArray):
        listEdPluginExecJesf = []
        (iNoRows, iNoColumns) = _numpyDataArray.shape
        # Loop through all the columns of self.numpyInputArray
        for iColumn in range(iNoColumns):
            # Load the execution plugin
            edPluginExecJesf = self.loadPlugin(self.strJesfPluginName) 
            numpyArrayInputJesf = numpy.ndarray((iNoRows,2))
            numpyArrayInputJesf[:,0] = _numpyEnergyCalibrationArray
            numpyArrayInputJesf[:,1] = _numpyDataArray[:, iColumn]
#            print numpyArrayInputJesf
            xsDataInputJesf = XSDataInputJesf()
            xsDataInputJesf.data = EDUtilsArray.arrayToXSData(numpyArrayInputJesf)
#            print xsDataInputJesf.marshal()
            edPluginExecJesf.dataInput = xsDataInputJesf
#            self.edPluginExecJesf.executeSynchronous()
            listEdPluginExecJesf.append([iColumn, edPluginExecJesf])
            edPluginExecJesf.execute()
        # Synchronize all jobs
        self.screen("Synchronizing Jesf jobs")
        for listPlugin in listEdPluginExecJesf:
            listPlugin[1].synchronize()
        return listEdPluginExecJesf
Ejemplo n.º 3
0
 def launchJesfPlugins(self, _numpyDataArray, _numpyEnergyCalibrationArray):
     listEdPluginExecJesf = []
     (iNoRows, iNoColumns) = _numpyDataArray.shape
     # Loop through all the columns of self.numpyInputArray
     for iColumn in range(iNoColumns):
         # Load the execution plugin
         edPluginExecJesf = self.loadPlugin(self.strJesfPluginName)
         numpyArrayInputJesf = numpy.ndarray((iNoRows, 2))
         numpyArrayInputJesf[:, 0] = _numpyEnergyCalibrationArray
         numpyArrayInputJesf[:, 1] = _numpyDataArray[:, iColumn]
         #            print numpyArrayInputJesf
         xsDataInputJesf = XSDataInputJesf()
         xsDataInputJesf.data = EDUtilsArray.arrayToXSData(
             numpyArrayInputJesf)
         #            print xsDataInputJesf.marshal()
         edPluginExecJesf.dataInput = xsDataInputJesf
         #            self.edPluginExecJesf.executeSynchronous()
         listEdPluginExecJesf.append([iColumn, edPluginExecJesf])
         edPluginExecJesf.execute()
     # Synchronize all jobs
     self.screen("Synchronizing Jesf jobs")
     for listPlugin in listEdPluginExecJesf:
         listPlugin[1].synchronize()
     return listEdPluginExecJesf
 def testCheckParameters(self):
     xsDataInputJesf = XSDataInputJesf()
     numpyData = numpy.genfromtxt(
         os.path.join(self.getPluginTestsDataHome(), "spectra.dat"))
     xsDataArray = EDUtilsArray.arrayToXSData(numpyData)
     xsDataInputJesf.setData(xsDataArray)
     #print xsDataInputJesf.marshal()
     xsDataInputJesf.exportToFile(
         os.path.join(self.getPluginTestsDataHome(),
                      "XSDataInputJesfv1_0_reference.xml"))
     edPluginExecJesf = self.createPlugin()
     edPluginExecJesf.setDataInput(xsDataInputJesf)
     edPluginExecJesf.checkParameters()