Bsoft  2.1.0
Bernard's software package
ctf.inc
Go to the documentation of this file.
1  if ( curropt->tag == "Volt" ) {
2  if ( ( v = curropt->value.real() ) < 1 )
3  cerr << "-Volt: A voltage must be specified!" << endl;
4  else {
5  if ( v < 1e3 ) v *= 1e3; // Assume kilovolts
6  jsctf["Volt"] = v;
7  }
8  }
9  if ( curropt->tag == "Amplitude" ) {
10  if ( ( v = curropt->value.real() ) < 0 ) {
11  cerr << "-Amplitude: A fraction must be specified!" << endl;
12  } else {
13  if ( v > 1 ) v /= 100; // Assume percentage
14  if ( v > 1 ) v = 1;
15  jsctf["Amplitude_phase"] = asin(v);
16  }
17  }
18  if ( curropt->tag == "Cs" ) {
19  v = curropt->value.real();
20  if ( fabs(v) < 10 ) v *= 1e7; // Assume mm
21  jsctf["Cs"] = v;
22  }
23  if ( curropt->tag == "Cc" ) {
24  if ( ( v = curropt->value.real() ) < 0.1 )
25  cerr << "-Cc: A Cc value must be specified!" << endl;
26  else {
27  if ( v < 1e3 ) v *= 1e7; // Assume mm
28  jsctf["Cc"] = v;
29  }
30  }
31  if ( curropt->tag == "alpha" ) {
32  if ( ( v = curropt->value.real() ) < 1e-10 )
33  cerr << "-alpha: A value must be specified!" << endl;
34  else {
35  if ( v > 0.01 ) v /= 1000; // Assume milliradians
36  jsctf["Beam_convergence"] = v;
37  }
38  }
39  if ( curropt->tag == "energyspread" ) {
40  if ( ( v = curropt->value.real() ) < 1e-10 )
41  cerr << "-energyspread: A value must be specified!" << endl;
42  else {
43 // if ( v > 0.001 ) v /= 1e5; // Assume eV
44  jsctf["Energy_spread"] = v;
45  }
46  }
47  if ( curropt->tag == "aperture" ) {
48  if ( ( v = curropt->value.real() ) < 1 )
49  cerr << "-aperture: An aperture diameter must be specified!" << endl;
50  else {
51  if ( v < 1e4 ) v *= 1e4; // Assume µm
52  jsctf["Objective_aperture"] = v;
53  }
54  }
55  if ( curropt->tag == "focallength" ) {
56  if ( ( v = curropt->value.real() ) < 1 )
57  cerr << "-focallength: A focal length must be specified!" << endl;
58  else {
59  if ( v < 1e3 ) v *= 1e7; // Assume mm
60  jsctf["Focal_length"] = v;
61  }
62  }
63  if ( curropt->tag == "slitwidth" ) {
64  if ( ( v = curropt->value.real() ) < 1 )
65  cerr << "-slitwidth: A slit width must be specified!" << endl;
66  else
67  jsctf["Slit_width"] = v;
68  }