diff options
-rw-r--r-- | AUTHORS | 3 | ||||
-rw-r--r-- | README | 1 | ||||
-rwxr-xr-x | scripts/detector-shift | 21 |
3 files changed, 22 insertions, 3 deletions
@@ -66,3 +66,6 @@ process_hkl --even-only/--odd-only partialator --start-after/--stop-after Other bits and pieces + +* Marmoru Suzuki <mamoru.suzuki@protein.osaka-u.ac.jp> + Improvements to scripts/detector-shift @@ -24,6 +24,7 @@ Authors: Parker de Waal <Parker.deWaal@vai.org> Takanori Nakane <nakane.t@gmail.com> Keitaro Yamashita <k.yamashita@spring8.or.jp> + Marmoru Suzuki <mamoru.suzuki@protein.osaka-u.ac.jp> CrystFEL is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software diff --git a/scripts/detector-shift b/scripts/detector-shift index 223ba5b2..a348e3c9 100755 --- a/scripts/detector-shift +++ b/scripts/detector-shift @@ -8,11 +8,13 @@ # # Author: # 2015-2016 Thomas White <taw@physics.org> +# 2016 Marmoru Suzuki <mamoru.suzuki@protein.osaka-u.ac.jp> # import sys import os import re +import numpy as np import matplotlib.pyplot as plt f = open(sys.argv[1], 'r') @@ -118,12 +120,25 @@ if have_geom: g.close() h.close() -plt.plot(x_shifts, y_shifts, 'rx') -plt.plot(0, 0, 'bo') -plt.axis([-2,2,-2,2]) +nbins = 200 +H, xedges, yedges = np.histogram2d(x_shifts,y_shifts,bins=nbins) +H = np.rot90(H) +H = np.flipud(H) +Hmasked = np.ma.masked_where(H==0,H) + +# Plot 2D histogram using pcolor +fig2 = plt.figure() +plt.pcolormesh(xedges,yedges,Hmasked) plt.title('Detector shifts according to prediction refinement') plt.xlabel('x shift / mm') plt.ylabel('y shift / mm') +circle1 = plt.Circle((mean_x,mean_y),.1,color='r',fill=False) +fig = plt.gcf() +fig.gca().add_artist(circle1) +cbar = plt.colorbar() +cbar.ax.set_ylabel('Counts') +plt.plot(0, 0, 'bH', color='c') +plt.plot(mean_x, mean_y, 'b8', color='m') plt.grid(True) plt.show() |