how does the atmosphere affect electromagnetic radiation?