Core of the Adjust CTF routine. This is the routine which does everything. It returns the fitting error committed in the best fit.
2272 std::cout <<
"Best background Fit:\n" << prm.
current_ctfmodel << std::endl;
2369 std::cout <<
"Best fit with Gaussian2:\n" << prm.
current_ctfmodel << std::endl;
2387 std::cout <<
"Refining amplitude contrast ..." << std::endl;
2440 FileName fn_rootMODEL = fn_rootCTFPARAM;
2441 size_t atPosition=fn_rootCTFPARAM.find(
'@');
2443 if (atPosition!=std::string::npos)
2446 fn_rootCTFPARAM.substr(atPosition+1).c_str());
2448 fn_rootCTFPARAM.substr(atPosition+1).c_str());
2451 fn_rootCTFPARAM=(
String)
"fullMicrograph@"+fn_rootCTFPARAM;
2458 MD.
read(fn_rootCTFPARAM +
".ctfparam_tmp");
2469 fn_rootCTFPARAM = fn_rootCTFPARAM +
".ctfparam_tmp";
2470 fn_rootCTFPARAM.deleteFile();
#define VECTOR_R2(v, x, y)
#define COPY_ctfmodel_TO_CURRENT_GUESS
MultidimArray< double > * f
void estimate_background_sqrt_parameters()
Image< double > ctftomodel
CTF amplitude to model.
__host__ __device__ float2 floor(const float2 v)
bool fastDefocusEstimate
Fast defocus estimate.
FileName removeLastExtension() const
double heavy_penalization
void saveIntermediateResults(const FileName &fn_root, bool generate_profiles)
constexpr int FIRST_SQRT_PARAMETER
CTFDescription current_ctfmodel
Matrix1D< double > * adjust_params
double DeltafV
Defocus in V (in Angstroms). Negative values are underfocused.
void estimate_envelope_parameters()
void write(const FileName &fn)
MultidimArray< double > y_digfreq
double downsampleFactor
Downsample performed.
void show()
Show parameters.
double evaluateIceness(const MultidimArray< double > &enhanced_ctftomodel, double Tm)
void produceSideInfo()
Produce side information.
#define DEBUG_CLOSE_TEXTFILE
FileName fn_psd
CTF filename.
double DeltaF
Longitudinal mechanical displacement (ansgtrom). Typical value 100.
#define FOR_ALL_ELEMENTS_IN_ARRAY2D(m)
double max_freq
Maximum frequency to adjust.
static constexpr double penalty
double DeltafU
Global gain. By default, 1.
bool enable_CTF
Enable CTF part.
double azimuthal_angle
Azimuthal angle (between X and U) in degrees.
MultidimArray< double > w_contfreq
constexpr int ALL_CTF_PARAMETERS
MultidimArray< double > psd_exp_radial
PSD data.
bool noDefocusEstimate
No defocus estimate.
void resize(size_t Xdim, bool copy=true)
double ispr
Objective lens stability (deltaI/I) (ppm). Typical value 1.
double Tm
Sampling rate (A/pixel)
bool refineAmplitudeContrast
Refine amplitude contrast.
double Cs
Spherical aberration (in milimeters). Typical value 5.6.
double DeltaR
Transversal mechanical displacement (ansgtrom). Typical value 3.
bool show_optimization
Show convergence values.
MultidimArray< double > x_digfreq
double K
Global gain. By default, 1.
void estimate_defoci_Zernike(const MultidimArray< double > &psdToModelFullSize, double min_freq, double max_freq, double Tm, double kV, double lambdaPhase, int sizeWindowPhase, double &defocusU, double &defocusV, double &ellipseAngle, int verbose)
Matrix1D< double > adjust
Set of parameters for the complete adjustment of the CTF.
int modelSimplification
Model simplification.
FileName withoutExtension() const
constexpr int BACKGROUND_CTF_PARAMETERS
MultidimArray< double > mask_between_zeroes
double Ca
Chromatic aberration (in milimeters). Typical value 2.
void lookFor(int n, const Matrix1D< double > &u, Matrix1D< double > &freq, int iwhat=0)
double min_freq
Minimum frequency to adjust.
void forcePhysicalMeaning()
void estimate_background_gauss_parameters()
double alpha
Convergence cone semiangle (in mrad). Typical value 0.5.
String formatString(const char *format,...)
int textToInteger(const char *str)
double y0
In the case of local CTF determination x0,xF,y0,yF determines the region where the CTF is determined...
double Q0
Factor for the importance of the Amplitude contrast.
double x0
In the case of local CTF determination x0,xF,y0,yF determines the region where the CTF is determined...
double kV
Accelerating Voltage (in KiloVolts)
void initZeros(const MultidimArray< T1 > &op)
MultidimArray< double > mask
Masks.
#define DEBUG_OPEN_TEXTFILE(fnRoot)
bool enable_CTFnoise
Enable CTFnoise part.
double xF
In the case of local CTF determination x0,xF,y0,yF determines the region where the CTF is determined...
T * adaptForNumericalRecipes() const
CTFDescription initial_ctfmodel
CTF model.
ProgCTFEstimateFromPSD * global_prm
void estimate_background_gauss_parameters2()
double yF
In the case of local CTF determination x0,xF,y0,yF determines the region where the CTF is determined...
double fitness(double *p)
#define DEBUG_TEXTFILE(str)
#define DEBUG_MODEL_TEXTFILE
double CTF_fitness(double *, void *)