X-ray determination of order parameters in lattices showing order-disorder transitions I: General theory