NIR can be used to test a wide variety of substances; herbs and isolates such as amino acids. NIR can test almost anything, so long as we have a sample known to be that substance.
NIR works by comparing the fingerprint of a substance with an average of fingerprints of samples known to be that substance. Those fingerprints form a 3D reference model of what is acceptable. This is important, as even grown under similar conditions, the same plant will not grow in an identical fashion.
The NIR gives a reliable identification of a sample by comparing its spectra to the spectra of a sample of known characteristics. NIR analyses the transmissive properties of specific wavelengths of light in the sample being measured.
Here is a representation of spectral information into a three-dimensional image.