Ejemplo n.º 1
0
    def setUp(self):
        unittest.TestCase.setUp(self)

        self.filepath = get_current_module_path(__file__, "../../test_data/k3670_30keV_OFeCalibration.csp")
        if not is_test_data_file(self.filepath):
            raise SkipTest

        self.gpFile = genesisPolarisFile.GenesisPolarisFile()
    def setUp(self):
        unittest.TestCase.setUp(self)

        self.filepath = get_current_module_path(__file__,
                                                "../../test_data/test01.trc")
        if not is_test_data_file(self.filepath):
            raise SkipTest

        self.traceFile = TraceFile.TraceFile(self.filepath)
    def setUp(self):
        unittest.TestCase.setUp(self)

        self.filepath = get_current_module_path(
            __file__, "../../../test_data/SpectrumProcessing 10.txt")
        if not is_test_data_file(self.filepath):
            raise SkipTest

        self.results = ReadSpectrumProcessingResults.ReadSpectrumProcessingResults(
            self.filepath)
    def setUp(self):
        unittest.TestCase.setUp(self)

        self.filepathRef = get_current_module_path(__file__, "../../test_data/TEM_Edax/OVERALL.CSV")
        if not is_test_data_file(self.filepathRef):
            raise SkipTest

        self.data = TemCsvFile.TemCsvFile(self.filepathRef)

        self.numberPoints = 1024
Ejemplo n.º 5
0
    def setUp(self):
        warnings.simplefilter("ignore")

        unittest.TestCase.setUp(self)

        projectPath = get_current_module_path(__file__)

        self.filename = os.path.join(projectPath,
                                     "../../test_data/data0407.ful")
        if not is_test_data_file(self.filename):
            raise SkipTest

        self.linescanFile = JEOL8900McGill.JEOL8900McGill(self.filename)
    def test_read(self):
        filename = "Sample01.rpl"
        filepath = os.path.join(self.path, filename)
        if not is_test_data_file(filepath):
            raise SkipTest

        parameters = ParametersFile.ParametersFile()
        parameters.read(filepath)

        self.assertEquals(1024, parameters.width)
        self.assertEquals(768, parameters.height)
        self.assertEquals(2048, parameters.depth)
        self.assertEquals(0, parameters.offset)
        self.assertEquals(1, parameters.dataLength_B)
        self.assertEquals(ParametersFile.DATA_TYPE_UNSIGNED,
                          parameters.dataType)
        self.assertEquals(ParametersFile.BYTE_ORDER_DONT_CARE,
                          parameters.byteOrder)
        self.assertEquals("vector", parameters.recordBy)
Ejemplo n.º 7
0
    def test_is_test_data_file(self):
        self.assertFalse(is_test_data_file(self.file_path))

        self.assertFalse(is_test_data_file(get_current_module_path(__file__)))

        self.assertTrue(is_test_data_file(__file__))
Ejemplo n.º 8
0
    def test_read(self):
        filename = "Map30kV.rpl"
        filepath = os.path.join(self.path, filename)
        if not is_test_data_file(filepath):
            raise SkipTest

        parameters = ParametersFile.ParametersFile()
        parameters.read(filepath)

        self.assertEquals(512, parameters.width)
        self.assertEquals(384, parameters.height)
        self.assertEquals(2048, parameters.depth)
        self.assertEquals(0, parameters.offset)
        self.assertEquals(1, parameters.dataLength_B)
        self.assertEquals(ParametersFile.DATA_TYPE_UNSIGNED,
                          parameters.dataType)
        self.assertEquals(ParametersFile.BYTE_ORDER_DONT_CARE,
                          parameters.byteOrder)
        self.assertEquals("IMAGE \"Site of Interest 1\"", parameters.recordBy)

        filename = "Project 1.rpl"
        filepath = os.path.join(self.path, filename)

        parameters = ParametersFile.ParametersFile()
        parameters.read(filepath)

        self.assertEquals(512, parameters.width)
        self.assertEquals(384, parameters.height)
        self.assertEquals(2048, parameters.depth)
        self.assertEquals(0, parameters.offset)
        self.assertEquals(2, parameters.dataLength_B)
        self.assertEquals(ParametersFile.DATA_TYPE_SIGNED, parameters.dataType)
        self.assertEquals(ParametersFile.BYTE_ORDER_LITTLE_ENDIAN,
                          parameters.byteOrder)
        self.assertEquals("IMAGE \"Site of Interest 1\"", parameters.recordBy)

        filename = "mapSOI_15.rpl"
        filepath = os.path.join(self.path, filename)

        parameters = ParametersFile.ParametersFile()
        parameters.read(filepath)

        self.assertEquals(512, parameters.width)
        self.assertEquals(384, parameters.height)
        self.assertEquals(2048, parameters.depth)
        self.assertEquals(0, parameters.offset)
        self.assertEquals(4, parameters.dataLength_B)
        self.assertEquals(ParametersFile.DATA_TYPE_SIGNED, parameters.dataType)
        self.assertEquals(ParametersFile.BYTE_ORDER_LITTLE_ENDIAN,
                          parameters.byteOrder)
        self.assertEquals("IMAGE \"Site of Interest 15\"", parameters.recordBy)

        filename = "mapSOI14.rpl"
        filepath = os.path.join(self.path, filename)

        parameters = ParametersFile.ParametersFile()
        parameters.read(filepath)

        self.assertEquals(512, parameters.width)
        self.assertEquals(384, parameters.height)
        self.assertEquals(2048, parameters.depth)
        self.assertEquals(0, parameters.offset)
        self.assertEquals(4, parameters.dataLength_B)
        self.assertEquals(ParametersFile.DATA_TYPE_SIGNED, parameters.dataType)
        self.assertEquals(ParametersFile.BYTE_ORDER_LITTLE_ENDIAN,
                          parameters.byteOrder)
        self.assertEquals("IMAGE \"Site of Interest 14\"", parameters.recordBy)