def apply_weather_correction(enduse, fuel_y, cooling_factor_y,
    heating_factor_y, enduse_space_heating, enduse_space_cooling,
    f_weather_correction):
    """Change fuel demand for heat and cooling service
    depending on changes in HDD and CDD within a region
    (e.g. climate change induced). Change fuel consumption based on
    climate change induced temperature differences

    Arguments
    ----------
    enduse : str
        Enduse
    fuel_y : array
        Yearly fuel per fueltype
    cooling_factor_y : array
        Distribution of fuel within year to days (yd)
    heating_factor_y : array
        Distribution of fuel within year to days (yd)
    enduse_space_heating : list
        Enduses defined as space heating
    enduse_space_cooling : list
        Enduses defined as space cooling
    f_weather_correction : dict
        Correction factors to calculate hdd and cdd
        related extra demands in case a different
        weather station is used

    Return
    ------
    fuel_y : array
        Changed yearly fuel per fueltype

    Note
    ----
    - `cooling_factor_y` and `heating_factor_y` are based on the sum
        over the year. Therefore it is assumed that fuel correlates
        directly with HDD or CDD.
    """
    if enduse in enduse_space_heating:
        fuel_y = fuel_y * f_weather_correction['hdd']
        fuel_y = fuel_y * heating_factor_y
    elif enduse in enduse_space_cooling:
        fuel_y = fuel_y * f_weather_correction['cdd']
        fuel_y = fuel_y * cooling_factor_y
    return fuel_y
