diff --git a/test/test.py b/test/test.py new file mode 100644 index 0000000..9fd74fa --- /dev/null +++ b/test/test.py @@ -0,0 +1,21 @@ +from gwygsf import GSF +import matplotlib.pyplot as plt + +plt.ioff() + +def makeplot(name): + c = GSF() + c.fromfile(name) + x0 = float(c.attr["XOffset"]) * 1e6 + xl = x0 + float(c.attr["XReal"]) * 1e6 + y0 = float(c.attr["YOffset"]) * 1e6 + yl = y0 + float(c.attr["YReal"]) * 1e6 + + fig, ax = plt.subplots() + gr = ax.imshow(c.d, extent=(x0,xl,y0,yl)) + ax.set_xlabel("um") + ax.set_ylabel("um") + fig.colorbar(gr) + fig.savefig(f'{name}.png') + +makeplot('test.gsf')