Energy Transfer Mechanisms and Optical Thermometry of BaMgF4:Yb3+,Er3+ Phosphor.