@staticmethod
def find_parameter(array, rmin, radius):
    """Compute for optimal R for certain atom, given array and rmin.

        To find the proper R value to make sure half points are within atomic
        radius r.

        Parameters
        ----------
        array : np.ndarray(N,)
            one dimention array locates within [-1, 1]
        rmin : float
            Minimum value for transformed array.
        radius : float
            Atomic radius of interest

        Returns
        -------
        float
            The optimal value of scale factor R

        Raises
        ------
        ValueError
            rmin needs to be smaller than atomic radius to compute R
        """
    if rmin > radius:
        raise ValueError(
            f'rmin need to be smaller than radius, rmin: {rmin}, radius: {radius}.'
            )
    size = array.size
    if size % 2:
        mid_value = array[size // 2]
    else:
        mid_value = (array[size // 2 - 1] + array[size // 2]) / 2
    return (radius - rmin) * (1 - mid_value) / (1 + mid_value)
