def _altitude_factor(alt_units_in, alt_units_out):
    """helper method for convert_altitude"""
    factor = 1.0
    if alt_units_in == 'm':
        factor /= 0.3048
    elif alt_units_in == 'ft':
        pass
    elif alt_units_in == 'kft':
        factor *= 1000.0
    else:
        raise RuntimeError('alt_units_in=%r is not valid; use [ft, m, kft]' %
            alt_units_in)
    if alt_units_out == 'm':
        factor *= 0.3048
    elif alt_units_out == 'ft':
        pass
    elif alt_units_out == 'kft':
        factor /= 1000.0
    else:
        raise RuntimeError(
            'alt_units_out=%r is not valid; use [ft, m, kft]' % alt_units_out)
    return factor
