Using spectroellipsometry to examine multilayer gratings for sensors and photodetectors