# Knowledge Base

 Navigation: Scripting Language > Near to far field projections farfieldspherical We've made some changes. Use 'Ctrl-F5' to clear your browser cache.

Interpolates far field data (3D simulations) from E(ux,uy) to spherical coordinates E(theta,phi). The far field projections functions generally return the projection as a function of ux,uy (direction cosines). farfieldspherical can be used to interpolate this data into the more common units of theta, phi. See the farfield3d documentation for information on interpreting ux, uy, na, nb for various monitor orientations.

 Supported Product: FDTD, MODE

 Syntax Description out = farfieldspherical( E2, ux, uy, theta, phi); Interpolate far field data to spherical coordinates.

 Parameter Default value Type Description E2 required matrix E field data from farfield3d ux required vector ux data from farfieldux. Note that the result should be a vector, so it is sufficient to perform the farfieldux script command for only 1 frequency point. uy required vector uy data from farfielduy. Note that the result should be a vector, so it is sufficient to perform the farfieldux script command for only 1 frequency point. theta required vector theta vector, in degrees. Must have length L or 1. phi required vector phi vector, in degrees. Must have length L or 1.

Example

Create a plot of the E2_far vs theta, for phi=0.

m="Monitor1";  # Monitor name

res = 201;    # projection resolution

E2 = farfield3d(m,1,res,res);

ux = farfieldux(m,1,res,res);

uy = farfielduy(m,1,res,res);

theta = linspace(-90,90,100);

phi = 0;

plot(theta, farfieldspherical(E2,ux,uy,theta,phi) ,"theta", "E^2", "E^2 at phi=0");

Interpolate field data to a grid of theta and phi angles.

theta = linspace(-90,90,10);

phi = linspace(0,45,11);

Theta = meshgridx(theta,phi);

Phi = meshgridy(theta,phi);

E2_angle = farfieldspherical(E2,ux,uy,Theta,Phi);

See Also

Copyright Lumerical Inc. | Privacy | Site Map