Skip to content

Commit

Permalink
rename nonaxisymmetric, axisymmetric to off-axis, on-axis in script f…
Browse files Browse the repository at this point in the history
…ilename, within the script, and in plot titles
  • Loading branch information
oskooi committed Jan 10, 2025
1 parent 8d5ebda commit 4fd9c08
Show file tree
Hide file tree
Showing 7 changed files with 321 additions and 16 deletions.
317 changes: 311 additions & 6 deletions doc/docs/Python_Tutorials/Near_to_Far_Field_Spectra.md

Large diffs are not rendered by default.

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
"""Radiation pattern of a nonaxisymmetric dipole in cylindrical coordinates.
"""Radiation pattern of an off-axis dipole in cylindrical coordinates.
Tutorial Reference:
Expand Down Expand Up @@ -59,11 +59,11 @@ def plot_radiation_pattern(dipole_pol: str, radial_flux: np.ndarray):
ax.grid(True)
ax.set_rlabel_position(22)
ax.set_ylabel("radial flux (a.u.)")
ax.set_title("radiation pattern (φ = 0) of a nonaxisymmetric {dipole_name} dipole")
ax.set_title(f"radiation pattern (φ = 0) of an off-axis {dipole_name} dipole")

if mp.am_master():
fig.savefig(
"dipole_radiation_pattern_nonaxisymmetric.png",
"dipole_radiation_pattern_off_axis.png",
dpi=150,
bbox_inches="tight",
)
Expand Down Expand Up @@ -134,7 +134,7 @@ def get_farfields(
def dipole_in_vacuum(
dipole_pol: str, dipole_pos_r: mp.Vector3, m: int
) -> Tuple[np.ndarray, np.ndarray, np.ndarray, np.ndarray]:
"""Computes the far fields of a nonaxisymmetric point source.
"""Computes the far fields of an off-axis point source.
Args:
dipole_pol: the dipole polarization.
Expand Down Expand Up @@ -292,7 +292,7 @@ def flux_from_farfields(e_field: np.ndarray, h_field: np.ndarray) -> float:

if mp.am_master():
np.savez(
"dipole_farfields_nonaxisymmetric.npz",
"dipole_farfields_off_axis.npz",
AZIMUTHAL_RAD=AZIMUTHAL_RAD,
FARFIELD_RADIUS_UM=FARFIELD_RADIUS_UM,
PML_UM=PML_UM,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
"""Radiation pattern of an axisymmetric dipole in cylindrical coordinates.
"""Radiation pattern of an on-axis dipole in cylindrical coordinates.
Tutorial Reference:
Expand Down Expand Up @@ -60,11 +60,11 @@ def plot_radiation_pattern(dipole_pol: str, radial_flux: np.ndarray):
ax.grid(True)
ax.set_rlabel_position(22)
ax.set_ylabel("radial flux (a.u.)")
ax.set_title("radiation pattern (φ = 0) of an axisymmetric {dipole_name} dipole")
ax.set_title("radiation pattern (φ = 0) of an on-axis {dipole_name} dipole")

if mp.am_master():
fig.savefig(
"dipole_radiation_pattern_axisymmetric.png",
"dipole_radiation_pattern_on_axis.png",
dpi=150,
bbox_inches="tight",
)
Expand Down Expand Up @@ -133,7 +133,7 @@ def get_farfields(


def dipole_in_vacuum(dipole_pol: str, m: int) -> Tuple[np.ndarray, np.ndarray]:
"""Computes the far fields of an axisymmetric point source.
"""Computes the far fields of an on-axis point source.
Args:
dipole_pol: the polarization of the electric dipole. Either x or z.
Expand Down Expand Up @@ -273,7 +273,7 @@ def flux_from_farfields(e_field: np.ndarray, h_field: np.ndarray) -> float:

if mp.am_master():
np.savez(
"dipole_farfields_axisymmetric.npz",
"dipole_farfields_on_axis.npz",
AZIMUTHAL_RAD=AZIMUTHAL_RAD,
FARFIELD_RADIUS_UM=FARFIELD_RADIUS_UM,
PML_UM=PML_UM,
Expand Down

0 comments on commit 4fd9c08

Please sign in to comment.