def initialize_time(self):
        cr = self.config_run
        s = time_tools.TimeSummarizer()
        time = cr.get_key('time', default=False)
        if time:
            ##
            # A) Check consistency of given options
            ##
            if ('masks' in time or 'resolution' in time) and 'file' in time:
                e = exceptions.ModelError
                raise e('`time.masks` or `time.resolution` and `time.file` '
                        'cannot be given at the same time.')

            ##
            # B) Process masking and get a time resolution series
            ##
            if 'masks' in time:
                masks = []
                # time.masks is a list of {'function': .., 'options': ..} dicts
                for entry in time.masks:
                    entry = utils.AttrDict(entry)
                    mask_func = plugin_load(entry.function,
                                            builtin_module='time_masks')
                    mask_opts = entry.get_key('options', default=False)
                    if mask_opts:
                        mask = mask_func(self.data, **mask_opts)
                    else:
                        mask = mask_func(self.data)
                    masks.append(mask)
                mask_res = time.get('resolution', None)
                mask_drop_with_padding = time.get('drop_with_padding', None)
                converter = time_tools.masks_to_resolution_series
                series = converter(masks, how='or', resolution=mask_res,
                                   drop_with_padding=mask_drop_with_padding)
            elif 'resolution' in time:
                if self.data.time_res_static == time.resolution:
                    # If time.resolution is set to the resolution that
                    # the data is already in, do nothing
                    series = None
                else:
                    # Otherwise, prepare an appropriate time resolution
                    # series for resampling the data
                    getter = time_tools.resolution_series_uniform
                    series = getter(self.data, time.resolution)
            elif 'file' in time:
                res_file = utils.relative_path(cr.time.file,
                                               self.config_run_path)
                series = pd.read_csv(res_file, index_col=0, header=None)[1] \
                           .astype(int)[self.slice]
            else:  # Neither time.masks, time.resolution nor time.file given
                series = None

            if series is not None:
                s.dynamic_timestepper(self.data, series)
            else:
                # Silently ignore if no conformant time settings given
                return None

        else:  # not time
            return None  # Nothing to do if no time settings given
Performs time resolution reduction, if set up in configuration
dataset/ETHPy150Open calliope-project/calliope/calliope/core.py/Model.initialize_time