matplotlib - Spherical polar surface plot in python -
I have to illustrate the antenna reaction pattern in the spherical polar plot. I first create theta ( t
) and phi ( p
) values. Then, for each of F.C. and F_s, each theta [i]
and PHI [i]
.
T = NP is calculated for. For xrange (x) linspace (-math.pi / 2, math.pi / 2, num = x) p = np.linspace (-math.pi, math.pi, num = x): in xrange For x (x): i am in xrange (n): F_c = F_c_F_s.F_c (live [ii], PHI [i], t [j], p [k]) f_s = f_ c_f_ Sum_f_c [j] [k] = sum_f_c [j] [k] + f_c sum_f_s [j] [k] = sum_f_s [j] sum_f_c [the] [fa] of F_s (theta [i], fi [i], t [j], p [ [K] + f_s mod_f [J] [k] = math.log ((math.plog (sum_f_c [j] [k], 2) + math.pow (sum_f_s [j] [k], 2)), 10 )
We now have a value of mod_F
for each t
and p
. I have calculated the Cartesian coordinates for each value of Fia and accordingly, I have the following to create the plot of the surface:
fig = p.figure () ax = Axes3d (fig) ax.plot_wireframe (x, y, z) ax .plot_surface (x, y, z, rstride = 1, cstride = 1, cmap = cm.jet) p.show ()
The problem is, it is incredibly slow! Even 10 x 10 grids for x = 10
, it takes a lot of time. Is there a way to do this in a better and faster way?
The following worked for me:
t = np.linspace (0, np.pi, num = X) p = np.linspace (-np.pi, np.pi, num = x) [t, p] = np FG + FC_F_s.F_C (Directed [i], FI [i], T, P) F_S + FC_F_SSF_S (Direct [I] , FI [I], T, P) mod_F = (np.log10 ((np.power (F_c, 2) + np.power (F_s, 2))
Comments
Post a Comment