def get_units(unit):
    """
    Return a dict of units based on the unit format code.
    :type unit: str
    :param unit: unit format
    :return dict containing units for weather measurements
    """
    if unit == 'us':
        return {
            'unit': 'us',
            'nearestStormDistance': 'mph',
            'precipIntensity': 'in/h',
            'precipIntensityMax': 'in/h',
            'precipAccumulation': 'in',
            'temperature': 'F',
            'temperatureMin': 'F',
            'temperatureMax': 'F',
            'apparentTemperature': 'F',
            'dewPoint': 'F',
            'windSpeed': 'mph',
            'pressure': 'mb',
            'visibility': 'mi'
        }
    elif unit == 'ca':
        return {
            'unit': 'ca',
            'nearestStormDistance': 'km',
            'precipIntensity': 'mm/h',
            'precipIntensityMax': 'mm/h',
            'precipAccumulation': 'cm',
            'temperature': 'C',
            'temperatureMin': 'C',
            'temperatureMax': 'C',
            'apparentTemperature': 'C',
            'dewPoint': 'C',
            'windSpeed': 'km/h',
            'pressure': 'hPa',
            'visibility': 'km'
        }
    elif unit == 'uk2':
        return {
            'unit': 'uk2',
            'nearestStormDistance': 'mi',
            'precipIntensity': 'mm/h',
            'precipIntensityMax': 'mm/h',
            'precipAccumulation': 'cm',
            'temperature': 'C',
            'temperatureMin': 'C',
            'temperatureMax': 'C',
            'apparentTemperature': 'C',
            'dewPoint': 'C',
            'windSpeed': 'mph',
            'pressure': 'hPa',
            'visibility': 'mi'
        }
    # si
    return {
        'unit': 'si',
        'nearestStormDistance': 'km',
        'precipIntensity': 'mm/h',
        'precipIntensityMax': 'mm/h',
        'precipAccumulation': 'cm',
        'temperature': 'C',
        'temperatureMin': 'C',
        'temperatureMax': 'C',
        'apparentTemperature': 'C',
        'dewPoint': 'C',
        'windSpeed': 'm/s',
        'pressure': 'hPa',
        'visibility': 'km'
    }