|
@@ -66,8 +66,8 @@ terms, E, H = fieldnlay(x, m, coord)
|
|
Er = np.absolute(E)
|
|
Er = np.absolute(E)
|
|
|
|
|
|
# |E|/|Eo|
|
|
# |E|/|Eo|
|
|
-Eh = np.sqrt(Er[0, :, 0]**2 + Er[0, :, 1]**2 + Er[0, :, 2]**2)
|
|
|
|
-#Eh = Er[0, :, 0]**2 + Er[0, :, 1]**2 + Er[0, :, 2]**2
|
|
|
|
|
|
+#Eh = np.sqrt(Er[0, :, 0]**2 + Er[0, :, 1]**2 + Er[0, :, 2]**2)
|
|
|
|
+Eh = Er[0, :, 0]**2 + Er[0, :, 1]**2 + Er[0, :, 2]**2
|
|
|
|
|
|
result = np.vstack((coordX, coordY, coordZ, Eh)).transpose()
|
|
result = np.vstack((coordX, coordY, coordZ, Eh)).transpose()
|
|
|
|
|
|
@@ -76,8 +76,8 @@ try:
|
|
from matplotlib import cm
|
|
from matplotlib import cm
|
|
from matplotlib.colors import LogNorm
|
|
from matplotlib.colors import LogNorm
|
|
|
|
|
|
- min_tick = 0.16
|
|
|
|
- max_tick = 0.18
|
|
|
|
|
|
+ min_tick = 0.25
|
|
|
|
+ max_tick = 1.0
|
|
|
|
|
|
edata = np.resize(Eh, (npts, npts))
|
|
edata = np.resize(Eh, (npts, npts))
|
|
|
|
|
|
@@ -88,14 +88,14 @@ try:
|
|
scale_y = np.linspace(min(coordY), max(coordY), npts)
|
|
scale_y = np.linspace(min(coordY), max(coordY), npts)
|
|
|
|
|
|
# Define scale ticks
|
|
# Define scale ticks
|
|
- # min_tick = max(0.1, min(min_tick, np.amin(edata)))
|
|
|
|
- # max_tick = max(max_tick, np.amax(edata))
|
|
|
|
|
|
+ min_tick = max(0.1, min(min_tick, np.amin(edata)))
|
|
|
|
+ max_tick = max(max_tick, np.amax(edata))
|
|
#scale_ticks = np.power(10.0, np.linspace(np.log10(min_tick), np.log10(max_tick), 6))
|
|
#scale_ticks = np.power(10.0, np.linspace(np.log10(min_tick), np.log10(max_tick), 6))
|
|
- scale_ticks = np.linspace(min_tick,max_tick, 11)
|
|
|
|
|
|
+ scale_ticks = np.linspace(min_tick,max_tick, 5)
|
|
#scale_ticks = np.linspace(0, 2, 11)
|
|
#scale_ticks = np.linspace(0, 2, 11)
|
|
|
|
|
|
# Interpolation can be 'nearest', 'bilinear' or 'bicubic'
|
|
# Interpolation can be 'nearest', 'bilinear' or 'bicubic'
|
|
- cax = ax.imshow(edata, interpolation = 'nearest', cmap = cm.afmhot,
|
|
|
|
|
|
+ cax = ax.imshow(edata, interpolation = 'nearest', cmap = cm.jet,
|
|
origin = 'lower', vmin = min_tick, vmax = max_tick,
|
|
origin = 'lower', vmin = min_tick, vmax = max_tick,
|
|
#origin = 'lower', vmin = 0.16, vmax = 0.18,
|
|
#origin = 'lower', vmin = 0.16, vmax = 0.18,
|
|
extent = (min(scale_x), max(scale_x), min(scale_y), max(scale_y))
|
|
extent = (min(scale_x), max(scale_x), min(scale_y), max(scale_y))
|
|
@@ -111,17 +111,17 @@ try:
|
|
plt.xlabel('X')
|
|
plt.xlabel('X')
|
|
plt.ylabel('Y')
|
|
plt.ylabel('Y')
|
|
|
|
|
|
- # This part draws the nanoshell
|
|
|
|
- from matplotlib import patches
|
|
|
|
|
|
+ # # This part draws the nanoshell
|
|
|
|
+ # from matplotlib import patches
|
|
|
|
|
|
- s1 = patches.Arc((0, 0), 2.0*x[0, 0], 2.0*x[0, 0], angle=0.0, zorder=2,
|
|
|
|
- theta1=0.0, theta2=360.0, linewidth=1, color='#00fa9a')
|
|
|
|
- ax.add_patch(s1)
|
|
|
|
|
|
+ # s1 = patches.Arc((0, 0), 2.0*x[0, 0], 2.0*x[0, 0], angle=0.0, zorder=2,
|
|
|
|
+ # theta1=0.0, theta2=360.0, linewidth=1, color='#00fa9a')
|
|
|
|
+ # ax.add_patch(s1)
|
|
|
|
|
|
- s2 = patches.Arc((0, 0), 2.0*x[0, 0], 2.0*x[0, 0], angle=0.0, zorder=2,
|
|
|
|
- theta1=0.0, theta2=360.0, linewidth=1, color='#00fa9a')
|
|
|
|
- ax.add_patch(s2)
|
|
|
|
- # End of drawing
|
|
|
|
|
|
+ # s2 = patches.Arc((0, 0), 2.0*x[0, 0], 2.0*x[0, 0], angle=0.0, zorder=2,
|
|
|
|
+ # theta1=0.0, theta2=360.0, linewidth=1, color='#00fa9a')
|
|
|
|
+ # ax.add_patch(s2)
|
|
|
|
+ # # End of drawing
|
|
|
|
|
|
plt.draw()
|
|
plt.draw()
|
|
|
|
|