- android - 多次调用 OnPrimaryClipChangedListener
- android - 无法更新 RecyclerView 中的 TextView 字段
- android.database.CursorIndexOutOfBoundsException : Index 0 requested, 光标大小为 0
- android - 使用 AppCompat 时,我们是否需要明确指定其 UI 组件(Spinner、EditText)颜色
当我遇到一个奇怪的、看起来像浮点精度错误时,我正在使用 mlab.griddata 插入一些数据。这是调用顺序:
nvals = matplotlib.mlab.griddata(lon_old.ravel(),
lat_old.ravel(),
ivals.ravel(),
lon_new,
lat_new,interp='linear').T
lat_old = array([ 19.62606908, 18.50457985, 17.38309053, 16.26160115,
15.14011169, 14.01862218, 12.8971326 , 11.77564298,
10.65415331, 9.53266359, 8.41117384, 7.28968406,
6.16819425, 5.04670442, 3.92521457, 2.8037247 ,
1.68223483, 0.56074494, -0.56074494, -1.68223483,
-2.8037247 , 19.62606908, 18.50457985, 17.38309053,
16.26160115, 15.14011169, 14.01862218, 12.8971326 ,
11.77564298, 10.65415331, 9.53266359, 8.41117384,
7.28968406, 6.16819425, 5.04670442, 3.92521457,
2.8037247 , 1.68223483, 0.56074494, -0.56074494,
-1.68223483, -2.8037247 , 19.62606908, 18.50457985,
17.38309053, 16.26160115, 15.14011169, 14.01862218,
12.8971326 , 11.77564298, 10.65415331, 9.53266359,
8.41117384, 7.28968406, 6.16819425, 5.04670442,
3.92521457, 2.8037247 , 1.68223483, 0.56074494,
-0.56074494, -1.68223483, -2.8037247 , 19.62606908,
18.50457985, 17.38309053, 16.26160115, 15.14011169,
14.01862218, 12.8971326 , 11.77564298, 10.65415331,
9.53266359, 8.41117384, 7.28968406, 6.16819425,
5.04670442, 3.92521457, 2.8037247 , 1.68223483,
0.56074494, -0.56074494, -1.68223483, -2.8037247 ,
19.62606908, 18.50457985, 17.38309053, 16.26160115,
15.14011169, 14.01862218, 12.8971326 , 11.77564298,
10.65415331, 9.53266359, 8.41117384, 7.28968406,
6.16819425, 5.04670442, 3.92521457, 2.8037247 ,
1.68223483, 0.56074494, -0.56074494, -1.68223483,
-2.8037247 , 19.62606908, 18.50457985, 17.38309053,
16.26160115, 15.14011169, 14.01862218, 12.8971326 ,
11.77564298, 10.65415331, 9.53266359, 8.41117384,
7.28968406, 6.16819425, 5.04670442, 3.92521457,
2.8037247 , 1.68223483, 0.56074494, -0.56074494,
-1.68223483, -2.8037247 , 19.62606908, 18.50457985,
17.38309053, 16.26160115, 15.14011169, 14.01862218,
12.8971326 , 11.77564298, 10.65415331, 9.53266359,
8.41117384, 7.28968406, 6.16819425, 5.04670442,
3.92521457, 2.8037247 , 1.68223483, 0.56074494,
-0.56074494, -1.68223483, -2.8037247 , 19.62606908,
18.50457985, 17.38309053, 16.26160115, 15.14011169,
14.01862218, 12.8971326 , 11.77564298, 10.65415331,
9.53266359, 8.41117384, 7.28968406, 6.16819425,
5.04670442, 3.92521457, 2.8037247 , 1.68223483,
0.56074494, -0.56074494, -1.68223483, -2.8037247 ,
19.62606908, 18.50457985, 17.38309053, 16.26160115,
15.14011169, 14.01862218, 12.8971326 , 11.77564298,
10.65415331, 9.53266359, 8.41117384, 7.28968406,
6.16819425, 5.04670442, 3.92521457, 2.8037247 ,
1.68223483, 0.56074494, -0.56074494, -1.68223483,
-2.8037247 , 19.62606908, 18.50457985, 17.38309053,
16.26160115, 15.14011169, 14.01862218, 12.8971326 ,
11.77564298, 10.65415331, 9.53266359, 8.41117384,
7.28968406, 6.16819425, 5.04670442, 3.92521457,
2.8037247 , 1.68223483, 0.56074494, -0.56074494,
-1.68223483, -2.8037247 , 19.62606908, 18.50457985,
17.38309053, 16.26160115, 15.14011169, 14.01862218,
12.8971326 , 11.77564298, 10.65415331, 9.53266359,
8.41117384, 7.28968406, 6.16819425, 5.04670442,
3.92521457, 2.8037247 , 1.68223483, 0.56074494,
-0.56074494, -1.68223483, -2.8037247 , 19.62606908,
18.50457985, 17.38309053, 16.26160115, 15.14011169,
14.01862218, 12.8971326 , 11.77564298, 10.65415331,
9.53266359, 8.41117384, 7.28968406, 6.16819425,
5.04670442, 3.92521457, 2.8037247 , 1.68223483,
0.56074494, -0.56074494, -1.68223483, -2.8037247 ,
19.62606908, 18.50457985, 17.38309053, 16.26160115,
15.14011169, 14.01862218, 12.8971326 , 11.77564298,
10.65415331, 9.53266359, 8.41117384, 7.28968406,
6.16819425, 5.04670442, 3.92521457, 2.8037247 ,
1.68223483, 0.56074494, -0.56074494, -1.68223483,
-2.8037247 , 19.62606908, 18.50457985, 17.38309053,
16.26160115, 15.14011169, 14.01862218, 12.8971326 ,
11.77564298, 10.65415331, 9.53266359, 8.41117384,
7.28968406, 6.16819425, 5.04670442, 3.92521457,
2.8037247 , 1.68223483, 0.56074494, -0.56074494,
-1.68223483, -2.8037247 , 19.62606908, 18.50457985,
17.38309053, 16.26160115, 15.14011169, 14.01862218,
12.8971326 , 11.77564298, 10.65415331, 9.53266359,
8.41117384, 7.28968406, 6.16819425, 5.04670442,
3.92521457, 2.8037247 , 1.68223483, 0.56074494,
-0.56074494, -1.68223483, -2.8037247 , 19.62606908,
18.50457985, 17.38309053, 16.26160115, 15.14011169,
14.01862218, 12.8971326 , 11.77564298, 10.65415331,
9.53266359, 8.41117384, 7.28968406, 6.16819425,
5.04670442, 3.92521457, 2.8037247 , 1.68223483,
0.56074494, -0.56074494, -1.68223483, -2.8037247 ,
19.62606908, 18.50457985, 17.38309053, 16.26160115,
15.14011169, 14.01862218, 12.8971326 , 11.77564298,
10.65415331, 9.53266359, 8.41117384, 7.28968406,
6.16819425, 5.04670442, 3.92521457, 2.8037247 ,
1.68223483, 0.56074494, -0.56074494, -1.68223483,
-2.8037247 , 19.62606908, 18.50457985, 17.38309053,
16.26160115, 15.14011169, 14.01862218, 12.8971326 ,
11.77564298, 10.65415331, 9.53266359, 8.41117384,
7.28968406, 6.16819425, 5.04670442, 3.92521457,
2.8037247 , 1.68223483, 0.56074494, -0.56074494,
-1.68223483, -2.8037247 , 19.62606908, 18.50457985,
17.38309053, 16.26160115, 15.14011169, 14.01862218,
12.8971326 , 11.77564298, 10.65415331, 9.53266359,
8.41117384, 7.28968406, 6.16819425, 5.04670442,
3.92521457, 2.8037247 , 1.68223483, 0.56074494,
-0.56074494, -1.68223483, -2.8037247 , 19.62606908,
18.50457985, 17.38309053, 16.26160115, 15.14011169,
14.01862218, 12.8971326 , 11.77564298, 10.65415331,
9.53266359, 8.41117384, 7.28968406, 6.16819425,
5.04670442, 3.92521457, 2.8037247 , 1.68223483,
0.56074494, -0.56074494, -1.68223483, -2.8037247 ,
19.62606908, 18.50457985, 17.38309053, 16.26160115,
15.14011169, 14.01862218, 12.8971326 , 11.77564298,
10.65415331, 9.53266359, 8.41117384, 7.28968406,
6.16819425, 5.04670442, 3.92521457, 2.8037247 ,
1.68223483, 0.56074494, -0.56074494, -1.68223483, -2.8037247 ])
lon_old = array([ 228.375, 228.375, 228.375, 228.375, 228.375, 228.375,
228.375, 228.375, 228.375, 228.375, 228.375, 228.375,
228.375, 228.375, 228.375, 228.375, 228.375, 228.375,
228.375, 228.375, 228.375, 229.5 , 229.5 , 229.5 ,
229.5 , 229.5 , 229.5 , 229.5 , 229.5 , 229.5 ,
229.5 , 229.5 , 229.5 , 229.5 , 229.5 , 229.5 ,
229.5 , 229.5 , 229.5 , 229.5 , 229.5 , 229.5 ,
230.625, 230.625, 230.625, 230.625, 230.625, 230.625,
230.625, 230.625, 230.625, 230.625, 230.625, 230.625,
230.625, 230.625, 230.625, 230.625, 230.625, 230.625,
230.625, 230.625, 230.625, 231.75 , 231.75 , 231.75 ,
231.75 , 231.75 , 231.75 , 231.75 , 231.75 , 231.75 ,
231.75 , 231.75 , 231.75 , 231.75 , 231.75 , 231.75 ,
231.75 , 231.75 , 231.75 , 231.75 , 231.75 , 231.75 ,
232.875, 232.875, 232.875, 232.875, 232.875, 232.875,
232.875, 232.875, 232.875, 232.875, 232.875, 232.875,
232.875, 232.875, 232.875, 232.875, 232.875, 232.875,
232.875, 232.875, 232.875, 234. , 234. , 234. ,
234. , 234. , 234. , 234. , 234. , 234. ,
234. , 234. , 234. , 234. , 234. , 234. ,
234. , 234. , 234. , 234. , 234. , 234. ,
235.125, 235.125, 235.125, 235.125, 235.125, 235.125,
235.125, 235.125, 235.125, 235.125, 235.125, 235.125,
235.125, 235.125, 235.125, 235.125, 235.125, 235.125,
235.125, 235.125, 235.125, 236.25 , 236.25 , 236.25 ,
236.25 , 236.25 , 236.25 , 236.25 , 236.25 , 236.25 ,
236.25 , 236.25 , 236.25 , 236.25 , 236.25 , 236.25 ,
236.25 , 236.25 , 236.25 , 236.25 , 236.25 , 236.25 ,
237.375, 237.375, 237.375, 237.375, 237.375, 237.375,
237.375, 237.375, 237.375, 237.375, 237.375, 237.375,
237.375, 237.375, 237.375, 237.375, 237.375, 237.375,
237.375, 237.375, 237.375, 238.5 , 238.5 , 238.5 ,
238.5 , 238.5 , 238.5 , 238.5 , 238.5 , 238.5 ,
238.5 , 238.5 , 238.5 , 238.5 , 238.5 , 238.5 ,
238.5 , 238.5 , 238.5 , 238.5 , 238.5 , 238.5 ,
239.625, 239.625, 239.625, 239.625, 239.625, 239.625,
239.625, 239.625, 239.625, 239.625, 239.625, 239.625,
239.625, 239.625, 239.625, 239.625, 239.625, 239.625,
239.625, 239.625, 239.625, 240.75 , 240.75 , 240.75 ,
240.75 , 240.75 , 240.75 , 240.75 , 240.75 , 240.75 ,
240.75 , 240.75 , 240.75 , 240.75 , 240.75 , 240.75 ,
240.75 , 240.75 , 240.75 , 240.75 , 240.75 , 240.75 ,
241.875, 241.875, 241.875, 241.875, 241.875, 241.875,
241.875, 241.875, 241.875, 241.875, 241.875, 241.875,
241.875, 241.875, 241.875, 241.875, 241.875, 241.875,
241.875, 241.875, 241.875, 243. , 243. , 243. ,
243. , 243. , 243. , 243. , 243. , 243. ,
243. , 243. , 243. , 243. , 243. , 243. ,
243. , 243. , 243. , 243. , 243. , 243. ,
244.125, 244.125, 244.125, 244.125, 244.125, 244.125,
244.125, 244.125, 244.125, 244.125, 244.125, 244.125,
244.125, 244.125, 244.125, 244.125, 244.125, 244.125,
244.125, 244.125, 244.125, 245.25 , 245.25 , 245.25 ,
245.25 , 245.25 , 245.25 , 245.25 , 245.25 , 245.25 ,
245.25 , 245.25 , 245.25 , 245.25 , 245.25 , 245.25 ,
245.25 , 245.25 , 245.25 , 245.25 , 245.25 , 245.25 ,
246.375, 246.375, 246.375, 246.375, 246.375, 246.375,
246.375, 246.375, 246.375, 246.375, 246.375, 246.375,
246.375, 246.375, 246.375, 246.375, 246.375, 246.375,
246.375, 246.375, 246.375, 247.5 , 247.5 , 247.5 ,
247.5 , 247.5 , 247.5 , 247.5 , 247.5 , 247.5 ,
247.5 , 247.5 , 247.5 , 247.5 , 247.5 , 247.5 ,
247.5 , 247.5 , 247.5 , 247.5 , 247.5 , 247.5 ,
248.625, 248.625, 248.625, 248.625, 248.625, 248.625,
248.625, 248.625, 248.625, 248.625, 248.625, 248.625,
248.625, 248.625, 248.625, 248.625, 248.625, 248.625,
248.625, 248.625, 248.625, 249.75 , 249.75 , 249.75 ,
249.75 , 249.75 , 249.75 , 249.75 , 249.75 , 249.75 ,
249.75 , 249.75 , 249.75 , 249.75 , 249.75 , 249.75 ,
249.75 , 249.75 , 249.75 , 249.75 , 249.75 , 249.75 ,
250.875, 250.875, 250.875, 250.875, 250.875, 250.875,
250.875, 250.875, 250.875, 250.875, 250.875, 250.875,
250.875, 250.875, 250.875, 250.875, 250.875, 250.875,
250.875, 250.875, 250.875])
lon_new = array([ 229.078125, 229.78125 , 230.484375, 231.1875 , 231.890625,
232.59375 , 233.296875, 234. , 234.703125, 235.40625 ,
236.109375, 236.8125 , 237.515625, 238.21875 , 238.921875,
239.625 , 240.328125, 241.03125 , 241.734375, 242.4375 ,
243.140625, 243.84375 , 244.546875, 245.25 , 245.953125,
246.65625 , 247.359375, 248.0625 , 248.765625, 249.46875 ,
250.171875])
lat_new = array([ 18.95804884, 18.25492384, 17.55179884, 16.84867384,
16.14554884, 15.44242384, 14.73929884, 14.03617384,
13.33304884, 12.62992384, 11.92679884, 11.22367384,
10.52054884, 9.81742384, 9.11429884, 8.41117384,
7.70804884, 7.00492384, 6.30179884, 5.59867384,
4.89554884, 4.19242384, 3.48929884, 2.78617384,
2.08304884, 1.37992384, 0.67679884, -0.02632616,
-0.72945116, -1.43257616, -2.13570116])
dlon_new = dx = array([-0.7, -0.7, -0.7, -0.7, -0.7, -0.7, -0.7, -0.7, -0.7, -0.7, -0.7,
-0.7, -0.7, -0.7, -0.7, -0.7, -0.7, -0.7, -0.7, -0.7, -0.7, -0.7,
-0.7, -0.7, -0.7, -0.7, -0.7, -0.7, -0.7, -0.7])
dlat_new = dy = array([ 0.7, 0.7, 0.7, 0.7, 0.7, 0.7, 0.7, 0.7, 0.7, 0.7, 0.7,
0.7, 0.7, 0.7, 0.7, 0.7, 0.7, 0.7, 0.7, 0.7, 0.7, 0.7,
0.7, 0.7, 0.7, 0.7, 0.7, 0.7, 0.7, 0.7])
epsy = 1.0000000000000001e-15
epsx = 1.0000000000000001e-15
ivals = array([[ 1.51914963e-03, 4.84249834e-03, 1.24178734e-02,
1.78842712e-02, 2.73387861e-02, 3.49708572e-02,
3.76453847e-02, 3.83761562e-02, 3.42653096e-02,
2.37101801e-02, 1.05387643e-02, 6.25021639e-04,
0.00000000e+00, 0.00000000e+00, 0.00000000e+00,
0.00000000e+00, 0.00000000e+00, 0.00000000e+00,
0.00000000e+00, 0.00000000e+00, 0.00000000e+00],
[ 2.35232967e-03, 6.95531536e-03, 1.20530156e-02,
1.50254052e-02, 2.06609517e-02, 2.70908102e-02,
2.68270355e-02, 1.82730909e-02, 1.43693918e-02,
1.78140309e-02, 1.54578537e-02, 4.77255462e-03,
0.00000000e+00, 0.00000000e+00, 0.00000000e+00,
0.00000000e+00, 0.00000000e+00, 0.00000000e+00,
0.00000000e+00, 0.00000000e+00, 0.00000000e+00],
[ 5.49260434e-03, 1.21264756e-02, 1.16909835e-02,
1.09791821e-02, 1.34972855e-02, 1.25683891e-02,
7.35369883e-03, 5.41831227e-03, 4.72079264e-05,
6.89811632e-03, 7.71775097e-03, 2.97224917e-03,
0.00000000e+00, 0.00000000e+00, 0.00000000e+00,
0.00000000e+00, 0.00000000e+00, 0.00000000e+00,
0.00000000e+00, 0.00000000e+00, 0.00000000e+00],
[ 1.13926865e-02, 1.21114589e-02, 8.51153489e-03,
5.64892637e-03, 4.42338269e-03, 2.71651126e-03,
6.50693983e-05, 1.18285546e-03, 1.15790730e-03,
1.27750791e-05, 1.16404856e-03, 3.87609383e-04,
0.00000000e+00, 0.00000000e+00, 0.00000000e+00,
0.00000000e+00, 0.00000000e+00, 0.00000000e+00,
0.00000000e+00, 0.00000000e+00, 0.00000000e+00],
[ 9.99477133e-03, 7.84504320e-03, 4.12580743e-03,
1.95651152e-03, 6.27938076e-04, 3.64340417e-06,
0.00000000e+00, 5.80144624e-05, 9.30973620e-05,
6.09520539e-05, 3.19228930e-05, 2.95944778e-06,
0.00000000e+00, 0.00000000e+00, 0.00000000e+00,
0.00000000e+00, 0.00000000e+00, 0.00000000e+00,
0.00000000e+00, 0.00000000e+00, 0.00000000e+00],
[ 5.62612992e-03, 3.11897229e-03, 1.35576469e-03,
2.72712990e-04, 2.18278728e-08, 2.77736224e-04,
2.15023640e-04, 2.99098410e-05, 0.00000000e+00,
0.00000000e+00, 0.00000000e+00, 0.00000000e+00,
0.00000000e+00, 0.00000000e+00, 0.00000000e+00,
0.00000000e+00, 0.00000000e+00, 0.00000000e+00,
5.45696821e-09, 6.18456397e-08, 1.00044417e-07],
[ 1.80969934e-03, 7.60903757e-04, 3.29161890e-06,
5.94062985e-05, 9.03553300e-05, 1.88442812e-06,
0.00000000e+00, 0.00000000e+00, 0.00000000e+00,
0.00000000e+00, 0.00000000e+00, 0.00000000e+00,
0.00000000e+00, 0.00000000e+00, 0.00000000e+00,
0.00000000e+00, 0.00000000e+00, 8.96955896e-07,
5.46621823e-06, 6.86217982e-06, 9.91616434e-06],
[ 5.55361272e-04, 0.00000000e+00, 0.00000000e+00,
0.00000000e+00, 0.00000000e+00, 0.00000000e+00,
0.00000000e+00, 0.00000000e+00, 0.00000000e+00,
0.00000000e+00, 0.00000000e+00, 7.27595761e-09,
1.27329258e-08, 8.64968388e-06, 3.59374013e-07,
9.28682766e-06, 9.36674860e-06, 5.86172609e-06,
3.51247800e-05, 1.05878571e-04, 2.21810909e-03],
[ 4.81493998e-07, 0.00000000e+00, 0.00000000e+00,
0.00000000e+00, 0.00000000e+00, 0.00000000e+00,
0.00000000e+00, 0.00000000e+00, 3.76954704e-05,
3.13774217e-06, 4.10084112e-06, 1.22585889e-05,
1.23064645e-04, 3.22126038e-02, 4.12977114e-03,
4.40907385e-03, 8.58011283e-03, 1.13403024e-02,
1.39989899e-02, 1.55630931e-02, 1.62743106e-02],
[ 3.06865149e-06, 1.18992730e-05, 2.90403641e-05,
0.00000000e+00, 0.00000000e+00, 0.00000000e+00,
0.00000000e+00, 0.00000000e+00, 3.26428679e-04,
5.05644502e-03, 7.92237557e-03, 8.84909835e-03,
9.39421635e-03, 4.13218886e-02, 5.75748496e-02,
1.31889293e-02, 1.34845898e-01, 1.13798976e-01,
1.20008864e-01, 1.56037509e-01, 1.93280712e-01],
[ 5.33699116e-04, 1.72329973e-03, 3.17315105e-03,
1.14819378e-01, 4.43908386e-02, 0.00000000e+00,
0.00000000e+00, 5.74506557e-05, 5.10447251e-04,
1.71848107e-03, 5.27862227e-03, 1.52162453e-02,
8.03043172e-02, 7.01455697e-02, 1.05249695e-01,
1.42122656e-01, 2.22821265e-01, 2.02459455e-01,
2.06677437e-01, 2.46986017e-01, 2.63066918e-01],
[ 7.62831494e-02, 1.11132614e-01, 1.37192637e-01,
1.43570632e-01, 1.15425527e-01, 0.00000000e+00,
2.89876079e-05, 3.49933194e-04, 9.58649849e-04,
2.01611011e-03, 4.83151386e-03, 1.83595419e-02,
1.03671178e-01, 9.63126644e-02, 5.50910681e-02,
1.36725232e-01, 1.64533973e-01, 7.98287913e-02,
1.73291177e-01, 1.81056723e-01, 2.02676117e-01],
[ 1.07610516e-01, 1.21951140e-01, 1.01695523e-01,
4.15301125e-04, 0.00000000e+00, 0.00000000e+00,
2.18786477e-06, 3.11349390e-06, 1.33068315e-04,
3.67084111e-04, 1.08024117e-03, 3.34545830e-03,
8.69611651e-03, 1.37638608e-02, 2.27879807e-02,
4.41205539e-02, 5.16842529e-02, 3.70345488e-02,
5.38833812e-02, 6.32722452e-02, 1.56152964e-01],
[ 1.10440794e-02, 3.89250601e-03, 2.37991480e-05,
0.00000000e+00, 0.00000000e+00, 0.00000000e+00,
0.00000000e+00, 0.00000000e+00, 0.00000000e+00,
1.04574056e-07, 8.74274861e-07, 2.26301170e-04,
8.31953774e-04, 1.92522176e-03, 4.67427028e-03,
1.10447202e-02, 1.51307033e-02, 1.29928729e-02,
2.08757464e-02, 2.11046692e-02, 3.58685926e-02],
[ 1.40534030e-04, 6.79020388e-07, 0.00000000e+00,
0.00000000e+00, 0.00000000e+00, 0.00000000e+00,
0.00000000e+00, 0.00000000e+00, 0.00000000e+00,
0.00000000e+00, 0.00000000e+00, 0.00000000e+00,
0.00000000e+00, 6.55058902e-05, 2.59673747e-04,
7.57753383e-04, 1.35594222e-03, 1.73954351e-03,
4.76868916e-03, 5.21047926e-03, 9.71581228e-03],
[ 0.00000000e+00, 0.00000000e+00, 0.00000000e+00,
0.00000000e+00, 0.00000000e+00, 0.00000000e+00,
0.00000000e+00, 0.00000000e+00, 0.00000000e+00,
0.00000000e+00, 0.00000000e+00, 0.00000000e+00,
0.00000000e+00, 0.00000000e+00, 0.00000000e+00,
0.00000000e+00, 3.23413442e-05, 3.17198865e-05,
3.07607057e-04, 2.70675024e-04, 1.48168497e-03],
[ 0.00000000e+00, 0.00000000e+00, 0.00000000e+00,
0.00000000e+00, 0.00000000e+00, 0.00000000e+00,
0.00000000e+00, 0.00000000e+00, 0.00000000e+00,
0.00000000e+00, 0.00000000e+00, 0.00000000e+00,
0.00000000e+00, 0.00000000e+00, 0.00000000e+00,
0.00000000e+00, 0.00000000e+00, 0.00000000e+00,
0.00000000e+00, 0.00000000e+00, 6.51265509e-05],
[ 0.00000000e+00, 0.00000000e+00, 0.00000000e+00,
0.00000000e+00, 0.00000000e+00, 0.00000000e+00,
0.00000000e+00, 0.00000000e+00, 0.00000000e+00,
0.00000000e+00, 0.00000000e+00, 0.00000000e+00,
0.00000000e+00, 0.00000000e+00, 0.00000000e+00,
0.00000000e+00, 0.00000000e+00, 0.00000000e+00,
0.00000000e+00, 0.00000000e+00, 0.00000000e+00],
[ 0.00000000e+00, 0.00000000e+00, 0.00000000e+00,
0.00000000e+00, 0.00000000e+00, 0.00000000e+00,
0.00000000e+00, 0.00000000e+00, 0.00000000e+00,
0.00000000e+00, 0.00000000e+00, 0.00000000e+00,
0.00000000e+00, 0.00000000e+00, 0.00000000e+00,
0.00000000e+00, 0.00000000e+00, 0.00000000e+00,
0.00000000e+00, 0.00000000e+00, 0.00000000e+00],
[ 0.00000000e+00, 0.00000000e+00, 0.00000000e+00,
0.00000000e+00, 0.00000000e+00, 0.00000000e+00,
0.00000000e+00, 0.00000000e+00, 0.00000000e+00,
0.00000000e+00, 0.00000000e+00, 0.00000000e+00,
0.00000000e+00, 0.00000000e+00, 0.00000000e+00,
0.00000000e+00, 0.00000000e+00, 0.00000000e+00,
0.00000000e+00, 0.00000000e+00, 0.00000000e+00],
[ 0.00000000e+00, 0.00000000e+00, 0.00000000e+00,
0.00000000e+00, 0.00000000e+00, 0.00000000e+00,
0.00000000e+00, 0.00000000e+00, 0.00000000e+00,
0.00000000e+00, 0.00000000e+00, 0.00000000e+00,
0.00000000e+00, 0.00000000e+00, 0.00000000e+00,
0.00000000e+00, 0.00000000e+00, 0.00000000e+00,
0.00000000e+00, 0.00000000e+00, 0.00000000e+00]], dtype=float32)
这是标记错误的 mlab 代码部分:
dx.max()-dx.min() = 1.7763568394002505e-15
dy.max()-dy.min() = 0.0
epsy = np.finfo(yi.dtype).resolution
if dx.max()-dx.min() > epsx or dy.max()-dy.min() > epsy:
raise ValueError("output grid must have constant spacing"
" when using interp='linear'")
我很想知道如何解决这个问题。我不拥有此 python 安装,因此无法修改 if 语句。有时这行得通,有时行不通,这似乎取决于数据输入,但在这种情况下,当它确实中断时,dy 和 dy 都是一样的。这是 mlab 中的错误吗?如果我改为“nn”而不是线性,问题就会消失,但我需要“线性”插值。
谢谢,/Shejo284
最佳答案
我在 mlab 上运气不好。改用 scipy.interpolate.griddata 。它似乎有效并且结果看起来不错。
nvals = scipy.interpolate.griddata((lon_old.ravel(),
lat_old.ravel()),
tmp.ravel(),
(lon_new,lat_new),
method='linear')
感谢您的贡献。
关于python - mlab.griddata 错误?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12338649/
我正在处理一组标记为 160 个组的 173k 点。我想通过合并最接近的(到 9 或 10 个组)来减少组/集群的数量。我搜索过 sklearn 或类似的库,但没有成功。 我猜它只是通过 knn 聚类
我有一个扁平数字列表,这些数字逻辑上以 3 为一组,其中每个三元组是 (number, __ignored, flag[0 or 1]),例如: [7,56,1, 8,0,0, 2,0,0, 6,1,
我正在使用 pipenv 来管理我的包。我想编写一个 python 脚本来调用另一个使用不同虚拟环境(VE)的 python 脚本。 如何运行使用 VE1 的 python 脚本 1 并调用另一个 p
假设我有一个文件 script.py 位于 path = "foo/bar/script.py"。我正在寻找一种在 Python 中通过函数 execute_script() 从我的主要 Python
这听起来像是谜语或笑话,但实际上我还没有找到这个问题的答案。 问题到底是什么? 我想运行 2 个脚本。在第一个脚本中,我调用另一个脚本,但我希望它们继续并行,而不是在两个单独的线程中。主要是我不希望第
我有一个带有 python 2.5.5 的软件。我想发送一个命令,该命令将在 python 2.7.5 中启动一个脚本,然后继续执行该脚本。 我试过用 #!python2.7.5 和http://re
我在 python 命令行(使用 python 2.7)中,并尝试运行 Python 脚本。我的操作系统是 Windows 7。我已将我的目录设置为包含我所有脚本的文件夹,使用: os.chdir("
剧透:部分解决(见最后)。 以下是使用 Python 嵌入的代码示例: #include int main(int argc, char** argv) { Py_SetPythonHome
假设我有以下列表,对应于及时的股票价格: prices = [1, 3, 7, 10, 9, 8, 5, 3, 6, 8, 12, 9, 6, 10, 13, 8, 4, 11] 我想确定以下总体上最
所以我试图在选择某个单选按钮时更改此框架的背景。 我的框架位于一个类中,并且单选按钮的功能位于该类之外。 (这样我就可以在所有其他框架上调用它们。) 问题是每当我选择单选按钮时都会出现以下错误: co
我正在尝试将字符串与 python 中的正则表达式进行比较,如下所示, #!/usr/bin/env python3 import re str1 = "Expecting property name
考虑以下原型(prototype) Boost.Python 模块,该模块从单独的 C++ 头文件中引入类“D”。 /* file: a/b.cpp */ BOOST_PYTHON_MODULE(c)
如何编写一个程序来“识别函数调用的行号?” python 检查模块提供了定位行号的选项,但是, def di(): return inspect.currentframe().f_back.f_l
我已经使用 macports 安装了 Python 2.7,并且由于我的 $PATH 变量,这就是我输入 $ python 时得到的变量。然而,virtualenv 默认使用 Python 2.6,除
我只想问如何加快 python 上的 re.search 速度。 我有一个很长的字符串行,长度为 176861(即带有一些符号的字母数字字符),我使用此函数测试了该行以进行研究: def getExe
list1= [u'%app%%General%%Council%', u'%people%', u'%people%%Regional%%Council%%Mandate%', u'%ppp%%Ge
这个问题在这里已经有了答案: Is it Pythonic to use list comprehensions for just side effects? (7 个答案) 关闭 4 个月前。 告
我想用 Python 将两个列表组合成一个列表,方法如下: a = [1,1,1,2,2,2,3,3,3,3] b= ["Sun", "is", "bright", "June","and" ,"Ju
我正在运行带有最新 Boost 发行版 (1.55.0) 的 Mac OS X 10.8.4 (Darwin 12.4.0)。我正在按照说明 here构建包含在我的发行版中的教程 Boost-Pyth
学习 Python,我正在尝试制作一个没有任何第 3 方库的网络抓取工具,这样过程对我来说并没有简化,而且我知道我在做什么。我浏览了一些在线资源,但所有这些都让我对某些事情感到困惑。 html 看起来
我是一名优秀的程序员,十分优秀!