The atmosphere is divided into layers based on changes in temperature with altitude. The layers include the troposphere, stratosphere, mesosphere, and thermosphere. The troposphere extends from the Earth's surface to 8-17 km altitude depending on latitude. Temperature decreases with height in the troposphere. Weather occurs in the troposphere. The stratosphere is above the troposphere and its temperature initially remains constant and then increases with altitude up to 50 km due to absorption of ultraviolet radiation by ozone. The stratopause marks the top of the stratosphere.