generated from neutrons/python_project_template
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
updated plotter for plotting resolution ellipses
- Loading branch information
Bing Li
committed
Nov 7, 2024
1 parent
453c29a
commit 89b732c
Showing
12 changed files
with
78 additions
and
91 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
# -*- coding: utf-8 -* | ||
|
||
import matplotlib.pyplot as plt | ||
from mpl_toolkits.axisartist import Axes | ||
|
||
from tavi.data.tavi import TAVI | ||
from tavi.plotter import Plot2D | ||
|
||
|
||
# TODO overplot resolution | ||
def test_plot2d(): | ||
tavi = TAVI("./test_data/tavi_exp424.h5") | ||
scan_list = list(range(42, 49, 1)) + list(range(70, 76, 1)) | ||
|
||
sg = tavi.combine_scans(scan_list, name="dispH") | ||
scan_data_2d = sg.get_data( | ||
axes=("qh", "en", "detector"), | ||
norm_to=(1, "mcu"), | ||
grid=(0.025, (-0.5, 4.5, 0.1)), | ||
) | ||
|
||
p = Plot2D() | ||
p.add_contour(scan_data_2d, cmap="turbo", vmax=1) | ||
|
||
fig = plt.figure() | ||
ax = fig.add_subplot(111, axes_class=Axes, grid_helper=p.grid_helper) | ||
|
||
p.plot(ax) | ||
plt.show() |