Temperature measurements of magnesium- and aluminum-based flares