Skip to content
Snippets Groups Projects
Commit a2703fd8 authored by Van Herck, Walter's avatar Van Herck, Walter
Browse files

Regenerated reference files for functional tests related to roughness

parent 51365991
No related branches found
No related tags found
No related merge requests found
......@@ -47,14 +47,14 @@ def RunSimulation():
my_sample.addLayerWithTopRoughness(l_substrate, roughness)
my_sample.setCrossCorrLength(1e-4)
# build and run experiment
simulation = GISASSimulation()
simulation.setDetectorParameters(100, -0.5*degree, 0.5*degree, 100, 0.0*degree, 1.0*degree)
simulation.setBeamParameters(1.0*angstrom, 0.2*degree, 0.0*degree)
simulation.setSample(my_sample)
simulation.runSimulation()
## intensity data
# intensity data
return simulation.getIntensityData()
......@@ -65,18 +65,20 @@ def runTest():
result = RunSimulation()
reference = get_reference_data("roughness01_reference.int.gz")
# IntensityDataIOFactory.writeIntensityData(result, "roughness01_reference.int.gz")
diff = IntensityDataFunctions.getRelativeDifference(result, reference)
status = "OK"
if(diff > 2e-10 or numpy.isnan(diff)): status = "FAILED"
if diff > 2e-10 or numpy.isnan(diff): status = "FAILED"
return "LayerWithRoughness", "Layers with correlated roughness", diff, status
#-------------------------------------------------------------
# -------------------------------------------------------------
# main()
#-------------------------------------------------------------
# -------------------------------------------------------------
if __name__ == '__main__':
name, description, diff, status = runTest()
print(name, description, diff, status)
if("FAILED" in status):
if "FAILED" in status:
exit(1)
......@@ -157,14 +157,16 @@ def runTest():
# setting detector axis as in reference data
simulation.setDetectorParameters(reference)
#running simulation
# running simulation
simulation.runSimulation()
result = simulation.getIntensityData()
# IntensityDataIOFactory.writeIntensityData(result, "mesocrystal01_reference.int.gz")
diff = IntensityDataFunctions.getRelativeDifference(result, reference)
status = "OK"
if(diff > 1e-10 or numpy.isnan(diff)):
if diff > 1e-10 or numpy.isnan(diff):
status = "FAILED"
return "MesoCrystal1", "Mesocrystal simulation", diff, status
......@@ -174,12 +176,12 @@ def createSimulation():
simulation = GISASSimulation()
simulation.setBeamParameters(1.77*angstrom, 0.4*degree, 0.0*degree)
simulation.setBeamIntensity(5.0090e+12)
#simulation.setDetectorResolutionFunction(ResolutionFunction2DGaussian(0.0002, 0.0002))
# simulation.setDetectorResolutionFunction(ResolutionFunction2DGaussian(0.0002, 0.0002))
return simulation
if __name__ == '__main__':
name, description, diff, status = runTest()
print(name, description, diff, status)
if("FAILED" in status):
if "FAILED" in status:
exit(1)
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment