Principles of Gamma-ray Spectrometry