The property of a medium which determines how it absorbs or scatters electromagnetic radiation. It depends on the composition of the medium, its temperature, its density, and—unless an averaged value is being taken, as in the Rosseland mean opacity—on the wavelength of the radiation. In astronomical contexts, in a gas at a temperature below a few thousand degrees, molecules, grains, and ices suspended in the gas may all be significant causes of opacity. Above about 8000 K, the opacity rises very steeply with temperature as the gas is ionized, then above 104–105 K it declines slowly (see Kramers Opacity), reaching a plateau at around 106 K as electron scattering opacity becomes dominant. Calculations of opacity are important in determining stellar structure.