20 txt =
Bstring(1e-3*em_ctf.
volt(),
"Accelerating voltage: %g kV");
24 txt =
Bstring(1e-7*em_ctf.
Cs(),
"Spherical aberration: %g mm");
26 txt =
Bstring(1e-7*em_ctf.
Cc(),
"Chromatic aberration: %g mm");
28 txt =
Bstring(1e3*em_ctf.
alpha(),
"Beam spread/source size: %g mrad");
30 txt =
Bstring(em_ctf.
dE(),
"Energy spread: %g eV");
39 txt =
Bstring(1e-3*em_ctf.
volt(),
"Accelerating voltage: %g kV");
41 txt =
Bstring(1e-7*em_ctf.
Cs(),
"Spherical aberration: %g mm");
73 size_t i, j, k, l, m, h, ncol(6);
75 Bstring title(
"Envelope curve");
76 title = filename +
": " + title;
91 for ( i=1; i<ncol; i++ ) {
104 vector<double> ec =
C_curve(n, freq_step);
107 vector<double> ctf = em_ctf.
calculate(n, 1, freq_step);
109 for ( i=0, j=n, k=2*n, l=3*n, m=4*n, h=5*n; i<n; i++, j++, k++, l++, m++, h++ ) {
110 env = (ec[i]/ec[0]) * epc[i] * ees[i];
111 (*plot)[i] = i*freq_step;
112 (*plot)[j] = ec[i]/ec[0];
116 (*plot)[h] = env * ctf[i] * ctf[i];
153 long i, j, k, l, m, ncol(5);
157 vector<double> ctf = em_ctf->
calculate(n, 1, interval);
159 Bstring title(
"Contrast transfer function");
160 title = filename +
": " + title;
174 for ( i=1; i<ncol; i++ ) {
184 double min(0), max(0);
186 for ( i=0, j=n, k=2*n, l=3*n, m=4*n; i<n; i++, j++, k++, l++, m++ ) {
191 (*plot)[j] = rps[i] -
base;
194 (*plot)[m] = env * ctf[i] * ctf[i];
195 if ( min > (*plot)[m] ) min = (*plot)[m];
196 if ( max < (*plot)[m] ) max = (*plot)[m];
237 double defocus, zero, x_max(20), x_inc(0.01), y_max(0);
238 Bstring title(
"Zeroes for different defocus values");
242 cout <<
"Acceleration voltage: " << volts/1000 <<
" kV" << endl;
243 cout <<
"Electron wavelength: " << cp.
lambda() <<
" A" << endl;
244 cout <<
"Spherical aberration: " << Cs/1e7 <<
" mm" << endl;
245 cout <<
"Amplitude phase shift: " << amp_shift << endl << endl;
248 long nx = (long) (x_max/x_inc + 1);
258 for ( i=1; i<=nzero; i++ ) {
275 for ( j=0, defocus=0; j<nx; defocus+=100, j++ ) {
277 (*plot)[j] = defocus/10000.0;
278 for ( i=1; i<=nzero; i++ ) {
280 if ( zero > y_max ) y_max = zero;
281 (*plot)[i*nx+j] = zero;
285 y_max = 10*ceil(y_max/10);
288 label =
"Acceleration voltage: " +
Bstring(volts/1000,
"%.0f") +
" kV";
290 label =
"Electron wavelength: " +
Bstring(cp.
lambda(),
"%.4g") +
" A";
292 label =
"Spherical aberration coefficient: " +
Bstring(Cs/1e7,
"%.2g") +
" mm";
294 label =
"Amplitude phase shift: " +
Bstring(amp_shift,
"%.3g");
307 double fac =
M_PI*1.0L/n, v;
312 for ( i=0; i<n; i++ ) {
315 for ( j=1; j<n; j++ )
316 t[i] += a[j]*cos(v*j);
320 for ( i=0; i<n; i++ ) a[i] = t[i]*step;
339 size_t i, j, k, l, m, ncol(5);
341 Bstring title(
"Envelope curve");
342 title = filename +
": " + title;
356 for ( i=1; i<ncol; i++ ) {
367 double step(0.5/(n*freq_step));
369 vector<double> ec =
C_curve(n, freq_step);
373 vector<double> env(n);
375 for ( i=0; i<n; i++ ) env[i] = ec[i] * epc[i] * ees[i];
382 for ( i=0, j=n, k=2*n, l=3*n, m=4*n; i<n; i++, j++, k++, l++, m++ ) {