Skip to content
Snippets Groups Projects
Commit fb901cf3 authored by Wuttke, Joachim's avatar Wuttke, Joachim
Browse files

repair plot_diff_int

parent 56a9a8a4
No related branches found
No related tags found
1 merge request!1022repair image viewer scripts
Pipeline #74818 passed
......@@ -11,10 +11,10 @@ import sys
def plot_diff_int(filename1, filename2):
intensity_ref = ba.IOFactory.readIntensityData(filename1)
intensity_other = ba.IOFactory.readIntensityData(filename2)
data = 2 * np.abs(intensity_ref.array() - intensity_other.array()) \
/ (np.abs(intensity_ref.array()) + np.abs(intensity_other.array()))
intensity_ref = ba.IOFactory.readDatafield(filename1)
intensity_other = ba.IOFactory.readDatafield(filename2)
data = 2 * np.abs(intensity_ref.npArray() - intensity_other.npArray()) \
/ (np.abs(intensity_ref.npArray()) + np.abs(intensity_other.npArray()))
if data.max() == 0:
exit("Both data sets are equal, there is nothing to plot.")
vmax = data.max()
......@@ -24,10 +24,10 @@ def plot_diff_int(filename1, filename2):
rank = intensity_ref.rank()
if rank == 2:
pid.plot_raw_data_2d(data, [
intensity_ref.xMin()/ba.deg,
intensity_ref.xMax()/ba.deg,
intensity_ref.yMin()/ba.deg,
intensity_ref.yMax()/ba.deg
intensity_ref.xAxis().min()/ba.deg,
intensity_ref.xAxis().max()/ba.deg,
intensity_ref.yAxis().min()/ba.deg,
intensity_ref.yAxis().max()/ba.deg
], True, vmin, vmax)
elif rank == 1:
axis_values = np.asarray(intensity_ref.xAxis().binCenters())/ba.deg
......
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