@classmethod
def _mixing_ratio_to_density(cls, pres, temp, mixrat):
    """Converts mixing ratio (measured in g/kg) to density (measured in g/m3).

        This is designed for use with mixing ratios derived from radiosonde measurements,
        where the mixing ratio defines the grams of water per kg of dry air.

        Arguments:

        * ``pres`` -- Pressure in mb
        * ``temp`` -- Temperature in K
        * ``mixrat`` -- Mixing ratio in g/kg

        All arguments can be scalars or ndarrays - if the latter then they must all be the same length.

        """
    mass = 0.3484 * (pres / temp) * (1 - 0.000379 * mixrat)
    density = mixrat * mass
    return density
