Allow varying CTF params in exposure group (Feature request)


Currently Exposure Group Utilities fails if a CTF parameter varies within the newly designated group (e.g. see attached error).

For certain workflows this is undesirable - for example, refinement of tetrafoil aberrations or anisotropic magnification may require more data than refinement of beam tilt, so we would like to refine beam tilts with image shift groups, while refining overall values for the entire dataset for other parameters.

Would it be possible to optionally disable this warning as an advanced parameter?


[CPU:  298.1 MB  Avail: 373.21 GB]
Operation type is combine&set.
[CPU:  298.1 MB  Avail: 373.21 GB]
Setting exposure group ID 1 for entire dataset
[CPU:  298.1 MB  Avail: 373.21 GB]

[CPU:  298.1 MB  Avail: 373.21 GB]
Now verifying if CTF values are constant across entire exposure group...
[CPU:  479.9 MB  Avail: 373.02 GB]
Traceback (most recent call last):
  File "cryosparc_master/cryosparc_compute/", line 96, in
  File "/home/user/software/cryosparc/cryosparc2_master/cryosparc_compute/jobs/utilities/", line 233, in run_exp_groups
    assert False, "Field %s is not constant in group %d with %d items, should be %s" % (field, eg_id, len(exp_group), str(first_value_in_group))
AssertionError: Field ctf/shift_A is not constant in group 1 with 504733 items, should be [0.2655208 0.5999216]

Hi @olibclarke,

Right now by construction an exposure group requires that all of the higher-order aberration parameters are constant within the exposure group (all parameters that are fit during Global CTF Refinement-- basically all CTF parameters except defoci, astigmatism, phase shift). So, even bypassing the warning, Global CTF Refinement wouldn’t support the kind of workflow that you’re suggesting, of having some CTF parameters (e.g. tilt_A) to be refined per image-shift group but others (e.g. tetra_A or anisomag) be refined per-exposure-group (which may include multiple image-shift groups).

This is definitely a good suggestion though, as it does seem given recent discussions that splitting by image-shift is generally a good idea for CTF refinement. In that vein, it may be a good idea to consider a “hierarchical” structure to exposure groups… We’ll triage this as a larger improvement to CTF Refinement going forward!


1 Like