mantidproject / mantid

Main repository for Mantid code
https://www.mantidproject.org
GNU General Public License v3.0
212 stars 125 forks source link

Normalise by number of atoms in sample #21415

Closed ElliotAOram closed 5 years ago

ElliotAOram commented 6 years ago

In total scattering analysis (as well as other scientific areas) it is required to normalise a sample data set by the number of atoms in that sample. This issue will cover implementing an algorithm to do this. ws.sample().getMaterial().relativeMolecularMass() atomic mass of the compound (g.mol-1) - True for single element materials, need to verify this for compounds Will require mass of sample Might also possibly packing fraction and beam parameters (what percentage of sample is in the beam?) - this however may be out of scope of a simple alg like this.

Algorithm:

mol_mass = ws.sample().getMaterial().relativeMolecularMass()
sample_mass * (1/mol_mass) * avogadro constant = total atoms in sample

will review if this is an alg or just a one line for TS - depends on requirements elsewhere

ElliotAOram commented 6 years ago

This would be better placed as an addition to the Material allowing something like the following: number_of_atoms = ws.sample().getMaterial().getNumAtoms()

ElliotAOram commented 5 years ago

Can be closed as new approach is to follow the SNS lead on Total scattering