Calculation of natural gas compression factor