Real Space Method of Powder Diffraction for Non-Periodic and Nearly Periodic Materials