Modes and fields¶
- class camfr.Coord¶
A point in space.
c1andc2are x and y in Cartesian structures, rho and phi in cylindrical ones. The optional Limits (Plus or Min) choose the side of an index discontinuity at which a field is evaluated.__init__(c1: float, c2: float, z: float) -> None__init__(c1: float, c2: float, z: float, c1_limit: Limit) -> None__init__(c1: float, c2: float, z: float, c1_limit: Limit, c2_limit: Limit) -> None__init__(c1: float, c2: float, z: float, c1_limit: Limit, c2_limit: Limit, z_limit: Limit) -> None
- class camfr.Field¶
The electromagnetic field at a point. Components 1 and 2 are x and y (Cartesian) or rho and phi (cylindrical).
- E1() complex¶
First transverse component of E.
- E2() complex¶
Second transverse component of E.
- Ez() complex¶
z component of E.
- H1() complex¶
First transverse component of H.
- H2() complex¶
Second transverse component of H.
- Hz() complex¶
z component of H.
- S1() complex¶
First transverse component of the Poynting vector E x H*.
- S2() complex¶
Second transverse component of the Poynting vector E x H*.
- Sz() complex¶
z component of the Poynting vector E x H*.
- abs_E() float¶
Magnitude of E.
- abs_H() float¶
Magnitude of H.
- abs_S() float¶
Magnitude of the Poynting vector.
- class camfr.FieldExpansion¶
A field given by its mode expansion in a waveguide.
- class camfr.Mode¶
An eigenmode of a waveguide.
- kz() complex¶
Propagation constant.
- n_eff() complex¶
Effective index.
- plot_field(component, r1, r2=0, r3=0, filename=0, colormap=0, overlay_n=1, contour=1, arrow=0)¶
Plot a field component.
componentmaps a Field to a real number, e.g.lambda f: f.E2().real.mode.plot_field(component, r_x)plots a waveguide mode along x;stack.plot_field(component, r_x, r_z)the field in a Stack, Cavity or BlochMode, after an incident field or source has been set (r_x, r_y, r_zfor a 3D stack); a SectionMode takesr_x, r_y.overlay_noverlays the index profile, drawn as contours ifcontour; except for waveguide modes,filenamesaves the picture instead of showing it.
- pol() Polarisation¶
Polarisation.
- class camfr.BlochMode¶
A mode of a BlochStack.
- S_flux(c1_start: float, c1_stop: float, eps: float) float¶
Power flux along z at z = 0 between c1_start and c1_stop, relative precision eps.
- animate_field(component, r1, r2, r3=0, filename=0, overlay_n=1, contour=1, ln=0)¶
Animate the time evolution of a complex field component.
As
plot_field, butcomponentreturns a complex number, e.g.lambda f: f.E2().filenamewrites the animation to a GIF file.
- bw_field() ndarray¶
Backward mode amplitudes at the start of the period.
- fw_bw()¶
fw_bw(z: float) -> tupleForward and backward mode amplitudes at z, as a tuple.
fw_bw(z: float, limit: Limit) -> tupleAs fw_bw(z), on the given side (Plus or Min) of an interface at z.
- fw_field() ndarray¶
Forward mode amplitudes at the start of the period.
- plot_field(component, r1, r2=0, r3=0, filename=0, colormap=0, overlay_n=1, contour=1, arrow=0)¶
Plot a field component.
componentmaps a Field to a real number, e.g.lambda f: f.E2().real.mode.plot_field(component, r_x)plots a waveguide mode along x;stack.plot_field(component, r_x, r_z)the field in a Stack, Cavity or BlochMode, after an incident field or source has been set (r_x, r_y, r_zfor a 3D stack); a SectionMode takesr_x, r_y.overlay_noverlays the index profile, drawn as contours ifcontour; except for waveguide modes,filenamesaves the picture instead of showing it.