def METHOD_NAME(self, X):
    """Get the HOG1D given a portion of a time series.
    X : a numpy array of shape = [interval_size]
    Returns
    -------
    histogram : a numpy array of shape = [num_bins].
    """
    # First step is to pad the portion on both ends once.
    gradients = [0.0] * (len(X))
    X = np.pad(X, 1, mode="edge")
    histogram = [0.0] * self.num_bins
    # Calculate the gradients of each element
    for i in range(1, len(X) - 1):
        gradients[(i - 1)] = self.scaling_factor * 0.5 * (X[(i + 1)] - X[(i - 1)])
    # Calculate the orientations
    orients = [math.degrees(math.atan(x)) for x in gradients]
    # Calculate the boundaries of the histogram
    hisBoundaries = [
        -90 + (180 / self.num_bins) + ((180 / self.num_bins) * x)
        for x in range(self.num_bins)
    ]
    # Construct the histogram
    for x in range(len(orients)):
        orientToAdd = orients[x]
        for y in range(len(hisBoundaries)):
            if orientToAdd <= hisBoundaries[y]:
                histogram[y] += 1.0
                break
    return histogram