zero k=0 values
This commit is contained in:
parent
fa3f8db267
commit
0e04f5ca77
@ -188,6 +188,11 @@ def far_to_nearfield(E_far: fdfield_t,
|
|||||||
sin_th[numpy.logical_and(kx == 0, ky == 0)] = 0
|
sin_th[numpy.logical_and(kx == 0, ky == 0)] = 0
|
||||||
cos_th[numpy.logical_and(kx == 0, ky == 0)] = 1
|
cos_th[numpy.logical_and(kx == 0, ky == 0)] = 1
|
||||||
|
|
||||||
|
theta = numpy.arctan2(ky, kx)
|
||||||
|
phi = numpy.arccos(cos_phi)
|
||||||
|
theta[numpy.logical_and(kx == 0, ky == 0)] = 0
|
||||||
|
phi[numpy.logical_and(kx == 0, ky == 0)] = 0
|
||||||
|
|
||||||
# Zero fields beyond valid (phi, theta)
|
# Zero fields beyond valid (phi, theta)
|
||||||
invalid_ind = kxy2 >= k * k
|
invalid_ind = kxy2 >= k * k
|
||||||
theta[invalid_ind] = 0
|
theta[invalid_ind] = 0
|
||||||
|
Loading…
Reference in New Issue
Block a user