@@ -69,24 +69,32 @@ def cartesian_dist(x_1, x_2):
69
69
# In[9]:
70
70
71
71
def cov_gradients (dist_tiled ):
72
+
72
73
condition1 = 0
73
- a = (h_u * h_v )
74
- b = dist_tiled ** 2
75
- condition2 = (np .divide (a , b , out = np .zeros_like (a ), where = b != 0 ) * (- c_o_T * ((
76
- - 14 / a_T ** 2 ) + 105 / 4 * dist_tiled / a_T ** 3 - 35 / 2 * dist_tiled ** 3 / a_T ** 5 + 21 / 4 * dist_tiled ** 5 / a_T ** 7 ) +
77
- c_o_T * 7 * (
78
- 9 * dist_tiled ** 5 - 20 * a_T ** 2 * dist_tiled ** 3 +
79
- 15 * a_T ** 4 * dist_tiled - 4 * a_T ** 5 ) / (
80
- 2 * a_T ** 7 ) -
81
- perpendicularity_matrix * c_o_T * ((
82
- - 14 / a_T ** 2 ) + 105 / 4 * dist_tiled / a_T ** 3 -
83
- 35 / 2 * dist_tiled ** 3 / a_T ** 5 +
84
- 21 / 4 * dist_tiled ** 5 / a_T ** 7 )) +
85
- 1 / 3 * np .eye (dist_tiled .shape [0 ]))
86
-
87
- C_G = np .where (dist_tiled == 0 , condition1 , condition2 ) ## adding nugget effect
74
+ a = (h_u * h_v )
75
+ b = dist_tiled ** 2
76
+
77
+ t1 = np .divide (a , b , out = np .zeros_like (a ), where = b != 0 )
78
+ t2 = - c_o_T * ((- 14 / a_T ** 2 )+
79
+ 105 / 4 * dist_tiled / a_T ** 3 -
80
+ 35 / 2 * dist_tiled ** 3 / a_T ** 5 +
81
+ 21 / 4 * dist_tiled ** 5 / a_T ** 7 )+ \
82
+ c_o_T * 7 * (9 * dist_tiled ** 5 -
83
+ 20 * a_T ** 2 * dist_tiled ** 3 +
84
+ 15 * a_T ** 4 * dist_tiled -
85
+ 4 * a_T ** 5 ) / (2 * a_T ** 7 )
86
+ t3 = perpendicularity_matrix * \
87
+ c_o_T * ((- 14 / a_T ** 2 ) + 105 / 4 * dist_tiled / a_T ** 3 -
88
+ 35 / 2 * dist_tiled ** 3 / a_T ** 5 +
89
+ 21 / 4 * dist_tiled ** 5 / a_T ** 7 )
90
+ t4 = 1 / 3 * np .eye (dist_tiled .shape [0 ])
91
+
92
+ condition2 = t1 * t2 - t3 + t4
93
+
94
+ C_G = np .where (dist_tiled == 0 , condition1 , condition2 ) ## adding nugget effect
88
95
return C_G
89
96
97
+
90
98
# In[10]:
91
99
92
100
dist_tiled = dist_tiled + np .eye (dist_tiled .shape [0 ])
@@ -397,7 +405,7 @@ def plot_interp_with_drift(point_1_y = 2.,
397
405
if show_contours :
398
406
plt .contour (XX , YY , intp , 20 )
399
407
if show_field :
400
- plt .pcolor (XX , YY , intp , alpha = 0.6 , shading = 'auto' )
408
+ plt .pcolor (XX , YY , intp , alpha = 0.6 )
401
409
402
410
if show_contours or show_field :
403
411
try :
0 commit comments