Skip to content

Commit

Permalink
syncing MnTe script
Browse files Browse the repository at this point in the history
  • Loading branch information
Bing Li committed Oct 31, 2024
1 parent 1664df0 commit d3637b4
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 9 deletions.
35 changes: 28 additions & 7 deletions scripts/MnTe_new.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,24 +31,45 @@
# p1.plot(ax)


# -------------- H0L const Q scans ------------
# -------------- (H, 0. 2-H) Ef = 14.7 const Q scans ------------

scans = list(range(83, 167))
scans = list(range(88, 133))

scan_list2 = [("IPTS34735_HB3_exp0823", scan) for scan in scans]
sg2 = tavi.combine_scans(scan_list2, name="dispH_2")
scan_data_2d = sg2.get_data(
sg2 = tavi.combine_scans(scan_list2, name="dispH (H,0,2-H) Ef=14.7 meV")
scan_data_2 = sg2.get_data(
axes=("qh", "en", "detector"),
norm_to=(1, "mcu"),
grid=(0.025, 0.5),
)

p2 = Plot2D()
p2.add_contour(scan_data_2d, cmap="turbo", vmax=1)
p2.zlim = [0, 0.01]
p2.add_contour(scan_data_2, cmap="turbo", vmin=0, vmax=1)
p2.title = sg2.name
p2.ylim = [0, 50]
fig, ax = plt.subplots()
p2.plot(ax)
im = p2.plot(ax)
fig.colorbar(im)

# -------------- (H, 0. 2-H) Ef = 30.5 meV const Q scans ------------

scans = list(range(133, 167))

scan_list3 = [("IPTS34735_HB3_exp0823", scan) for scan in scans]
sg3 = tavi.combine_scans(scan_list3, name="dispH_ H,0,2-H) Ef=30.5 meV")
scan_data_3 = sg3.get_data(
axes=("qh", "en", "detector"),
norm_to=(1, "mcu"),
grid=(0.025, 0.5),
)

p3 = Plot2D()
p3.add_contour(scan_data_3, cmap="turbo", vmin=0, vmax=1)
p3.title = sg3.name
p3.ylim = [0, 50]

fig, ax = plt.subplots()
im = p3.plot(ax)

fig.colorbar(im)
plt.show()
7 changes: 5 additions & 2 deletions src/tavi/data/plotter.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,10 @@ def __init__(self) -> None:
# plot specifications
self.xlim: Optional[tuple[float, float]] = None
self.ylim: Optional[tuple[float, float]] = None

self.LOG_X = False
self.LOG_Y = False
self.LOG_Z = False

def add_contour(self, contour_data: ScanData2D, **kwargs):
self.contour_data.append(contour_data)
Expand All @@ -102,9 +104,9 @@ def add_curve(self, curve_data: ScanData1D, **kwargs):

def plot(self, ax):
for contour in self.contour_data:
ax.pcolormesh(contour.x, contour.y, contour.z, **contour.fmt)
im = ax.pcolormesh(contour.x, contour.y, contour.z, **contour.fmt)
for curve in self.curve_data:
ax.errorbar(x=curve.x, y=curve.y, yerr=curve.err)
im = ax.errorbar(x=curve.x, y=curve.y, yerr=curve.err)

if self.xlim is not None:
ax.set_xlim(left=self.xlim[0], right=self.xlim[1])
Expand All @@ -128,3 +130,4 @@ def plot(self, ax):

ax.grid(alpha=0.6)
ax.legend()
return im

0 comments on commit d3637b4

Please sign in to comment.