def _altitude_factor(alt_units_in: str, alt_units_out: str) -> float:
    """
    Helper method for convert_altitude.

    Parameters
    ----------
    alt_units_in : str
        Original alt unit.
    alt_units_out : str
        Nominal alt unit.

    Returns
    -------
    factor : float
        Conversion factor to nominal altitude unit.

    """
    factor = 1.0
    # units to feet
    if alt_units_in == 'm':
        factor /= 0.3048
    elif alt_units_in == 'ft':
        pass
    elif alt_units_in == 'kft':
        factor *= 1000.
    else:
        raise RuntimeError('alt_units_in=%r is not valid; use [ft, m, kft]' % alt_units_in)

    # ft to m
    if alt_units_out == 'm':
        factor *= 0.3048
    elif alt_units_out == 'ft':
        pass
    elif alt_units_out == 'kft':
        factor /= 1000.
    else:
        raise RuntimeError('alt_units_out=%r is not valid; use [ft, m, kft]' % alt_units_out)
    return factor