Generation of nearly pure and highly directional magnetic light in fluorescence of rare-earth ions