  It is shown theoretically how to directly obtain the energy distribution of a
weakly interacting gas of bosons confined in an optical lattice in the
tight-binding limit. This is accomplished by adding a linear potential to a
suitably prepared lattice, and allowing the gas to evolve under the influence
of the total potential. After a prescribed time, a spectral transform is
effected where each (highly non-local) energy state is transformed into a
distinct site of the lattice, thus allowing the energy distribution to be
(non-destructively) imaged in real space. Evolving for twice the time returns
the atoms to their initial state. The results suggest efficient methods to both
measure the temperature in situ, as well as to cool atoms within the lattice:
after applying the spectral transform one simply needs to remove atoms from all
but a few lattice sites. Using exact numerical calculations, the effects of
interactions and errors in the application of the lattice are examined.
