Hi Mike,
Yes, that does the trick. However, self._data_source.quantities["TotalQuantity"]("ParticleMassMsun") returns a list, so I needed to add a '[0]' in order to get just the number.
I'm glad it helped. I will make this change soon to the source. I always forget about that list part!
It's not immediately clear to me how to implement this fix for the dm_only=True case, in which you only want the sum over DM particles.
It may be possible to write a special field or something... I'll think about it.
Lastly, does the sub_mass calculation have to be done even when subvolume is None and only a single processor is being used? It seems in this case sub_mass = total_mass and the second calculation could be skipped.
I think you're right. I'll make this change too! Thanks for pointing this out. -- Stephen Skory s@skory.us http://stephenskory.com/ 510.621.3687 (google voice)