I think this will give me what I want, based on my own prior understanding, and additionally the discussion in the previous conversation I linked.
See, e.g., this message from Ben Brown (copied verbatim from previous discussion):
Ruben, re energy spectra: Evan's exactly right (and Daniel wrote to me about the same off-list):
it depends on what you want. If you want the spectrum of the kinetic energy, then KE['c'] gets you that.
But if you want the energy spectrum (e.g., as used in turbulence theory), then what you want is dot(u['c'], np.conj(u['c'])), which is not the same.
The energy spectrum function E(k,t) is:
E(k,t) = int[Φ_ii(k, t)*δ(|k| - k)dk] (eq 3.166)
with Φ_ii the velocity spectrum tensor, which is given by the fourier transform of the two point correlation. Since the two point correlation is itself computable from FFTs, then I'm pretty sure
Φ_ii ~ dot(u_i['c'], np.conj(u_i['c'])) (eq 3.160 & 3.163)
up to constant factors, but you should check to make sure everything lines up with what you're comparing against.
Also, in case we forgot to say it elsewhere, one needs to be real careful when computing power spectra where one direction is represented on chebyshevs; coefficients in chebyshevs do not translate in the same way as in spherical harmonics or fourier. This is why most spherical shell spectra are horizontal spectra only, evaluated at some specified shell depth (like mid-shell). To do something like this, do:
E = dot(u(r=r_i).evaluate()['c'], np.conj(u(r=r_i).evaluate()['c']))
where r_i = 0.5 or whatever depth you want to evaluate at.
I think this is correct, but haven't tested it.
Also, poloidal/toroidal decompositions are a completely different equation formulation, so the power spectrum of e.g., W and Z from the Magic code's approach are going to be substantially different from your results if you're directly solving for u. It will take care to convert back and forth between those and the velocity components. I would probably choose to obtain the velocity components u from your comparison code, calculate the energy spectrum directly yourself, and compare to that.
--Ben