public static GNSSData getInterpolatedGNSSData(List<GNSSData> dataBase,int n,int index,double target)
    {
        int gpsWeek = dataBase.get(0).getGpst().getWN();
        int offset = 0;
        double []towArray  = new double[n];
        double []latArray  = new double[n];
        double []lonArray = new double [n];
        double []heightArray = 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).getGpst().getTOW();
                latArray[i]= dataBase.get(beginIndex+i).getGeodeticCoordinate().getB();
                lonArray[i]= dataBase.get(beginIndex+i).getGeodeticCoordinate().getL();
                heightArray[i]= dataBase.get(beginIndex+i).getGeodeticCoordinate().getH();
            }
        } else {
            if (beginIndex < 0) {
                for (int i = 0; i < n; i++) {   //处理target历元前面没有数据的情况
                    towArray[i] = dataBase.get(i).getGpst().getTOW();
                    latArray[i] = dataBase.get(i).getGeodeticCoordinate().getB();
                    lonArray[i] = dataBase.get(i).getGeodeticCoordinate().getL();
                    heightArray[i] = dataBase.get(i).getGeodeticCoordinate().getH();
                }
                if (beginIndex > size) {
                    for (int i = 0; i < n; i++) {   //处理target历元前面没有数据的情况
                        towArray[i] = dataBase.get(size - n + i).getGpst().getTOW();
                        latArray[i] = dataBase.get(size - n + i).getGeodeticCoordinate().getB();
                        lonArray[i] = dataBase.get(size - n + i).getGeodeticCoordinate().getL();
                        heightArray[i] = dataBase.get(size - n + i).getGeodeticCoordinate().getH();
                    }
                }
            }

        }
        double tmpLat = Interpolation.LagrangeInterpolation(towArray, latArray, target);
        double tmpLon = Interpolation.LagrangeInterpolation(towArray,lonArray,target);
        double tmpHeight = Interpolation.LagrangeInterpolation(towArray,heightArray,target);
        return new GNSSData(new Time.GPST(gpsWeek,target),
                new Coordinate.GeodeticCoordinate(tmpLat,tmpLon,tmpHeight),
                "Interpolated",42);
    }