Applications of dynamical diffraction under locally plane wave conditions: defects in nearly perfect crystals and X-ray refractometry.