Skip to content
Snippets Groups Projects
Commit 39eba9f3 authored by Greg Henning's avatar Greg Henning
Browse files

[added] Ge2D calibrate

parent aef392b4
Branches
Tags
No related merge requests found
# File to test the merging of 2d histograms
from pyhisto import Histogram2D
from calibrate2D import calibrate2D
if __name__ == "__main__":
# Loading tests histograms
h2 = Histogram2D(fromstring=open('tests/test_h2_1.txt', 'r').read())
# Projecting on X, Y
h2_x = h2.project_x()
open('tests/test_h2_x.txt', 'w').write(str(h2_x))
h2_y = h2.project_y()
open('tests/test_h2_y.txt', 'w').write(str(h2_y))
# Calibrate 2D
h2_cal = calibrate2D(h2,
xoffset=+10, xslope=0.50,
yoffset=-5, yslope=2.00)
# wproject the calibrated and write
h2_cal_x = h2_cal.project_x()
open('tests/test_h2_cal_x.txt', 'w').write(str(h2_cal_x))
h2_cal_y = h2_cal.project_y()
open('tests/test_h2_cal_y.txt', 'w').write(str(h2_cal_y))
\ No newline at end of file
......@@ -26,4 +26,4 @@ if __name__ == "__main__":
40, 0., 100.,
['test_h2_1.txt:0,60.', 'test_h2_2.txt:-45.'])
open('test_alignedh2.txt', 'w').write(str(h2_aligned))
\ No newline at end of file
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment