예제 #1
0
 def getTestsDataImagesHome(self):
     """
     Returns the Test data home directory
     @return: TestsDataImagesHome
     @rtype: string
     """
     if (self.__strTestsDataImagesHome is None):
         self.__strTestsDataImagesHome = EDUtilsTest.getTestsDataImagesHome()
     return self.__strTestsDataImagesHome
 def __init__(self, _edStringTestName=None):
     EDTestCasePluginUnit.__init__(self, "EDPluginControlID11v1_0")
     self.dictID11Reference = {
         "1 DEGREE AZ": "NO",
         "ANGLE OF TILT": "-0.63004673688",
         "AZIMUTH BINS": "36",
         "CONSERVE INT.": "NO",
         "DARK CURRENT": "YES",
         "DC FILE": os.path.join(EDUtilsTest.getTestsDataImagesHome(), "ID11-Dark.edf"),
         "DIM1_DATA": "2048",
         "DIM2_DATA": "2048",
         "DISTANCE": "136.908",
         "END AZIMUTH": "360",
         "FF FILE": os.path.join(EDUtilsTest.getTestsDataImagesHome(), "ID11-Flat.edf"),
         "FF MULTIPLIER": "1000.000",
         "FF SCALE": "NO",
         "FLAT-FIELD": "YES",
         "GEOMETRY COR.": "YES",
         "INNER RADIUS": "5",
         "MASK FILE": "None",
         "OUTER RADIUS": "1000",
         "POLARISATION": "YES",
         "RADIAL BINS": "20",
         "SCAN TYPE": "2-THETA",
         "SD FILE": os.path.join(EDUtilsTest.getTestsDataImagesHome(), "ID11-Frelon.spline"),
         "SPATIAL DIS.": "YES",
         "START AZIMUTH": "0.0",
         "TILT ROTATION": "-2.51342948328",
         "USE MASK": "NO",
         "WAVELENGTH": "0.2952",
         "X-BEAM CENTRE": "1002.509",
         "X-PIXEL SIZE": "50",
         "Y-BEAM CENTRE": "999.6282",
         "Y-PIXEL SIZE": "50",
         "input_extn": "edf",
         "output_extn": "spr",
         "saving_format": "SPREAD SHEET",
         "output_dir": "/tmp/edna-" + os.environ["USER"],
     }
예제 #3
0
 def parseParameterFiles(self, _strPath):
     """
     parses Configuration file
     """
     self.DEBUG("EDPluginControlID11v1_0.parseParameterFiles")
     self.__dictID11 = {}
     dictSub = {"${TEST_DATA_IMAGES_HOME}": EDUtilsTest.getTestsDataImagesHome()}
     for linefile in EDUtilsFile.readFileAndParseVariables(_strPath, dictSub).split("\n"):
         strLineData = linefile.strip()
         #discard comment lines 
         if not strLineData.startswith('#') :
             #  discard end line carriage return
             splited = strLineData.split("=", 1)
             if len(splited) == 2:
                 self.__dictID11[splited[0].strip()] = splited[1].strip()
     return self.__dictID11
예제 #4
0
 def parseParameterFiles(self, _strPath):
     """
     parses Configuration file
     """
     self.DEBUG("EDPluginControlID11v1_0.parseParameterFiles")
     self.__dictID11 = {}
     dictSub = {
         "${TEST_DATA_IMAGES_HOME}": EDUtilsTest.getTestsDataImagesHome()
     }
     for linefile in EDUtilsFile.readFileAndParseVariables(
             _strPath, dictSub).split("\n"):
         strLineData = linefile.strip()
         #discard comment lines
         if not strLineData.startswith('#'):
             #  discard end line carriage return
             splited = strLineData.split("=", 1)
             if len(splited) == 2:
                 self.__dictID11[splited[0].strip()] = splited[1].strip()
     return self.__dictID11
예제 #5
0
    def preProcess(self):
        """
        PreProcess of the execution test: download an EDF file from http://www.edna-site.org
        and remove any existing output file, i.e. /tmp/diff6105.edf 
        """
        EDTestCasePluginExecute.preProcess(self)
        self.loadTestImage([ "test_region1_dark_1_0040.edf"])

        xsDataInputReference = XSDataInputExecCommandLine.parseString(self.readAndParseFile (self.getDataInputFile()))
        strInputFile = xsDataInputReference.getInputFileName().getPath().getValue()
        if not(os.path.isdir(os.path.dirname(strInputFile))):
            os.makedirs(os.path.dirname(strInputFile), int("777", 8))
        EDVerbose.DEBUG("temporary filename is :" + strInputFile)
        shutil.copy(os.path.join(EDUtilsTest.getTestsDataImagesHome(), "test_region1_dark_1_0040.edf"), strInputFile)
        strInputXML = self.readAndParseFile (self.getDataInputFile())
        xsDataInputReference = XSDataInputExecCommandLine.parseString(strInputXML)
        outputFileName = xsDataInputReference.getInputFileName().getPath().getValue() + ".gz"
        EDVerbose.DEBUG(" Output file is %s" % outputFileName)
        if os.path.isfile(outputFileName):
            EDVerbose.DEBUG(" Output file exists %s, I will remove it" % outputFileName)
            os.remove(outputFileName)
 def __init__(self, _edStringTestName=None):
     EDTestCasePluginUnit.__init__(self, "EDPluginControlID11v1_0")
     self.dictID11Reference = {
         '1 DEGREE AZ':
         'NO',
         'ANGLE OF TILT':
         '-0.63004673688',
         'AZIMUTH BINS':
         '36',
         'CONSERVE INT.':
         'NO',
         'DARK CURRENT':
         'YES',
         'DC FILE':
         os.path.join(EDUtilsTest.getTestsDataImagesHome(),
                      "ID11-Dark.edf"),
         'DIM1_DATA':
         '2048',
         'DIM2_DATA':
         '2048',
         'DISTANCE':
         '136.908',
         'END AZIMUTH':
         '360',
         'FF FILE':
         os.path.join(EDUtilsTest.getTestsDataImagesHome(),
                      "ID11-Flat.edf"),
         'FF MULTIPLIER':
         '1000.000',
         'FF SCALE':
         'NO',
         'FLAT-FIELD':
         'YES',
         'GEOMETRY COR.':
         'YES',
         'INNER RADIUS':
         '5',
         'MASK FILE':
         'None',
         'OUTER RADIUS':
         '1000',
         'POLARISATION':
         'YES',
         'RADIAL BINS':
         '20',
         'SCAN TYPE':
         '2-THETA',
         'SD FILE':
         os.path.join(EDUtilsTest.getTestsDataImagesHome(),
                      "ID11-Frelon.spline"),
         'SPATIAL DIS.':
         'YES',
         'START AZIMUTH':
         '0.0',
         'TILT ROTATION':
         '-2.51342948328',
         'USE MASK':
         'NO',
         'WAVELENGTH':
         '0.2952',
         'X-BEAM CENTRE':
         '1002.509',
         'X-PIXEL SIZE':
         '50',
         'Y-BEAM CENTRE':
         '999.6282',
         'Y-PIXEL SIZE':
         '50',
         'input_extn':
         'edf',
         'output_extn':
         'spr',
         'saving_format':
         'SPREAD SHEET',
         'output_dir':
         "/tmp/edna-" + os.environ["USER"]
     }