![]() |
Bsoft 2.1.4
Bernard's software package
|
#include <ctf.h>
Public Member Functions | |
CTFparam () | |
CTFparam (string s) | |
CTFparam (double v, double sa, double ac) | |
int | update (CTFparam *ctf) |
int | update (CTFparam &ctf) |
Updates a CTF structure from another. More... | |
void | identifier (string s) |
string & | identifier () |
long | select () |
void | select (long i) |
double | volt () |
void | volt (double v) |
double | focal_length () |
void | focal_length (double v) |
double | Cc () |
void | Cc (double v) |
double | alpha () |
void | alpha (double v) |
double | dE () |
void | dE (double v) |
double | aberration_weight (long n, long m) |
void | aberration_weight (long n, long m, double v) |
void | add_aberration_weight (long n, long m, double v) |
map< pair< long, long >, double > & | aberration_weights () |
void | aberration_weights (map< pair< long, long >, double > &wa) |
void | update_aberration_weights (map< pair< long, long >, double > &wa) |
double | objective_aperture () |
void | objective_aperture (double v) |
double | slit_width () |
void | slit_width (double v) |
double | amp_shift () |
void | amp_shift (double v) |
double | beam_tiltX () |
double | beam_tiltY () |
void | beam_tiltX (double v) |
void | beam_tiltY (double v) |
void | beam_tilt (double x, double y) |
double | defocus_average () |
void | defocus_average (double v) |
double | defocus_deviation () |
double | astigmatism_angle () |
void | astigmatism (double dev, double ang) |
double | Cs () |
void | Cs (double v) |
long | baseline_type () |
void | baseline_type (long t) |
vector< double > & | baseline () |
double | baseline (int i) |
void | baseline (int i, double d) |
void | baseline (double *b) |
void | baseline (vector< double > &b) |
void | baseline (long t, vector< double > &b) |
long | envelope_type () |
void | envelope_type (long t) |
vector< double > & | envelope () |
double | envelope (int i) |
void | envelope (int i, double d) |
void | envelope (double *v) |
void | envelope (vector< double > &v) |
void | envelope (long t, vector< double > &v) |
double | fom () |
void | fom (double v) |
double | aberration_coefficient (long n, long m) |
double | aberration_coefficient (pair< long, long > a) |
string | aberration_weight_string () |
vector< double > | aberration_even () |
vector< double > | aberration_even_difference () |
void | aberration_even (vector< double > &v) |
void | aberration_even_update (vector< double > &v) |
vector< double > | aberration_odd () |
void | aberration_odd (vector< double > &v) |
void | aberration_odd_update (vector< double > &v) |
void | convert_zernike () |
void | add_zernike_even (vector< double > &v) |
void | add_zernike_odd (vector< double > &v) |
vector< double > | zernike_even () |
vector< double > | zernike_odd () |
void | delete_aberration (int which=3) |
bool | check_defocus () |
double | lambda () |
double | frequency_cutoff () |
long double | calculate_aberration_even (double s2, double angle) |
long double | calculate_aberration_odd (double s2, double angle) |
Complex< double > | aberration_odd_complex (double s2, double angle) |
long double | delta_phi (double s2, double angle) |
long double | calculate (double s2, double angle) |
vector< double > | calculate (int nrad, int npsi, double step_size) |
Calculates a CTF curve. More... | |
Complex< double > | calculate_complex (double s2, double angle) |
double | calc_baseline (double s) |
double | calc_envelope (double s) |
vector< double > | zeroes (double max_s) |
Calculates the zeroes of a CTF curve on the spatial frequency scale. More... | |
vector< double > | maxima (double max_s) |
Calculates the maxima of a CTF curve on the spatial frequency scale. More... | |
Bstring | baseline_equation () |
Generates a baseline equation string from 4 to 10 coefficients. More... | |
Bstring | envelope_equation () |
Generates an envelope equation string from 4 coefficients. More... | |
int | parse_baseline_equation (Bstring base_eq) |
Extracts the coefficients from the baseline string. More... | |
int | parse_envelope_equation (Bstring env_eq) |
Extracts the coefficients from the envelope string. More... | |
double | partial_coherence (double s) |
Calculates the envelope curve based on partial coherence. More... | |
vector< double > | envelope_partial_coherence (long n, double freq_step) |
Calculates the envelope curve based on partial coherence. More... | |
double | energy_spread (double s2) |
Calculates the envelope curve based on energy spread. More... | |
vector< double > | envelope_energy_spread (long n, double freq_step) |
Calculates the envelope curve based on energy spread. More... | |
double | partial_coherence_and_energy_spread (double s2) |
Calculates the envelope curve based on partial coherence and energy spread. More... | |
double | zero (int i) |
double | defocus_for_first_zero (double s) |
void | show () |
void | show_aberration () |
void | show_baseline () |
void | show_envelope () |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Bstring CTFparam::baseline_equation | ( | ) |
Generates a baseline equation string from 4 to 10 coefficients.
The baseline string is constructed from the 4 to 10 coefficients according to the specified type.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
vector< double > CTFparam::calculate | ( | int | nrad, |
int | npsi, | ||
double | step_size | ||
) |
Calculates a CTF curve.
nrad | number of radii. |
npsi | number of angular segments. |
step_size | reciprocal space step size (1/angstrom). |
Defocus values are positive for underfocus. Functions: angle = atan(y/x) s2 = reciprocal space distance squared defocus_average = (defocus_max + defocus_min)/2 defocus_deviation = (defocus_max - defocus_min)/2 defocus = defocus_average + defocus_deviation*cos(2*(angle - astigmatism_angle)) phase = 0.5*PI*lambda*lambda*lambda*Cs*s2*s2 - PI*lambda*defocus*s2 - amp_shift; CTF = sin(phase) The new CTF curve is returned.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
double CTFparam::energy_spread | ( | double | s2 | ) |
Calculates the envelope curve based on energy spread.
s2 | spatial frequency squared. |
The curve is calculated at frequency s as: Ees(s) = exp(-0.5*(pi*lambda*Cc*(dE/V)*s^2)^2) where Cc: Chromatic aberation (~2e7 A) dE: Energy spread (~1 eV) V: Acceleration voltage (~1e5 V) lamda: electron wavelength (~0.03 A)
References: Freitag et al. (2005) Ultramicroscopy 102, 209-14. Zhu et al. (1997) JSB 118, 197-219.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
vector< double > CTFparam::envelope_energy_spread | ( | long | n, |
double | freq_step | ||
) |
Calculates the envelope curve based on energy spread.
n | number of spatial frequency steps. |
freq_step | size of spatial frequency step. |
The curve is calculated at frequency s as: Ees(s) = exp(-0.5*(pi*lambda*Cc*(dE/V)*s^2)^2) where Cc: Chromatic aberation (~2e7 A) dE: Energy spread (~1 eV) V: Acceleration voltage (~1e5 V) lamda: electron wavelength (~0.03 A)
References: Freitag et al. (2005) Ultramicroscopy 102, 209-14. Zhu et al. (1997) JSB 118, 197-219.
Bstring CTFparam::envelope_equation | ( | ) |
Generates an envelope equation string from 4 coefficients.
The envelope string is constructed from the 4 double gaussian parameters.
vector< double > CTFparam::envelope_partial_coherence | ( | long | n, |
double | freq_step | ||
) |
Calculates the envelope curve based on partial coherence.
n | number of spatial frequency steps. |
freq_step | size of spatial frequency step. |
The curve is calculated at frequency s as: Epc(s) = exp(-(pi*alpha*(Cs*lamda^2*s^2 - def)*s)^2) where Cs: Spherical aberation (~2e7 A) alpha: Beam spread/source size (~0.1 mrad) def: Defocus (~1e4 A) lamda: electron wavelength (~0.03 A)
References: Zhu et al. (1997) JSB 118, 197-219.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
vector< double > CTFparam::maxima | ( | double | max_s | ) |
Calculates the maxima of a CTF curve on the spatial frequency scale.
max_s | maximum spatial frequency. |
Thus uses the zeroes function to find the maxima. Defocus values are positive for underfocus. The array returned start with the first zero at index 0.
|
inline |
|
inline |
int CTFparam::parse_baseline_equation | ( | Bstring | base_eq | ) |
Extracts the coefficients from the baseline string.
base_eq | baseline equation string. |
The baseline string is scanned in one of the three supported formats.
int CTFparam::parse_envelope_equation | ( | Bstring | env_eq | ) |
Extracts the coefficients from the envelope string.
env_eq | envelope equation string. |
The envelope string is scanned to get the 4 double gaussian parameters.
double CTFparam::partial_coherence | ( | double | s | ) |
Calculates the envelope curve based on partial coherence.
s | spatial frequency. |
The curve is calculated at frequency s as: Epc(s) = exp(-(pi*alpha*(Cs*lamda^2*s^2 - def)*s)^2) where Cs: Spherical aberation (~2e7 A) alpha: Beam spread/source size (~0.1 mrad) def: Defocus (~1e4 A) lamda: electron wavelength (~0.03 A)
References: Zhu et al. (1997) JSB 118, 197-219.
double CTFparam::partial_coherence_and_energy_spread | ( | double | s2 | ) |
Calculates the envelope curve based on partial coherence and energy spread.
s2 | spatial frequency squared. |
References: Freitag et al. (2005) Ultramicroscopy 102, 209-14. Zhu et al. (1997) JSB 118, 197-219.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
int CTFparam::update | ( | CTFparam & | ctf | ) |
Updates a CTF structure from another.
ctf | CTF structure with new information. |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
vector< double > CTFparam::zeroes | ( | double | max_s | ) |
Calculates the zeroes of a CTF curve on the spatial frequency scale.
max_s | maximum spatial frequency. |
The nth zero is given by the reciprocal space distance where the phase shift term is equal to -n*PI: phase = 0.5*PI*lambda^3*Cs*s^4 - PI*lambda*defocus*s^2 = -n*PI ctf_fz = defocus/(Cs*lambda^2) zero(n) = sqrt(ctf_fz - sqrt(ctf_fz^2 - 2.0*n/(Cs*lambda^3))) Defocus values are positive for underfocus. The array returned start with the first zero at index 0.