22 lines
451 B
Python
22 lines
451 B
Python
|
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')
|