code: def dewpoint(e):
      r
      val = np.log(e / sat_pressure_0c)
      return 0. * units.degC + 243.5 * units.delta_degC * val / (17.67 - val)
docs: r"""Calculate the ambient dewpoint given the vapor pressure.
  
      Parameters
      ----------
      e : `pint.Quantity`
          Water vapor partial pressure
  
      Returns
      -------
      `pint.Quantity`
          Dew point temperature
  
      See Also
      --------
      dewpoint_rh, saturation_vapor_pressure, vapor_pressure
  
      Notes
      -----
      This function inverts the [Bolton1980]_ formula for saturation vapor
      pressure to instead calculate the temperature. This yield the following
      formula for dewpoint in degrees Celsius:
  
      .. math:: T = \frac{243.5 log(e / 6.112)}{17.67 - log(e / 6.112)}