Rotational excitations of methane molecules in porous media