Converts ``datetime`` objects lists into absolute minutes 
        vectors. It also can be used to generate absolute minutes vector
        from a time interval (in minutes).
        
        :param time_obj: ``datetime`` objects to convert into absolute 
            minutes.
        :type time_obj: list of ``datetime`` objects
        :param dt: Constant interval time to generate a time vector for
            a whole year.
        :type dt: int
        :returns: Equivalent times in absolute minutes in year.
        :rtype: ndarray (dtype=int)
        
        .. note:: If the time_obj has times higher than 23:59 31 Dec, 
            they will be removed.
        .. note:: If a leap-year is introduced, the method will remove
            the last year (31 Dec) in order to keep the series 
            continuous.

def to_minutes(time_obj = None, dt = None):
        '''
        Converts ``datetime`` objects lists into absolute minutes 
        vectors. It also can be used to generate absolute minutes vector
        from a time interval (in minutes).
        
        :param time_obj: ``datetime`` objects to convert into absolute 
            minutes.
        :type time_obj: list of ``datetime`` objects
        :param dt: Constant interval time to generate a time vector for
            a whole year.
        :type dt: int
        :returns: Equivalent times in absolute minutes in year.
        :rtype: ndarray (dtype=int)
        
        .. note:: If the time_obj has times higher than 23:59 31 Dec, 
            they will be removed.
        .. note:: If a leap-year is introduced, the method will remove
            the last year (31 Dec) in order to keep the series 
            continuous.
        '''
        import datetime

        if dt is not None and time_obj is None:
            return np.arange(0, 365*24*60, dt, dtype = int)
            
        elif dt is None and time_obj is not None:
            if type(time_obj) == datetime.datetime: 
                time_obj = [time_obj]
            
            year = time_obj[0].year
            time = []
            for obj in time_obj:
                tt = obj.timetuple()
                if year == tt.tm_year:
                    time.append((tt.tm_yday-1)*24*60 +
                                 tt.tm_hour*60 +
                                 tt.tm_min)
            return np.array(time, dtype=int)
            
        else:
            raise ValueError('Input error')