mjo22 / cryojax

Cryo electron microscopy image simulation and analysis built on JAX.
https://mjo22.github.io/cryojax/
GNU Lesser General Public License v2.1
30 stars 13 forks source link

Move the accelerating voltage from the `CTF` #196

Closed mjo22 closed 7 months ago

mjo22 commented 7 months ago

For #167, it is looking like we may need to think about where the accelerating voltage / wavelength should go in the ImagePipeline pytree. TheAbstractScatteringPotential may need access to the wavelength. The wavelength is currently housed in the CTF class, however the CTF and scattering potential are unrelated.

(It is very important that we have no duplicate parameters in the ImagePipeline pytree. One way of testing this is with equinox.tree_check)

Whether or not this refactor is necessary for addressing #167, this will continue to come up, so wanted to mention now. For example, if we want to build out the model for the DQE in the AbstractDetector, it will also need the wavelength—as well as the dose rate. This is just one example. Many components of an image formation pipeline will specifically want to know about the wavelength and the dose rate.

It’s not completely clear how to address this in my mind, but something like the following skeleton is the best I have right now:

We can look into if using equinox.nn.Shared might be appropriate for this task, but it seems to me the above is better.

This should also be general enough to handle future models of radiation damage, which will be housed in the ElectronDose :)

mjo22 commented 7 months ago

Rethinking this, I think it would be better to move the voltage to the Instrument, not the ElectronDose.

See PR #200 for continued discussion.

mjo22 commented 7 months ago

Closed with #200