Expose more info from t_atom to trajectory analysis framework
Currently the functions [compute, refresh, initialize]MassesAndCharges expose the mass and charge of a group to the trajectoryanalysis framework. Both of these are just drawn straight from the t_atoms struct. In the course of computing scattering or density maps for EM, it will be useful to have direct access to the element name or atomic number. The atom type cou7ld potentially be useful as well, but I don't have a use case in mind yet.
Are there other things that should be exposed or good reasons not to expose more info to trajectoryanalysis? In particular, is there ever any case where this conditional
for (int i = pos.m.mapb.index[b]; i < pos.m.mapb.index[b+1]; ++i)
has more than a single iteration? I think this should always return a single atom by index and so it should be safe to pull more from the t_atoms struct, but if not would be interested to see where this could go wrong.
#5 Updated by Joe Jordan over 1 year ago
Yes, it is possible to get this info out directly from the topology in a few lines of code in the
initAnalysis section. My thinking here was that it might be nice to have direct access to this data in the
analyzeFrame section based on the position object. Otherwise, I think, it is necessary to create a map that connects mass and atomic number or to add it to the selection object in some way manually. I have an implementation of the map but I think it would be cleaner to just have direct access to the atom data in the position object.