Adjust per-particle defocus of subparticles in volume alignment tools?

HI @rposert,

This script is still very handy! However, it fails using input from volume alignment tools as of CS v4.6.2, as VAT no longer has a particles.ctf slot in the output:

Traceback (most recent call last):
  File "adjust_defocus_subparticles.py", line 81, in <module>
    row["ctf/df1_A"] -= pose_recenter_vec_A[2]
  File "/home/user/.local/lib/python3.8/site-packages/cryosparc/row.py", line 36, in __getitem__
    return self.cols[key][self.idx]
KeyError: 'ctf/df1_A'

VAT output (v4.2):

VAT output (job cloned and run in 4.6.2):

By the way, did you ever figure out why it is working for translations along Z, but not other defocus adjustments?

Cheers
Oli

EDIT:

This error seems to be due to a way metadata is handled in v4.6.2. If I run local refine (4.6.2) → VAT (v4.6.2) → adjust defocus, everything is fine. If I run local refine (old, v4.2) → VAT (v4.6.2) I get the problem above. Looking at the local refine jobs:

Input from local refine (v4.6.2):

Input from local refine (v4.2):

So if an old local refinement job (or particle set in general) is passed to a new VAT job, the particles.ctf slot is lost. This also causes failure of subsequent reconstruction jobs:
image