public static AngleData getInterpolatedAngleData(List<AngleData> dataBase,int n,int index,double target)
    {
        int gpsWeek = dataBase.get(0).getTime().getWN();
        int offset = 0;
        double []towArray = new double[n];
        double []leftAngleArray  = new double[n];
        double []rightAngleArray  = new double[n];

        if( n%2 == 0)
        {
            offset = n/2;
        }
        else
        {
            offset = (n-1)/2;//actually it doesn't make any sense
        }
        int beginIndex = index -offset;
        int endIndex = index + n - offset;
        int size = dataBase.size();
        if (beginIndex>=0 && endIndex <=size) {
            for(int i = 0;i<n;i++)
            {
                towArray[i] = dataBase.get(beginIndex+i).getTime().getTOW();
                leftAngleArray[i]= dataBase.get(beginIndex+i).getLeftAngle();
                rightAngleArray[i]= dataBase.get(beginIndex+i).getRightAngle();  }
        } else {
            if (beginIndex < 0) {
                for (int i = 0; i < n; i++) {   //处理target历元前面没有数据的情况
                    towArray[i] = dataBase.get(i).getTime().getTOW();
                    leftAngleArray[i]= dataBase.get(i).getLeftAngle();
                    rightAngleArray[i]= dataBase.get(i).getRightAngle();  }
                }
                if (beginIndex > size) {
                    for (int i = 0; i < n; i++) {   //处理target历元后面没有数据的情况
                        towArray[i] = dataBase.get(size - n + i).getTime().getTOW();
                        leftAngleArray[i]= dataBase.get(size - n + i).getLeftAngle();
                        rightAngleArray[i]= dataBase.get(size - n + i).getRightAngle();
                    }
                }
            }


        double tmpLeftAngle = Interpolation.LagrangeInterpolation(towArray,leftAngleArray, target);
        double tmpRightAngle = Interpolation.LagrangeInterpolation(towArray,rightAngleArray,target);

        return new AngleData(new Time.GPST(gpsWeek,target),tmpLeftAngle,tmpRightAngle);
    }