Analysis of the photoelastic effect in ionic crystals