我不明白Bisplrep插值模块的警告信息。警告说明:
不能再添加结,因为额外的结会重合 与旧的。可能原因:重量太小或太大 到一个不准确的数据点。 (FP> S) kx,ky = 3,3 nx,ny = 8,10 m = 911 fp = 3096907.966572 s = 0.000000
以下是我的代码中的示例问题:
感谢您的帮助,
安德烈亚斯
import numpy as np
from scipy.interpolate import bisplrep,bisplev
x=np.array([ 4. , 0. , 0.0100021, 0.0199966, 0.0299988,
0.0400009, 0.0500031, 0.0599976, 0.0699997, 0.0800018,
0.0899963, 0.0999985, 0.110001 , 0.120003 , 0.129997 ,
0.139999 , 0.150002 , 0.160004 , 0.169998 , 0.18 ,
0.190002 , 0.199997 , 0.209999 , 0.220001 , 0.230003 ,
0.239998 , 0.25 , 0.260002 , 0.269997 , 0.279999 ,
0.290001 , 0.300003 , 0.309998 , 0.32 , 0.330002 ,
0.339996 , 0.349998 , 0.360001 , 0.370003 , 0.379997 ,
0.389999 , 0.400002 , 0.410004 , 0.419998 , 0.43 ,
0.440002 , 0.449997 , 0.459999 , 0.470001 , 0.480003 ,
0.489998 , 0.5 , 0.510002 , 0.519997 , 0.529999 ,
0.540001 , 0.550003 , 0.559998 , 0.57 , 0.580002 ,
0.589996 , 0.599998 , 0.610001 , 0.620003 , 0.629997 ,
0.639999 , 0.650002 , 0.660004 , 0.669998 , 0.68 ,
0.690002 , 0.699997 , 0.709999 , 0.720001 , 0.730003 ,
0.739998 , 0.75 , 0.760002 , 0.769997 , 0.779999 ,
0.790001 , 0.800003 , 0.809998 , 0.82 , 0.830002 ,
0.839996 , 0.849998 , 0.860001 , 0.870003 , 0.879997 ,
0.889999 , 0.900002 , 0.910004 , 0.919998 , 0.93 ,
0.940002 , 0.949997 , 0.959999 , 0.970001 , 0.980003 ,
0.989998 , 1. , 1.01 , 1.02 , 1.03 ,
1.04 , 1.05 , 1.06 , 1.07 , 1.08 ,
1.09 , 1.1 , 1.11 , 1.12 , 1.13 ,
1.14 , 1.15 , 1.16 , 1.17 , 1.18 ,
1.19 , 1.2 , 1.21 , 1.22 , 1.23 ,
1.24 , 1.25 , 1.26 , 1.27 , 1.28 ,
1.29 , 1.3 , 1.31 , 1.32 , 1.33 ,
1.34 , 1.35 , 1.36 , 1.37 , 1.38 ,
1.39 , 1.4 , 1.41 , 1.42 , 1.43 ,
1.44 , 1.45 , 1.46 , 1.47 , 1.48 ,
1.49 , 1.5 , 1.51 , 1.52 , 1.53 ,
1.54 , 1.55 , 1.56 , 1.57 , 1.58 ,
1.59 , 1.6 , 1.61 , 1.62 , 1.63 ,
1.64 , 1.65 , 1.66 , 1.67 , 1.68 ,
1.69 , 1.7 , 1.71 , 1.72 , 1.73 ,
1.74 , 1.75 , 1.76 , 1.77 , 1.78 ,
1.79 , 1.8 , 1.81 , 1.82 , 1.83 ,
1.84 , 1.85 , 1.86 , 1.87 , 1.88 ,
1.89 , 1.9 , 1.91 , 1.92 , 1.93 ,
1.94 , 1.95 , 1.96 , 1.97 , 1.98 ,
1.99 , 2. , 2.01 , 2.02 , 2.03 ,
2.04 , 2.05 , 2.06 , 2.07 , 2.08 ,
2.09 , 2.1 , 2.11 , 2.12 , 2.13 ,
2.14 , 2.15 , 2.16 , 2.17 , 2.18 ,
2.19 , 2.2 , 2.21 , 2.22 , 2.23 ,
2.24 , 2.25 , 2.26 , 2.27 , 2.28 ,
2.29 , 2.3 , 2.31 , 2.32 , 2.33 ,
2.34 , 2.35 , 2.36 , 2.37 , 2.38 ,
2.39 , 2.4 , 2.41 , 2.42 , 2.43 ,
2.44 , 2.45 , 2.46 , 2.47 , 2.48 ,
2.49 , 2.5 , 2.51 , 2.52 , 2.53 ,
2.54 , 2.55 , 2.56 , 2.57 , 2.58 ,
2.59 , 2.6 , 2.61 , 2.62 , 2.63 ,
2.64 , 2.65 , 2.66 , 2.67 , 2.68 ,
2.69 , 2.7 , 2.71 , 2.72 , 2.73 ,
2.74 , 2.75 , 2.76 , 2.77 , 2.78 ,
2.79 , 2.8 , 2.81 , 2.82 , 2.83 ,
2.84 , 2.85 , 2.86 , 2.87 , 2.88 ,
2.89 , 2.9 , 2.91 , 2.92 , 2.93 ,
2.94 , 2.95 , 2.96 , 2.97 , 2.98 ,
2.99 , 3. , 3.01 , 3.02 , 3.03 ,
3.04 , 3.05 , 3.06 , 3.07 , 3.08 ,
3.09 , 3.1 , 3.11 , 3.12 , 3.13 ,
3.14 , 3.15 , 3.16 , 3.17 , 3.18 ,
3.19 , 3.2 , 3.21 , 3.22 , 3.23 ,
3.24 , 3.25 , 3.26 , 3.27 , 3.28 ,
3.29 , 3.3 , 3.31 , 3.32 , 3.33 ,
3.34 , 3.35 , 3.36 , 3.37 , 3.38 ,
3.39 , 3.4 , 3.41 , 3.42 , 3.43 ,
3.44 , 3.45 , 3.46 , 3.47 , 3.48 ,
3.49 , 3.5 , 3.51 , 3.52 , 3.53 ,
3.54 , 3.55 , 3.56 , 3.57 , 3.58 ,
3.59 , 3.6 , 3.61 , 3.62 , 3.63 ,
3.64 , 3.65 , 3.66 , 3.67 , 3.68 ,
3.69 , 3.7 , 3.71 , 3.72 , 3.73 ,
3.74 , 3.75 , 3.76 , 3.77 , 3.78 ,
3.79 , 3.8 , 3.81 , 3.82 , 3.83 ,
3.84 , 3.85 , 3.86 , 3.87 , 3.88 ,
3.89 , 3.9 , 3.91 , 3.92 , 3.93 ,
3.94 , 3.95 , 3.96 , 3.97 , 3.98 ,
3.99 , 4. ])
y=np.array([ 14900., 16710., 16710., 16710., 16710., 16710., 16710.,
16710., 16710., 16710., 16710., 16710., 16710., 16710.,
16710., 16710., 16710., 16710., 16710., 16710., 16710.,
16710., 16710., 16710., 16710., 16710., 16710., 16710.,
16710., 16710., 16710., 16710., 16710., 16710., 16710.,
16710., 16710., 16710., 16710., 16710., 16710., 16710.,
16710., 16710., 16710., 16710., 16710., 16710., 16710.,
16710., 16710., 16710., 16710., 16710., 16710., 16710.,
16710., 16710., 16710., 16710., 16710., 16710., 16710.,
16710., 16710., 16710., 16710., 16710., 16710., 16710.,
16710., 16710., 16710., 16710., 16710., 16710., 16710.,
16710., 16710., 16710., 16710., 16710., 16710., 16710.,
16710., 16710., 16710., 16710., 16710., 16710., 16710.,
16710., 16710., 16710., 16710., 16710., 16710., 16710.,
16710., 16710., 16710., 16710., 16710., 16710., 16710.,
16710., 16710., 16710., 16710., 16710., 16710., 16710.,
16710., 16710., 16710., 16710., 16710., 16710., 16710.,
16710., 16710., 16710., 16710., 16710., 16710., 16710.,
16710., 16710., 16710., 16710., 16710., 16710., 16710.,
16710., 16710., 16710., 16710., 16710., 16710., 16710.,
16710., 16710., 16710., 16710., 16710., 16710., 16710.,
16710., 16710., 16710., 16710., 16710., 16710., 16710.,
16710., 16710., 16710., 16710., 16710., 16710., 16710.,
16710., 16710., 16710., 16710., 16710., 16710., 16710.,
16710., 16710., 16710., 16710., 16710., 16710., 16710.,
16710., 16710., 16710., 16710., 16710., 16710., 16710.,
16710., 16710., 16710., 16710., 16710., 16710., 16710.,
16710., 16710., 16710., 16710., 16710., 16710., 16710.,
16710., 16710., 16710., 16710., 16710., 16710., 16710.,
16710., 16710., 16710., 16710., 16710., 16710., 16710.,
16710., 16710., 16710., 16710., 16710., 16710., 16710.,
16710., 16710., 16710., 16710., 16710., 16710., 16710.,
16710., 16710., 16710., 16710., 16710., 16710., 16710.,
16710., 16710., 16710., 16710., 16710., 16710., 16710.,
16710., 16710., 16710., 16710., 16710., 16710., 16710.,
16710., 16710., 16710., 16710., 16710., 16710., 16710.,
16710., 16710., 16710., 16710., 16710., 16710., 16710.,
16710., 16710., 16710., 16710., 16710., 16710., 16710.,
16710., 16710., 16710., 16710., 16710., 16710., 16710.,
16710., 16710., 16710., 16710., 16710., 16710., 16710.,
16710., 16710., 16710., 16710., 16710., 16710., 16710.,
16710., 16710., 16710., 16710., 16710., 16710., 16710.,
16710., 16710., 16710., 16710., 16710., 16710., 16710.,
16710., 16710., 16710., 16710., 16710., 16710., 16710.,
16710., 16710., 16710., 16710., 16710., 16710., 16710.,
16710., 16710., 16710., 16710., 16710., 16710., 16710.,
16710., 16710., 16710., 16710., 16710., 16710., 16710.,
16710., 16710., 16710., 16710., 16710., 16710., 16710.,
16710., 16710., 16710., 16710., 16710., 16710., 16710.,
16710., 16710., 16710., 16710., 16710., 16710., 16710.,
16710., 16710., 16710., 16710., 16710., 16710., 16710.,
16710., 16710., 16710., 16710., 16710., 16710., 16710.,
16710., 16710., 16710., 16710., 16710., 16710., 16710.,
16710., 16710., 16710., 16710., 16710., 16710., 16710.,
16710., 16710., 16710., 16710., 16710., 16710., 16710.,
16710., 16710., 16710., 16710., 16710., 16710., 16710.,
16710., 16710., 16710., 16710., 16710., 16710., 16710.,
16710., 16710., 16710.])
z=np.array([ -1.49380000e+01, 1.33526000e+03, 8.44982000e+02,
6.28443000e+02, 5.24071000e+02, 4.55450000e+02,
4.06332000e+02, 3.69142000e+02, 3.39825000e+02,
3.16075000e+02, 2.96395000e+02, 2.79756000e+02,
2.65453000e+02, 2.52976000e+02, 2.41942000e+02,
2.32055000e+02, 2.23097000e+02, 2.14903000e+02,
2.07344000e+02, 2.00311000e+02, 1.93727000e+02,
1.87533000e+02, 1.81672000e+02, 1.76108000e+02,
1.70808000e+02, 1.65750000e+02, 1.60908000e+02,
1.56265000e+02, 1.51810000e+02, 1.47527000e+02,
1.43405000e+02, 1.39438000e+02, 1.35617000e+02,
1.31933000e+02, 1.28380000e+02, 1.24953000e+02,
1.21645000e+02, 1.18450000e+02, 1.15366000e+02,
1.12387000e+02, 1.09508000e+02, 1.06724000e+02,
1.04033000e+02, 1.01432000e+02, 9.89140000e+01,
9.64774000e+01, 9.41197000e+01, 9.18358000e+01,
8.96233000e+01, 8.74798000e+01, 8.54031000e+01,
8.33888000e+01, 8.14352000e+01, 7.95405000e+01,
7.77009000e+01, 7.59147000e+01, 7.41802000e+01,
7.24957000e+01, 7.08580000e+01, 6.92658000e+01,
6.77180000e+01, 6.62116000e+01, 6.47452000e+01,
6.33180000e+01, 6.19287000e+01, 6.05748000e+01,
5.92551000e+01, 5.79688000e+01, 5.67152000e+01,
5.54919000e+01, 5.42982000e+01, 5.31336000e+01,
5.19961000e+01, 5.08851000e+01, 4.97999000e+01,
4.87398000e+01, 4.77033000e+01, 4.66898000e+01,
4.56990000e+01, 4.47294000e+01, 4.37805000e+01,
4.28519000e+01, 4.19432000e+01, 4.10529000e+01,
4.01810000e+01, 3.93271000e+01, 3.84900000e+01,
3.76693000e+01, 3.68649000e+01, 3.60765000e+01,
3.53029000e+01, 3.45439000e+01, 3.37994000e+01,
3.30690000e+01, 3.23518000e+01, 3.16477000e+01,
3.09567000e+01, 3.02778000e+01, 2.96108000e+01,
2.89557000e+01, 2.83123000e+01, 2.76798000e+01,
2.70581000e+01, 2.64472000e+01, 2.58464000e+01,
2.52556000e+01, 2.46746000e+01, 2.41034000e+01,
2.35414000e+01, 2.29885000e+01, 2.24447000e+01,
2.19093000e+01, 2.13824000e+01, 2.08638000e+01,
2.03536000e+01, 1.98511000e+01, 1.93563000e+01,
1.88691000e+01, 1.83896000e+01, 1.79172000e+01,
1.74518000e+01, 1.69936000e+01, 1.65421000e+01,
1.60972000e+01, 1.56588000e+01, 1.52271000e+01,
1.48015000e+01, 1.43820000e+01, 1.39688000e+01,
1.35613000e+01, 1.31596000e+01, 1.27637000e+01,
1.23735000e+01, 1.19886000e+01, 1.16092000e+01,
1.12352000e+01, 1.08663000e+01, 1.05024000e+01,
1.01435000e+01, 9.78981000e+00, 9.44077000e+00,
9.09643000e+00, 8.75683000e+00, 8.42197000e+00,
8.09150000e+00, 7.76547000e+00, 7.44392000e+00,
7.12657000e+00, 6.81340000e+00, 6.50444000e+00,
6.19968000e+00, 5.89884000e+00, 5.60196000e+00,
5.30910000e+00, 5.01997000e+00, 4.73458000e+00,
4.45296000e+00, 4.17511000e+00, 3.90076000e+00,
3.62998000e+00, 3.36280000e+00, 3.09897000e+00,
2.83849000e+00, 2.58140000e+00, 2.32773000e+00,
2.07720000e+00, 1.82983000e+00, 1.58566000e+00,
1.34471000e+00, 1.10673000e+00, 8.71778000e-01,
6.39888000e-01, 4.10860000e-01, 1.84704000e-01,
-3.85611000e-02, -2.58929000e-01, -4.76591000e-01,
-6.91507000e-01, -9.03643000e-01, -1.11318000e+00,
-1.32011000e+00, -1.52441000e+00, -1.72608000e+00,
-1.92528000e+00, -2.12199000e+00, -2.31615000e+00,
-2.50796000e+00, -2.69741000e+00, -2.88445000e+00,
-3.06908000e+00, -3.25147000e+00, -3.43162000e+00,
-3.60948000e+00, -3.78505000e+00, -3.95849000e+00,
-4.12978000e+00, -4.29886000e+00, -4.46590000e+00,
-4.63087000e+00, -4.79376000e+00, -4.95456000e+00,
-5.11341000e+00, -5.27028000e+00, -5.42514000e+00,
-5.57811000e+00, -5.72920000e+00, -5.87837000e+00,
-6.02564000e+00, -6.17111000e+00, -6.31476000e+00,
-6.45656000e+00, -6.59664000e+00, -6.73499000e+00,
-6.87159000e+00, -7.00641000e+00, -7.13960000e+00,
-7.27115000e+00, -7.40101000e+00, -7.52920000e+00,
-7.65582000e+00, -7.78084000e+00, -7.90426000e+00,
-8.02616000e+00, -8.14653000e+00, -8.26537000e+00,
-8.38267000e+00, -8.49852000e+00, -8.61291000e+00,
-8.72580000e+00, -8.83731000e+00, -8.94741000e+00,
-9.05609000e+00, -9.16336000e+00, -9.26929000e+00,
-9.37387000e+00, -9.47708000e+00, -9.57900000e+00,
-9.67964000e+00, -9.77897000e+00, -9.87698000e+00,
-9.97377000e+00, -1.00693000e+01, -1.01636000e+01,
-1.02567000e+01, -1.03486000e+01, -1.04393000e+01,
-1.05288000e+01, -1.06171000e+01, -1.07043000e+01,
-1.07904000e+01, -1.08753000e+01, -1.09592000e+01,
-1.10419000e+01, -1.11235000e+01, -1.12041000e+01,
-1.12836000e+01, -1.13621000e+01, -1.14395000e+01,
-1.15159000e+01, -1.15913000e+01, -1.16656000e+01,
-1.17390000e+01, -1.18115000e+01, -1.18829000e+01,
-1.19534000e+01, -1.20229000e+01, -1.20915000e+01,
-1.21592000e+01, -1.22260000e+01, -1.22918000e+01,
-1.23568000e+01, -1.24209000e+01, -1.24841000e+01,
-1.25464000e+01, -1.26079000e+01, -1.26686000e+01,
-1.27284000e+01, -1.27874000e+01, -1.28455000e+01,
-1.29029000e+01, -1.29595000e+01, -1.30153000e+01,
-1.30702000e+01, -1.31245000e+01, -1.31779000e+01,
-1.32306000e+01, -1.32826000e+01, -1.33339000e+01,
-1.33844000e+01, -1.34341000e+01, -1.34832000e+01,
-1.35316000e+01, -1.35793000e+01, -1.36262000e+01,
-1.36725000e+01, -1.37182000e+01, -1.37631000e+01,
-1.38075000e+01, -1.38511000e+01, -1.38942000e+01,
-1.39365000e+01, -1.39783000e+01, -1.40194000e+01,
-1.40599000e+01, -1.40999000e+01, -1.41392000e+01,
-1.41779000e+01, -1.42161000e+01, -1.42536000e+01,
-1.42906000e+01, -1.43270000e+01, -1.43629000e+01,
-1.43982000e+01, -1.44330000e+01, -1.44672000e+01,
-1.45009000e+01, -1.45340000e+01, -1.45667000e+01,
-1.45988000e+01, -1.46304000e+01, -1.46615000e+01,
-1.46921000e+01, -1.47222000e+01, -1.47518000e+01,
-1.47810000e+01, -1.48096000e+01, -1.48378000e+01,
-1.48656000e+01, -1.48928000e+01, -1.49196000e+01,
-1.49460000e+01, -1.49719000e+01, -1.49974000e+01,
-1.50224000e+01, -1.50470000e+01, -1.50711000e+01,
-1.50949000e+01, -1.51182000e+01, -1.51411000e+01,
-1.51636000e+01, -1.51857000e+01, -1.52074000e+01,
-1.52287000e+01, -1.52496000e+01, -1.52702000e+01,
-1.52903000e+01, -1.53101000e+01, -1.53294000e+01,
-1.53484000e+01, -1.53671000e+01, -1.53853000e+01,
-1.54032000e+01, -1.54208000e+01, -1.54379000e+01,
-1.54548000e+01, -1.54713000e+01, -1.54874000e+01,
-1.55032000e+01, -1.55186000e+01, -1.55337000e+01,
-1.55484000e+01, -1.55629000e+01, -1.55769000e+01,
-1.55907000e+01, -1.56041000e+01, -1.56172000e+01,
-1.56299000e+01, -1.56423000e+01, -1.56544000e+01,
-1.56662000e+01, -1.56776000e+01, -1.56886000e+01,
-1.56994000e+01, -1.57098000e+01, -1.57198000e+01,
-1.57295000e+01, -1.57388000e+01, -1.57478000e+01,
-1.57563000e+01, -1.57645000e+01, -1.57723000e+01,
-1.57797000e+01, -1.57866000e+01, -1.57930000e+01,
-1.57990000e+01, -1.58045000e+01, -1.58094000e+01,
-1.58137000e+01, -1.58173000e+01, -1.58203000e+01,
-1.58225000e+01, -1.58238000e+01, -1.58243000e+01,
-1.58236000e+01, -1.58218000e+01, -1.58185000e+01,
-1.58135000e+01, -1.58060000e+01, -1.57946000e+01,
-1.57734000e+01, -1.57406000e+01, -1.57455000e+01])
bisplrep(x,y,z,w=None, kx=3,ky=3,s=0,task=0)
答案 0 :(得分:0)
也许使用
from scipy.interpolate import LinearNDInterpolator
xy = np.asarray([(i,j) for i, j in zip(x,y)]) # Attain a list of all pairs of the elements of x and y.
InterpolatedObject = LinearNDInterpolator(xy, z) # This yields an interpolated object of the data-points.
对你有帮助。这给出了一个完全符合数据点的分段线性插值。
然后,您可以通过
调用插值SamplingListx = np.linspace(min(x),max(x),1000)
SamplingListy = np.linspace(min(y),max(y),1000)
SamplingArrayz = np.asarray([[InterpolatedObject(i,j) for j in SamplingListy] for i in SamplingListy])
这将评估细网格点处的插值对象并返回相应的数组。