Compact refractive index and film thickness sensor