Code indexing in gitaly is broken and leads to code not being visible to the user. We work on the issue with highest priority.

Skip to content
Snippets Groups Projects
Commit 7189ee81 authored by usov_i's avatar usov_i
Browse files

Fix gamma and nu axes

For #44
parent be841785
No related branches found
No related tags found
No related merge requests found
...@@ -258,8 +258,9 @@ def create(): ...@@ -258,8 +258,9 @@ def create():
# handle both, ascending and descending sequences # handle both, ascending and descending sequences
scanning_motor_range.bounds = (min(var_start, var_end), max(var_start, var_end)) scanning_motor_range.bounds = (min(var_start, var_end), max(var_start, var_end))
gamma_start = det_data["gamma"][0] + det_data["x_deg"][0] gamma = image_source.data["gamma"][0]
gamma_end = det_data["gamma"][0] + det_data["x_deg"][-1] gamma_start = gamma[0, 0]
gamma_end = gamma[0, -1]
gamma_range.start = gamma_start gamma_range.start = gamma_start
gamma_range.end = gamma_end gamma_range.end = gamma_end
...@@ -267,8 +268,9 @@ def create(): ...@@ -267,8 +268,9 @@ def create():
gamma_range.reset_end = gamma_end gamma_range.reset_end = gamma_end
gamma_range.bounds = (min(gamma_start, gamma_end), max(gamma_start, gamma_end)) gamma_range.bounds = (min(gamma_start, gamma_end), max(gamma_start, gamma_end))
nu_start = det_data["nu"][0] + det_data["y_deg"][0] nu = image_source.data["nu"][0]
nu_end = det_data["nu"][0] + det_data["y_deg"][-1] nu_start = nu[0, 0]
nu_end = nu[-1, 0]
nu_range.start = nu_start nu_range.start = nu_start
nu_range.end = nu_end nu_range.end = nu_end
...@@ -899,15 +901,10 @@ def calculate_hkl(det_data, index): ...@@ -899,15 +901,10 @@ def calculate_hkl(det_data, index):
def calculate_pol(det_data, index): def calculate_pol(det_data, index):
gamma = np.empty(shape=(IMAGE_H, IMAGE_W))
nu = np.empty(shape=(IMAGE_H, IMAGE_W))
ddist = det_data["ddist"] ddist = det_data["ddist"]
gammad = det_data["gamma"][index] gammad = det_data["gamma"][index]
nud = det_data["nu"] nud = det_data["nu"]
yi, xi = np.ogrid[:IMAGE_H, :IMAGE_W]
for xi in np.arange(IMAGE_W): gamma, nu = pyzebra.det2pol(ddist, gammad, nud, xi, yi)
for yi in np.arange(IMAGE_H):
gamma[yi, xi], nu[yi, xi] = pyzebra.det2pol(ddist, gammad, nud, xi, yi)
return gamma, nu return gamma, nu
...@@ -135,12 +135,4 @@ def read_detector_data(filepath, cami_meta=None): ...@@ -135,12 +135,4 @@ def read_detector_data(filepath, cami_meta=None):
if "dist1" in cami_meta_detparam: if "dist1" in cami_meta_detparam:
det_data["ddist"] = cami_meta_detparam["dist1"] det_data["ddist"] = cami_meta_detparam["dist1"]
x = h5f["/entry1/ZEBRA/area_detector2/x"][:]
y = h5f["/entry1/ZEBRA/area_detector2/y"][:]
x_pixel_offset = int(h5f["/entry1/ZEBRA/area_detector2/x_pixel_offset"][:])
y_pixel_offset = int(h5f["/entry1/ZEBRA/area_detector2/y_pixel_offset"][:])
distance = h5f["/entry1/ZEBRA/area_detector2/distance"][:]
det_data["x_deg"] = np.arctan((x - x[x_pixel_offset]) / distance)
det_data["y_deg"] = np.arctan((y - y[y_pixel_offset]) / distance)
return det_data return det_data
...@@ -379,6 +379,7 @@ def ang_proc(wave, ddist, gammad, om, ch, ph, nud, x, y): ...@@ -379,6 +379,7 @@ def ang_proc(wave, ddist, gammad, om, ch, ph, nud, x, y):
z1 = z1frmd(wave, ga, om, ch, ph, nu) z1 = z1frmd(wave, ga, om, ch, ph, nu)
ch2, ph2 = eqchph(z1) ch2, ph2 = eqchph(z1)
ch, ph, ga, om = fixdnu(wave, z1, ch2, ph2, nu) ch, ph, ga, om = fixdnu(wave, z1, ch2, ph2, nu)
return ch, ph, ga, om return ch, ph, ga, om
......
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