Extracting parameters from slanted non-uniform gratings recorded in photopolymer. Part I: Theoretical derivations