Skip to content

Instantly share code, notes, and snippets.

@daguiam
Created May 19, 2023 11:21
Show Gist options
  • Save daguiam/33de14804b80caae10a4af6d9b4bfca8 to your computer and use it in GitHub Desktop.
Save daguiam/33de14804b80caae10a4af6d9b4bfca8 to your computer and use it in GitHub Desktop.
import numpy as np
import matplotlib.pyplot as plt
import os
from scipy import interpolate
filename = "TMS9.txt"
filename = "data\\Test002\\test002 cap_Sweep1_00000.INLCSV"
filename = "data\\Test002\\test003 cap_Sweep1_00000.INLCSV"
filenames = ["data\\Test001\\Test001_Sweep1_00000.INLCSV",
"data\\Test002\\test002 cap_Sweep1_00000.INLCSV",
"data\\Test002\\test003 cap_Sweep1_00000.INLCSV"]
for filename in filenames:
# filename = "data\\Test002\\test002 cap_Sweep1_00000.INLCSV"
# Xs;Ys;Xw;Yw;Ch 0
x, y, Xw, Yw, z = np.loadtxt(filename, delimiter=";", skiprows=1, unpack=True)
xx = np.linspace(x.min(), x.max(), 100)
yy = np.linspace(y.min(), y.max(), 100)
XX, YY = np.meshgrid(xx, yy, )
ZZ = interpolate.griddata((x,y), z, (XX, YY))
x_line = xx
y_line = 200*np.ones(len(xx))
plt.figure()
plt.pcolormesh(XX,YY,ZZ)
plt.colorbar(label='Intensity [a.u.]')
plt.xlabel("x [mm]")
plt.ylabel("y [mm]")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment