Skip to content

Commit

Permalink
Add marker for peak centre
Browse files Browse the repository at this point in the history
  • Loading branch information
RichardWaiteSTFC committed Mar 1, 2024
1 parent e349b70 commit 2d8bf24
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion scripts/Diffraction/single_crystal/base_sx.py
Original file line number Diff line number Diff line change
Expand Up @@ -660,6 +660,8 @@ def plot_integrated_peaks_MD(wsMD, peaks, filename, nbins_max=21, extent=1.5, lo
im.set_extent([-1, 1, -1, 1]) # so that ellipsoid is a circle
if log_norm:
im.set_norm(LogNorm())
# plot peak position
ax.plot(0, 0, "xr")
# plot peak representation (circle given extents)
patch = Circle((0, 0), radii[imax] / box_lengths[imax], facecolor="none", edgecolor="r", ls="--")
ax.add_patch(patch)
Expand All @@ -674,6 +676,8 @@ def plot_integrated_peaks_MD(wsMD, peaks, filename, nbins_max=21, extent=1.5, lo
) # inner radius
ax.add_patch(patch)
# format axes
ax.set_xlim(-1, 1)
ax.set_ylim(-1, 1)
ax.set_aspect("equal")
ax.set_xlabel(ws_cut.getDimension(dims[0]).name)
ax.set_ylabel(ws_cut.getDimension(dims[1]).name)
Expand Down Expand Up @@ -728,7 +732,7 @@ def _bin_MD_around_peak(wsMD, pk, peak_shape, nbins_max, extent, frame_to_peak_c
nbins = nbins * 3 / min_nbins_in_radius
# call BinMD
ws_cut = mantid.BinMD(
InputWorkspace=ws,
InputWorkspace=wsMD,
OutputWorkspace="__ws_cut",
AxisAligned=False,
BasisVector0=r"Q$_0$,unit," + ",".join(np.array2string(evecs[:, 0], precision=6).strip("[]").split()),
Expand Down

0 comments on commit 2d8bf24

Please sign in to comment.