Optical microspectrometers using imaging diffraction gratings door