Added spectra.py

Spectra ON-OFF code