calculate theoretical maximum visibility of a grating interferometer from spectrum