Calculating the weight of a gas sample