an apparatus for examining the surface of a crystalline sample uses in - plane grazing incidence diffraction with a position - sensitive detector . the x - ray source illuminates an extended region of the sample and , for crystal sections having the appropriate lattice orientation , an elongated diffraction signal is produced . the relative position of the sample and the x - ray beam may then be changed to illuminate different regions of the sample so that the diffraction signal corresponds to these other regions . by scanning across the entire sample , a spatial profile of the sample surface may be generated . the system may be used to locate crystal boundaries , defects , or the presence of attenuating materials on the sample surface .