To get the parameter distribution of either a specific base-pair/step or a DNA segment over the MD simulation.

        parameters
        ----------
        parameter : str
            Name of a base-pair or base-step or helical parameter
            For details about accepted keywords, see ``parameter`` in the method
            :meth:`DNA.get_parameters`.

        bp : 1D list or array
            base-pairs to analyze
            Example: ::

                bp = [6]                                  # merge = False
                bp = [4,15]                               # merge = True

        bins int
            Number of bins to calculate histogram

        merge : bool
            ``Default=False``: As shown above, if ``True``, bp should a list of
            range otherwise a list of single value. If ``bp = True``, the
            parameter for the respective DNA segment could be merged or
            calculated by ``merge_method``.

        merge_method : str
            Method to calculate the parameter of a DNA segment from local
            parameters of all base-pairs/steps that are between the range given
            through ``bp``.
            Currently accepted keywords are as follows:

                * ``merge_method = mean``: Average of local parameters
                * ``merge_method = sum``: Sum of local parameters

        masked : bool
            ``Default=False``. To skip specific frames/snapshots.
            ``DNA.mask`` array should be set to use this functionality.
            This array contains boolean (either ``True`` or ``False``) value
            for each frame to mask the frames. Presently, mask array is
            automatically generated during :meth:`DNA.generate_smooth_axis` to
            skip those frames where 3D fitting curve was not successful within
            the given criteria.


        Returns
        -------
        values : 1D array
            Array containing parameter values
        density : 1D array
            Array containing density for respective parameter values

def parameter_distribution(self, parameter, bp, bins=30, merge=False, merge_method='mean', masked=False):
        """To get the parameter distribution of either a specific base-pair/step or a DNA segment over the MD simulation.

        parameters
        ----------
        parameter : str
            Name of a base-pair or base-step or helical parameter
            For details about accepted keywords, see ``parameter`` in the method
            :meth:`DNA.get_parameters`.

        bp : 1D list or array
            base-pairs to analyze
            Example: ::

                bp = [6]                                  # merge = False
                bp = [4,15]                               # merge = True

        bins int
            Number of bins to calculate histogram

        merge : bool
            ``Default=False``: As shown above, if ``True``, bp should a list of
            range otherwise a list of single value. If ``bp = True``, the
            parameter for the respective DNA segment could be merged or
            calculated by ``merge_method``.

        merge_method : str
            Method to calculate the parameter of a DNA segment from local
            parameters of all base-pairs/steps that are between the range given
            through ``bp``.
            Currently accepted keywords are as follows:

                * ``merge_method = mean``: Average of local parameters
                * ``merge_method = sum``: Sum of local parameters

        masked : bool
            ``Default=False``. To skip specific frames/snapshots.
            ``DNA.mask`` array should be set to use this functionality.
            This array contains boolean (either ``True`` or ``False``) value
            for each frame to mask the frames. Presently, mask array is
            automatically generated during :meth:`DNA.generate_smooth_axis` to
            skip those frames where 3D fitting curve was not successful within
            the given criteria.


        Returns
        -------
        values : 1D array
            Array containing parameter values
        density : 1D array
            Array containing density for respective parameter values

        """
        if not (isinstance(bp, list) or isinstance(bp, np.ndarray)):
            raise AssertionError(
                "type %s is not list or np.ndarray" % type(bp))

        if (len(bp) > 1) and (merge == False):
            raise AssertionError(
                "bp %s contains more than two values, whereas merge=False. Use either one value in bp or merge=True" % bp)
            exit(1)

        if len(bp) == 1:
            merge = False

        if (merge == True) and not ((merge_method == 'mean') or (merge_method == 'sum')):
            raise AssertionError(
                "merge method %s is not available." % merge_method)
            exit(1)

        if len(bp) == 1:
            param_value, bp_idx = self.get_parameters(
                parameter, bp, bp_range=False, masked=masked)
        else:
            param_value, bp_idx = self.get_parameters(
                parameter, bp, bp_range=True, masked=masked)

        if (merge == True) and (merge_method == 'mean'):
            param_value = np.mean(param_value, axis=0)

        elif (merge == True) and (merge_method == 'sum'):
            param_value = np.sum(param_value, axis=0)

        else:
            param_value = param_value[0]

        density, bin_edges = np.histogram(param_value, bins=bins, density=True)
        bin_width = bin_edges[1] - bin_edges[0]

        density = np.insert(density, 0, 0.0)
        density = np.append(density, 0.0)

        values = []
        for i in range(len(bin_edges) - 1):
            values.append((bin_edges[i] + bin_edges[i + 1]) / 2)

        values = np.asarray(values)
        values = np.append(values, values[-1] + bin_width)
        values = np.insert(values, 0, values[0] - bin_width)

        return np.array(values), density