measuring temperature

you could measure the temperature of a system either by measuring the mean energy of the particles (for instance, the energies of photons from a thermal source) or by measuring the change of energy with entropy. under what circumstances is which method applicable?