A thermodynamic approach to accurately determine pressure profiles for MOFs to assess their flexibility and loss of crystallinity