Photometric determination of small amounts of magnesium in rocks