Skip to content
Snippets Groups Projects
Commit 4b0c93a3 authored by Wuttke, Joachim's avatar Wuttke, Joachim
Browse files

FFCatalog: save simulation outcome in data files (.int), in addition to the

image pdf
parent 46de2940
No related branches found
No related tags found
No related merge requests found
"""
Utilities to plot form factors of particles in Born approximation
"""
import numpy
import math, numpy
import matplotlib as mpl
import matplotlib.pyplot as plt
from matplotlib import rc
......@@ -100,7 +100,13 @@ def make_plot(results, det, name, nrow=1):
0.25*xskip, 1-bottomskip-topskip])
cb = fig.colorbar(im, cax=cbar_ax)
cb.set_label(r'$\left|F(q)\right|^2/V^{\,2}$', fontsize=fontsize)
# Output to file or display.
# Output to data file, image file, and display.
nDigits = int(math.log10(len(results)))+1
formatN = "%" + str(nDigits) + "i"
for i in range(len(results)):
fname = name+"."+(formatN % i)+".int"
print(fname)
numpy.savetxt(fname, results[i].data)
plt.savefig(name+".pdf", format="pdf", bbox_inches='tight')
plt.show()
......
No preview for this file type
No preview for this file type
No preview for this file type
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment