Directional etch of magnetic and noble metals. I. Role of surface oxidation states