A simple method for the analysis of depth-selective Mössbauer-effect measurements