Bsoft 2.1.4
Bernard's software package
mg_ctf.cpp File Reference

Functions for CTF (contrast transfer function) processing. More...

#include "rwimg.h"
#include "mg_ctf.h"
#include "mg_ctf_fit.h"
#include "ps_plot.h"
#include "ps_ctf_plot.h"
#include "mg_processing.h"
#include "zernike.h"
#include "utilities.h"
#include "timer.h"
#include <sys/stat.h>

Functions

Bimageimg_ctf_calculate (CTFparam &cp, bool flip, double wiener, Vector3< long > size, Vector3< double > sam, double lores, double hires)
 Calculates an aberration image. More...
 
Bimageimg_ctf_calculate (CTFparam cp, int action, double wiener, Vector3< long > size, Vector3< double > sam, double lores, double hires)
 Calculates a CTF image. More...
 
double aberration (long n, long m, double s, double p)
 
vector< double > aberration_terms (map< pair< long, long >, double > &wa, double u, double v)
 
vector< double > aberration_terms (long nt, double u, double v)
 
vector< double > aberration_even_terms (long nt, double u, double v)
 
vector< double > aberration_odd_terms (long nt, double u, double v)
 
map< pair< long, long >, double > aberration_weights (vector< double > v, int flag)
 
string aberration_weight_string (map< pair< long, long >, double > &weights)
 
int img_aberration_basis (Bimage *p, int flag)
 
int img_create_aberration (Bimage *p, map< pair< long, long >, double > &weights, int flag)
 
int img_create_aberration (Bimage *p, vector< map< pair< long, long >, double > > &weights, int flag)
 
int img_create_aberration (Bimage *p, CTFparam cp, int flag)
 
int img_create_aberration (Bimage *p, map< string, CTFparam > &cpa, int flag)
 
Bimageimg_wave_aberration (CTFparam cp, Vector3< long > size, Vector3< double > sam)
 Calculates a wave aberration function. More...
 
int img_ctf_apply (Bimage *p, CTFparam em_ctf, int action, double wiener, double lores, double hires, bool invert)
 Applies or corrects for the contrast transfer function (CTF). More...
 
int img_ctf_apply (Bimage *p, CTFparam em_ctf, int action, double wiener, double lores, double hires, bool invert, fft_plan planf_2D, fft_plan planb_2D)
 
int img_ctf_apply_complex (Bimage *p, CTFparam &cp, bool flip, double wiener, double lores, double hires)
 Applies or corrects for the contrast transfer function (CTF). More...
 
int img_apply_phase_aberration (Bimage *p, CTFparam em_ctf)
 
int img_ttf_apply_one (Bimage *p, long nn, CTFparam ctf, int action, double wiener, double def, double res_lo, double res_hi, bool invert, Vector3< long > psize, fft_plan planf, fft_plan planb)
 
int img_ctf_apply_to_proj (Bimage *proj, CTFparam em_ctf, double defocus, double res_lo, double res_hi, bool invert, fft_plan planf_2D, fft_plan planb_2D)
 Applies a CTF to a projection image. More...
 
int img_ttf_apply (Bimage *p, CTFparam ctf, int action, double wiener, Vector3< long > tile_size, double tilt, double axis, double res_lo, double res_hi, int invert)
 Applies or corrects for the tilted contrast transfer function (TTF). More...
 
int mg_ps_name (Bmicrograph *mg, int img_num, Bstring &path, Bstring &newname, Bstring insert)
 
Bimagemg_ctf_prepare (Bmicrograph *mg, int action, double lores, double hires, Vector3< long > tile_size, double def_start, double def_end, double def_inc, int flags)
 
int rec_ctf_prepare (Breconstruction *rec, int action, double lores, double hires, Vector3< long > tile_size, double def_start, double def_end, double def_inc, Bstring &newname, int flags)
 
int project_ctf_prepare (Bproject *project, int action, double lores, double hires, Vector3< long > tile_size, double def_start, double def_end, double def_inc, Bstring &path, Bstring &newname, int flags)
 Calculates power spectra and optionally fits CTF curves. More...
 
int part_ctf (Bparticle *partlist, int action, double lores, double hires, double wiener, DataType datatype, Bstring &partpath, Bstring &newname, int flags)
 
int mg_ctf (Bmicrograph *mg, Bimage *pmg, int action, double lores, double hires, double wiener, Vector3< long > tile_size, DataType datatype, Bstring &newname, int flags)
 
int rec_ctf (Breconstruction *rec, int action, double lores, double hires, double wiener, DataType datatype, Bstring &newname, int flags)
 
int project_ctf (Bproject *project, int action, double lores, double hires, Vector3< long > tile_size, double wiener, DataType datatype, Bstring &partpath, Bstring &newname, int flags)
 Calculates or fits CTF curves to multiple power spectra. More...
 
double img_ctf_isotropy (Bimage *p, long n, CTFparam &em_ctf, double lores, double hires)
 Calculates the isotropy of the power spectrum adjusted for astigmatism. More...
 
double sinc_find_argument (double v)
 
int project_powerspectrum_isotropy (Bproject *project, double lores, double hires)
 Calculates the isotropy at the CTF maxima. More...
 
JSvalue project_defocus_range (Bproject *project)
 Determines the minimum and maximum defocus values. More...
 
int project_ctf_average (Bproject *project, Bstring &psname)
 Calculates or fits CTF curves to multiple power spectra. More...
 
Bimageproject_powerspectrum_average (Bproject *project, double deftarget)
 Averages multiple power spectra based on defocus estimates. More...
 
int project_merge_CTF_parameters (Bproject *project, Bproject *ctfproject)
 Puts CTF parameters from one project into another. More...
 
int project_CTF_to_part (Bproject *project)
 Transfers CTF parameters from micrographs to particles. More...
 
int project_set_defocus (Bproject *project, double def_avg, double def_dev, double ast_angle)
 Sets the defocus values of all the micrographs. More...
 
int project_set_astigmatism (Bproject *project, double def_dev, double ast_angle)
 Sets the defocus deviation and astigmatism angle of all the micrographs. More...
 
int project_update_ctf (Bproject *project, JSvalue &jsctf)
 Updates the CTF parameters of all the micrographs. More...
 
int project_set_volts (Bproject *project, double volts)
 Sets the acceleration voltage of all the micrographs. More...
 
int project_set_Cs (Bproject *project, double Cs)
 Sets the spherical aberation constant of all the micrographs. More...
 
int project_set_amp_shift (Bproject *project, double amp_shift)
 Sets the amplitude contribution of all the micrographs. More...
 
int project_set_focal_length (Bproject *project, double focal_length)
 Sets the focal length of all the micrographs. More...
 
int project_set_aperture (Bproject *project, double aperture)
 Sets the objective aperture of all the micrographs. More...
 
int project_set_slit_width (Bproject *project, double slit)
 Sets the energy filter slit width of all the micrographs. More...
 
int project_set_alpha (Bproject *project, double alpha)
 Sets the beam source size/divergence angle of all the micrographs. More...
 
int project_set_envelope_type (Bproject *project, int type)
 Sets the envelope type of all the micrographs. More...
 
int project_set_envelope (Bproject *project, int type, vector< double > &coeff)
 Sets the envelope equations of all the micrographs. More...
 
int project_set_coherence_envelope (Bproject *project)
 Replaces envelope equations with those based on partial coherence in all micrographs. More...
 
int project_set_baseline_type (Bproject *project, int type)
 Sets the baseline type of all the micrographs. More...
 
int project_set_baseline (Bproject *project, int type, vector< double > &coeff)
 Sets the baseline equations of all the micrographs. More...
 
map< string, CTFparamproject_ctf_optics_groups (Bproject *project)
 Retrieves unique optics groups as CTF parameters. More...
 
long project_update_ctf_aberration (Bproject *project, map< string, CTFparam > &cpa, int flag)
 Updates the aberration weights for all optics groups. More...
 
int project_aberration_compare (Bproject *project, Bproject *project2)
 Compares the aberration parameters from two projects. More...
 
int project_delete_aberration (Bproject *project, int which)
 Deletes the aberration parameters of all the micrographs. More...
 
int project_update_first_zero (Bproject *project)
 Updates the first zero from the defocus average for all the micrographs. More...
 
int project_plot_ctf (Bproject *project, Bstring &filename)
 Plots the CTF curves. More...
 
long project_ctf_statistics (Bproject *project)
 Calculates CTF parameter statistics. More...
 

Variables

int verbose
 

Detailed Description

Functions for CTF (contrast transfer function) processing.

Author
Bernard Heymann
Date
Created: 19970715
Modified: 20230105

Function Documentation

◆ aberration()

double aberration ( long  n,
long  m,
double  s,
double  p 
)

◆ aberration_even_terms()

vector< double > aberration_even_terms ( long  nt,
double  u,
double  v 
)

◆ aberration_odd_terms()

vector< double > aberration_odd_terms ( long  nt,
double  u,
double  v 
)

◆ aberration_terms() [1/2]

vector< double > aberration_terms ( long  nt,
double  u,
double  v 
)

◆ aberration_terms() [2/2]

vector< double > aberration_terms ( map< pair< long, long >, double > &  wa,
double  u,
double  v 
)

◆ aberration_weight_string()

string aberration_weight_string ( map< pair< long, long >, double > &  weights)

◆ aberration_weights()

map< pair< long, long >, double > aberration_weights ( vector< double >  v,
int  flag 
)

◆ img_aberration_basis()

int img_aberration_basis ( Bimage p,
int  flag 
)

◆ img_apply_phase_aberration()

int img_apply_phase_aberration ( Bimage p,
CTFparam  em_ctf 
)

◆ img_create_aberration() [1/4]

int img_create_aberration ( Bimage p,
CTFparam  cp,
int  flag 
)

◆ img_create_aberration() [2/4]

int img_create_aberration ( Bimage p,
map< pair< long, long >, double > &  weights,
int  flag 
)

◆ img_create_aberration() [3/4]

int img_create_aberration ( Bimage p,
map< string, CTFparam > &  cpa,
int  flag 
)

◆ img_create_aberration() [4/4]

int img_create_aberration ( Bimage p,
vector< map< pair< long, long >, double > > &  weights,
int  flag 
)

◆ img_ctf_apply() [1/2]

int img_ctf_apply ( Bimage p,
CTFparam  em_ctf,
int  action,
double  wiener,
double  lores,
double  hires,
bool  invert 
)

Applies or corrects for the contrast transfer function (CTF).

Parameters
*pimage (modified).
em_ctfCTF parameter structure.
actionaction to be taken.
wienerWiener factor (fraction).
loreslow resolution limit.
hireshigh resolution limit.
invertphase flip to invert contrast.
Returns
int 0, <0 on error.
The actions for this funtion are:
1   flip phase (multiply by the sign of the CTF)
2   apply a CTF (multiply with the CTF)
3   correct for the CTF: ctf/(ctf^2 + wiener_factor)
4   correct for the CTF: env*ctf/((env*ctf)^2 + noise^2)
5   correct for the CTF with baseline: ctf/(ctf^2*noise^2 + wiener_factor)
6   correct for the CTF with baseline: 1/(ctf*noise + sign*wiener_factor)

◆ img_ctf_apply() [2/2]

int img_ctf_apply ( Bimage p,
CTFparam  em_ctf,
int  action,
double  wiener,
double  lores,
double  hires,
bool  invert,
fft_plan  planf_2D,
fft_plan  planb_2D 
)

◆ img_ctf_apply_complex()

int img_ctf_apply_complex ( Bimage p,
CTFparam cp,
bool  flip,
double  wiener,
double  lores,
double  hires 
)

Applies or corrects for the contrast transfer function (CTF).

Parameters
*pimage (modified).
cpCTF & aberration parameters.
flipFlip phases of even aberrations.
wienerWiener factor (fraction), if 0, flip phases.
loreslow resolution limit.
hireshigh resolution limit.
Returns
int 0, <0 on error.

◆ img_ctf_apply_to_proj()

int img_ctf_apply_to_proj ( Bimage proj,
CTFparam  em_ctf,
double  defocus,
double  res_lo,
double  res_hi,
bool  invert,
fft_plan  planf_2D,
fft_plan  planb_2D 
)

Applies a CTF to a projection image.

Parameters
*projprojection image.
em_ctfCTF parameters.
defocusdefocus.
res_lolow resolution limit (angstrom).
res_hihigh resolution limit (angstrom).
invertphase flip to invert contrast.
planf_2D2D forward fourier transform plan.
planb_2D2D backward fourier transform plan.
Returns
int error code.

◆ img_ctf_calculate() [1/2]

Bimage * img_ctf_calculate ( CTFparam cp,
bool  flip,
double  wiener,
Vector3< long >  size,
Vector3< double >  sam,
double  lores,
double  hires 
)

Calculates an aberration image.

Parameters
cpCTF & aberration parameters.
flipFlip phases of even aberrations.
wienerWiener factor (fraction), if 0, flip phases.
sizenew image size.
samnew image pixel size.
loreslow resolution limit.
hireshigh resolution limit.
Returns
Bimage* new complex CTF function image.
Functions:
    angle = atan(y/x)
    s2 = x*x + y*y
    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)
Note: Defocus is positive for underfocus and negative for overfocus.

◆ img_ctf_calculate() [2/2]

Bimage * img_ctf_calculate ( CTFparam  cp,
int  action,
double  wiener,
Vector3< long >  size,
Vector3< double >  sam,
double  lores,
double  hires 
)

Calculates a CTF image.

Parameters
cpCTF parameters.
actiontype of CTF calculated (1-8).
wienerWiener factor (fraction).
sizenew image size.
samnew image pixel size.
loreslow resolution limit.
hireshigh resolution limit.
Returns
Bimage* new CTF function image.
Functions:
    angle = atan(y/x)
    s2 = x*x + y*y
    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)
Note: Defocus is positive for underfocus and negative for overfocus.

◆ img_ctf_isotropy()

double img_ctf_isotropy ( Bimage p,
long  n,
CTFparam em_ctf,
double  lores,
double  hires 
)

Calculates the isotropy of the power spectrum adjusted for astigmatism.

Parameters
*pimage structure.
nsub-image number.
&em_ctfCTF parameter structure.
loreslow resolution limit.
hireshigh resolution limit
Returns
double radial average std/avg ratio.
A power spectrum with its origin at the center.

◆ img_ttf_apply()

int img_ttf_apply ( Bimage p,
CTFparam  ctf,
int  action,
double  wiener,
Vector3< long >  tile_size,
double  tilt,
double  axis,
double  res_lo,
double  res_hi,
int  invert 
)

Applies or corrects for the tilted contrast transfer function (TTF).

Parameters
*pimage (modified).
ctfCTF parameter structure.
actionaction to be taken.
wienerWiener factor (fraction).
tile_sizetile size for tilted CTF operations.
tilttilt angle (radians).
axistilt axis angle (radians).
res_lohigh resolution limit.
res_hilow resolution limit.
invertphase flip to invert contrast.
Returns
int 0, <0 on error.
The actions for this funtion are:
1   flip phase (multiply by the sign of the CTF)
2   apply a CTF (multiply with the CTF)
3   correct for the CTF: ctf/(ctf^2 + wiener_factor)
4   correct for the CTF: env*ctf/((env*ctf)^2 + noise^2)
5   correct for the CTF with baseline: ctf/(ctf^2*noise^2 + wiener_factor)
6   correct for the CTF with baseline: 1/(ctf*noise + sign*wiener_factor)

◆ img_ttf_apply_one()

int img_ttf_apply_one ( Bimage p,
long  nn,
CTFparam  ctf,
int  action,
double  wiener,
double  def,
double  res_lo,
double  res_hi,
bool  invert,
Vector3< long >  psize,
fft_plan  planf,
fft_plan  planb 
)

◆ img_wave_aberration()

Bimage * img_wave_aberration ( CTFparam  cp,
Vector3< long >  size,
Vector3< double >  sam 
)

Calculates a wave aberration function.

Parameters
cpCTF parameters.
sizenew image size.
samnew image pixel size.
Returns
Bimage* new wave aberration function image.
Functions:
    angle = atan(y/x)
    s2 = x*x + y*y
    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;
Note: Defocus is positive for underfocus and negative for overfocus.

◆ mg_ctf()

int mg_ctf ( Bmicrograph mg,
Bimage pmg,
int  action,
double  lores,
double  hires,
double  wiener,
Vector3< long >  tile_size,
DataType  datatype,
Bstring newname,
int  flags 
)

◆ mg_ctf_prepare()

Bimage * mg_ctf_prepare ( Bmicrograph mg,
int  action,
double  lores,
double  hires,
Vector3< long >  tile_size,
double  def_start,
double  def_end,
double  def_inc,
int  flags 
)

◆ mg_ps_name()

int mg_ps_name ( Bmicrograph mg,
int  img_num,
Bstring path,
Bstring newname,
Bstring  insert 
)

◆ part_ctf()

int part_ctf ( Bparticle partlist,
int  action,
double  lores,
double  hires,
double  wiener,
DataType  datatype,
Bstring partpath,
Bstring newname,
int  flags 
)

◆ project_aberration_compare()

int project_aberration_compare ( Bproject project,
Bproject project2 
)

Compares the aberration parameters from two projects.

Parameters
*projectproject parameter structure.
*project2second project parameter structure.
Returns
int 0.

◆ project_ctf()

int project_ctf ( Bproject project,
int  action,
double  lores,
double  hires,
Vector3< long >  tile_size,
double  wiener,
DataType  datatype,
Bstring partpath,
Bstring newname,
int  flags 
)

Calculates or fits CTF curves to multiple power spectra.

Parameters
*projectproject parameter structure.
actionCTF processing action.
loreslow resolution limit for CTF operations.
hireshigh resolution limit for CTF operations.
tile_sizetile size for tilted CTF operations.
wienerWiener factor.
datatypecorrected particle file data type.
&partpathcorrected particle file path.
&newnamenew file name for output.
flags1=use mg or rec, 2=filter, 4=background, 8=astigmatism, 16=use frames, 32=invert
Returns
int 0, <0 on error.
The default is to use the particle file. If the particle file is not
specified, the micrograph is used. The selection can also be done with
the use_mg flag.

◆ project_ctf_average()

int project_ctf_average ( Bproject project,
Bstring psname 
)

Calculates or fits CTF curves to multiple power spectra.

Parameters
*projectproject parameter structure.
&psnamepostscript file name for output.
Returns
int 0, <0 on error.
The default is to use the particle file. If the particle file is not
specified, the micrograph is used. The selection can also be done with
the use_mg flag.

◆ project_ctf_optics_groups()

map< string, CTFparam > project_ctf_optics_groups ( Bproject project)

Retrieves unique optics groups as CTF parameters.

Parameters
*projectproject parameter structure.
Returns
map<string,CTFparam> list of CTF instances.

◆ project_ctf_prepare()

int project_ctf_prepare ( Bproject project,
int  action,
double  lores,
double  hires,
Vector3< long >  tile_size,
double  def_start,
double  def_end,
double  def_inc,
Bstring path,
Bstring newname,
int  flags 
)

Calculates power spectra and optionally fits CTF curves.

Parameters
*projectproject parameter structure.
actionCTF processing action.
loreslow resolution limit for CTF operations.
hireshigh resolution limit for CTF operations.
tile_sizetile size for power spectrum generation.
def_startdefocus search start (default 1e3).
def_enddefocus search end (default 2e5).
def_incdefocus search increment (default 1e3).
&pathnew power spectrum directory for output.
&newnamenew file name for output.
flags1=use mg or rec, 2=filter, 4=background, 8=astigmatism, 16=frames, 32=aberration fit
Returns
int 0, <0 on error.
The default is to use the particle file. If the particle file is not
specified, the micrograph is used.

◆ project_ctf_statistics()

long project_ctf_statistics ( Bproject project)

Calculates CTF parameter statistics.

Parameters
*projectproject parameter structure.
Returns
long number of micrographs.

◆ project_CTF_to_part()

int project_CTF_to_part ( Bproject project)

Transfers CTF parameters from micrographs to particles.

Parameters
*projectproject parameter structure with all parameters.
Returns
int 0.

◆ project_defocus_range()

JSvalue project_defocus_range ( Bproject project)

Determines the minimum and maximum defocus values.

Parameters
*projectproject parameter structure.
Returns
JSvalue JSON object with the minimum and maximum values.

◆ project_delete_aberration()

int project_delete_aberration ( Bproject project,
int  which 
)

Deletes the aberration parameters of all the micrographs.

Parameters
*projectproject parameter structure.
which0=all, 1=odd, 2=even.
Returns
int 0.

◆ project_merge_CTF_parameters()

int project_merge_CTF_parameters ( Bproject project,
Bproject ctfproject 
)

Puts CTF parameters from one project into another.

Parameters
*projectproject parameter structure with all parameters.
*ctfprojectproject parameter structure with CTF parameters.
Returns
int 0.

◆ project_plot_ctf()

int project_plot_ctf ( Bproject project,
Bstring filename 
)

Plots the CTF curves.

Parameters
*projectproject parameter structure.
&filenamePostscript file name.
Returns
int 0.

◆ project_powerspectrum_average()

Bimage * project_powerspectrum_average ( Bproject project,
double  deftarget 
)

Averages multiple power spectra based on defocus estimates.

Parameters
*projectproject parameter structure.
deftargettarget defocus (angstrom).
Returns
Bimage* average power spectrum.

◆ project_powerspectrum_isotropy()

int project_powerspectrum_isotropy ( Bproject project,
double  lores,
double  hires 
)

Calculates the isotropy at the CTF maxima.

Parameters
*projectproject parameter structure.
loreslow resolution limit.
hireshigh resolution limit
Returns
int 0.

◆ project_set_alpha()

int project_set_alpha ( Bproject project,
double  alpha 
)

Sets the beam source size/divergence angle of all the micrographs.

Parameters
*projectproject parameter structure.
alphabeam source size/divergence angle (radians).
Returns
int 0.

◆ project_set_amp_shift()

int project_set_amp_shift ( Bproject project,
double  amp_shift 
)

Sets the amplitude contribution of all the micrographs.

Parameters
*projectproject parameter structure.
amp_shiftamplitude contribution phase shift.
Returns
int 0.

◆ project_set_aperture()

int project_set_aperture ( Bproject project,
double  aperture 
)

Sets the objective aperture of all the micrographs.

Parameters
*projectproject parameter structure.
apertureobjective aperture in angstrom.
Returns
int 0.

◆ project_set_astigmatism()

int project_set_astigmatism ( Bproject project,
double  def_dev,
double  ast_angle 
)

Sets the defocus deviation and astigmatism angle of all the micrographs.

Parameters
*projectproject parameter structure.
def_devdefocus deviation.
ast_angleastigmatism angle.
Returns
int 0.

◆ project_set_baseline()

int project_set_baseline ( Bproject project,
int  type,
vector< double > &  coeff 
)

Sets the baseline equations of all the micrographs.

Parameters
*projectproject parameter structure.
typebaseline type.
&coeff5 baseline coefficients.
Returns
int 0.

◆ project_set_baseline_type()

int project_set_baseline_type ( Bproject project,
int  type 
)

Sets the baseline type of all the micrographs.

Parameters
*projectproject parameter structure.
typebaseline type.
Returns
int 0.

◆ project_set_coherence_envelope()

int project_set_coherence_envelope ( Bproject project)

Replaces envelope equations with those based on partial coherence in all micrographs.

Parameters
*projectproject parameter structure.
Returns
int 0.
Partial coherence envelope:
    env = amp*exp(-(pi*alpha*defocus*s)^2)
The amplitude, defocus and alpha values are taken from the fields 
in each micrograph. The defocus must already be determined.

◆ project_set_Cs()

int project_set_Cs ( Bproject project,
double  Cs 
)

Sets the spherical aberation constant of all the micrographs.

Parameters
*projectproject parameter structure.
Csspherical aberation constant in angstrom.
Returns
int 0.

◆ project_set_defocus()

int project_set_defocus ( Bproject project,
double  def_avg,
double  def_dev,
double  ast_angle 
)

Sets the defocus values of all the micrographs.

Parameters
*projectproject parameter structure.
def_avgdefocus average.
def_devdefocus deviation.
ast_angleastigmatism angle.
Returns
int 0.

◆ project_set_envelope()

int project_set_envelope ( Bproject project,
int  type,
vector< double > &  coeff 
)

Sets the envelope equations of all the micrographs.

Parameters
*projectproject parameter structure.
typeenvelope type.
&coeff5 envelope coefficients.
Returns
int 0.

◆ project_set_envelope_type()

int project_set_envelope_type ( Bproject project,
int  type 
)

Sets the envelope type of all the micrographs.

Parameters
*projectproject parameter structure.
typeenvelope type.
Returns
int 0.

◆ project_set_focal_length()

int project_set_focal_length ( Bproject project,
double  focal_length 
)

Sets the focal length of all the micrographs.

Parameters
*projectproject parameter structure.
focal_lengthfocal length in angstrom.
Returns
int 0.

◆ project_set_slit_width()

int project_set_slit_width ( Bproject project,
double  slit 
)

Sets the energy filter slit width of all the micrographs.

Parameters
*projectproject parameter structure.
slitslit width in eV.
Returns
int 0.

◆ project_set_volts()

int project_set_volts ( Bproject project,
double  volts 
)

Sets the acceleration voltage of all the micrographs.

Parameters
*projectproject parameter structure.
voltsacceleration voltage.
Returns
int 0.

◆ project_update_ctf()

int project_update_ctf ( Bproject project,
JSvalue jsctf 
)

Updates the CTF parameters of all the micrographs.

Parameters
*projectproject parameter structure.
jsctfJSON parameters to be updated.
Returns
int 0.

◆ project_update_ctf_aberration()

long project_update_ctf_aberration ( Bproject project,
map< string, CTFparam > &  cpa,
int  flag 
)

Updates the aberration weights for all optics groups.

Parameters
*projectproject parameter structure.
&cpalist of CTF parameters for the optics groups.
flag0=replace, 1=add
Returns
long number of optics groups not found.

◆ project_update_first_zero()

int project_update_first_zero ( Bproject project)

Updates the first zero from the defocus average for all the micrographs.

Parameters
*projectproject parameter structure.
Returns
int 0.

◆ rec_ctf()

int rec_ctf ( Breconstruction rec,
int  action,
double  lores,
double  hires,
double  wiener,
DataType  datatype,
Bstring newname,
int  flags 
)

◆ rec_ctf_prepare()

int rec_ctf_prepare ( Breconstruction rec,
int  action,
double  lores,
double  hires,
Vector3< long >  tile_size,
double  def_start,
double  def_end,
double  def_inc,
Bstring newname,
int  flags 
)

◆ sinc_find_argument()

double sinc_find_argument ( double  v)

Variable Documentation

◆ verbose

int verbose
extern