Exemplo n.º 1
0
 def test_execute_DozorM(self):
     referenceDataPath = self.dataPath / 'inDataDozorM.json'
     inData = UtilsTest.loadAndSubstitueTestData(referenceDataPath)
     dozorm = DozorM(inData=inData)
     dozorm.execute()
     self.assertTrue(dozorm.isSuccess())
     outData = dozorm.outData
Exemplo n.º 2
0
 def test_execute_id23eh3_mesh1_dozorm(self):
     referenceDataPath = self.dataPath / 'opid23eh1_mesh3_dozorm.json'
     inData = UtilsTest.loadAndSubstitueTestData(referenceDataPath)
     dozorm = DozorM(inData=inData, workingDirectorySuffix="id23eh1_mesh3")
     dozorm.execute()
     self.assertTrue(dozorm.isSuccess())
     outData = dozorm.outData
Exemplo n.º 3
0
 def test_unit_DozorM_makePlots_id30a2(self):
     tmpDir = tempfile.mkdtemp(prefix="test_unit_DozorM_makePlots_")
     mapPath = self.dataPath / 'opid30a2_line_dozorm.map'
     dictMap = DozorM.parseMap(mapPath)
     imagePath = DozorM.makeCrystalPlot(dictMap["crystal"],
                                        tmpDir,
                                        debug=False)
     shutil.rmtree(tmpDir)
Exemplo n.º 4
0
 def test_unit_DozorM_parseDozorm_1D_1(self):
     logPath = self.dataPath / 'opid23eh1_mesh1_dozorm.log'
     listPositions = DozorM.parseDozormLogFile(logPath)
     self.assertEqual(len(listPositions), 2)
     logPath = self.dataPath / 'opid23eh1_mesh3_dozorm.log'
     listPositions = DozorM.parseDozormLogFile(logPath)
     self.assertEqual(len(listPositions), 9)
     pprint.pprint(listPositions)
Exemplo n.º 5
0
 def test_unit_DozorM_parseDozormLogFile_1(self):
     logPath = self.dataPath / 'dozorm_1D.log'
     listPositions = DozorM.parseDozormLogFile(logPath)
     self.assertEqual(len(listPositions), 3)
     newListPositions = DozorM.check1Dpositions(listPositions, 1, 100)
     # pprint.pprint(listPositions)
     for position in newListPositions:
         self.assertEqual(position["xPosition"], 1.0)
Exemplo n.º 6
0
 def test_updateMeshPositions(self):
     meshPositionPath = self.dataPath / 'opid23eh1_mesh1_meshPositions.json'
     with open(str(meshPositionPath)) as fd:
         meshPositions = json.loads(fd.read())
     mapPath = self.dataPath / 'opid23eh1_mesh1_dozorm.map'
     dictMap = DozorM.parseMap(mapPath)
     newMeshPositions = DozorM.updateMeshPositions(
         meshPositions=meshPositions, arrayScore=dictMap["crystal"])
Exemplo n.º 7
0
 def test_unit_DozorM_makePlots(self):
     tmpDir = tempfile.mkdtemp(prefix="test_unit_DozorM_makePlots_")
     mapPath = self.dataPath / 'opid23eh1_mesh1_dozorm.map'
     dictMap = DozorM.parseMap(mapPath)
     imagePath = DozorM.makeCrystalPlot(dictMap["crystal"],
                                        tmpDir,
                                        debug=False)
     self.assertTrue(os.path.exists(imagePath))
     imagePath = DozorM.makeImageNumberMap(dictMap["imageNumber"],
                                           tmpDir,
                                           debug=False)
     self.assertTrue(os.path.exists(imagePath))
     shutil.rmtree(tmpDir)
Exemplo n.º 8
0
 def test_unit_DozorM_parseMap_1(self):
     mapPath = self.dataPath / 'id30a1_mesh1_dozorm.map'
     dictMap = DozorM.parseMap(mapPath)
     # pprint.pprint(dictMap)
     self.assertEqual(dictMap["nx"], 35)
     self.assertEqual(dictMap["ny"], 20)
Exemplo n.º 9
0
 def test_unit_DozorM_parseMap(self):
     mapPath = self.dataPath / 'opid23eh1_mesh1_dozorm.map'
     dictMap = DozorM.parseMap(mapPath)
     # pprint.pprint(dictMap)
     self.assertEqual(dictMap["nx"], 18)
     self.assertEqual(dictMap["ny"], 16)
Exemplo n.º 10
0
 def test_unit_DozorM_parseDozormLogFile_2(self):
     logPath = self.dataPath / 'id30a1_line1_dozorm.log'
     listPositions = DozorM.parseDozormLogFile(logPath)
     self.assertEqual(len(listPositions), 3)
     pprint.pprint(listPositions)