Gas measurement and degassing