mattwthompson / scattering

Functions for analyzing molecular simulations according to scattering experiments
MIT License
9 stars 9 forks source link

Better handling of virtual sites #14

Closed mattwthompson closed 3 years ago

mattwthompson commented 4 years ago

In the case of water models with off-nuclei charge sites or other virtual sites, I've found the virtual sites are treated like particles and/or the normalization is thrown off.

Here, atoms with no physical element attribute are not filtered out:

https://github.com/mattwthompson/scattering/blob/b4fc5e605c7dfa783c585c281ec3bf7d7feac70c/scattering/scattering.py#L166

and here, atomic concentrations are divided by the total number of "atoms" in the MDTraj trajectory, which includes virtual sites.

https://github.com/mattwthompson/scattering/blob/b4fc5e605c7dfa783c585c281ec3bf7d7feac70c/scattering/scattering.py#L184-L185

rmatsum836 commented 3 years ago

I think we can close this issue. Perhaps in #54 we should include a system with virtual sites. It's probably easiest to slice out the virtual sites from the MDTraj.trajectory before passing into compute_van_hove.