This is practically impossible and what is actually done to measure the gas content may be an approximation to this process or may be arrived at by more theoretical methods. An example of the latter is the measurement of fluid pressure within the reservoir, the measurement of pore space within a rock sample using a porosimeter and a calculation of the gas content. The likely error with this knowing what actually occupies the pore space of the rock.
Sigra use four methods to determine the gas content of rocks. These are:
The first two of these are suitable for carbonaceous rocks in which the principal storage is by sorption while the latter two are suitable for most rocks.