A method to determine the capping inversion of the convective boundary layer