Measuring the concentration of gas