Spectroscopy of molecular oxygen in the Atmospheres of Venus and Mars