Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- %matplotlib inline
- import h5py
- import matplotlib.pyplot as plt
- import matplotlib.cm as cm
- import numpy as np
- # Load file and relevant h5 groups
- positions = h5py.File("C:\\Users\\Jan\\Documents\\Physik & Mathe\\Bachelorarbeit\\h5 Dateien zum Ausprobieren\\positions.h5", 'r')
- counter = h5py.File("C:\\Users\\Jan\\Documents\\Physik & Mathe\\Bachelorarbeit\\h5 Dateien zum Ausprobieren\\counter.h5", 'r')
- # Extract information out of h5:
- x_axis_h5 = positions["/data/encoder_fast/data"]
- y_axis_h5 = positions["/data/encoder_slow/data"]
- lock_in_R_h5 = counter["/data/lock_in_R_0-10V"]
- x = list(x_axis_h5)
- y = list(y_axis_h5)
- lock_in_R = list(lock_in_R_h5)
- matrix_lock_in_R = np.asmatrix(lock_in_R)
- """Plot raw map"""
- fig2 = plt.figure(figsize=(10,8))
- ax2_1 = plt.subplot2grid((3,3), (0,0))
- ax2_1.plot(x,y)
- im = ax2_1.pcolormesh(x, y, lock_in_R, cmap=cm.afmhot, vmin=0, vmax=matrix_lock_in_R.max())
- ax2_1.set_aspect(1)
- plt.xlabel("X position $(\mu m)$")
- plt.ylabel("Y position $(\mu m)$")
- ax2_1_divider = make_axes_locatable(ax2_1)
- cax2_1 = ax2_1_divider.append_axes("right", size="15%", pad="10%")
- cb0 = colorbar(im, cax=cax2_1)
- ylabel = "count rate (Hz)"
- cax2_1.set_ylabel(ylabel, rotation=90)
- plt.tight_layout()
- plt.close()
- return 0
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement