1. A spectral encoder for producing spectrally selected images of a radiation field containing multiple spectral components, comprising: an imaging spectrograph that defines a first optical path that produces from the input radiation field a spectrally dispersed image comprising multiple spectral components displaced along a dispersion direction; means, comprising a spatial light modulator, for encoding spectral pass bands on the dispersed image using one or more spatial masks; the imaging spectrograph further defining a second optical path that reverses the spectral dispersion of the first path and produces a spectrally-encoded polychromatic output image containing spectral components as encoded by the spatial mask; wherein the first and second optical paths share a common dispersing element; and a detector that records at least one spatial region of the spectrally encoded output image.