Slab¶
-
class
modesolverpy.structure_base.Slab(name, x_step, y_step, x_max, y_max, x_min, y_min, n_background, wavelength)[source]¶ Bases:
modesolverpy.structure_base.StructureA
Slabrepresents a horizontal slice of the refractive index profile.A
Slabsobject composes manySlabobjects. The moreSlabare added, the more horizontal slices are added. ASlabhas a chosen fixed height, and a background (nominal) refractive index. A slab can then be customised to include a desired design.Parameters: - name (str) – The name of the slab.
- x_step (float) – The step in x.
- y_step (float) – The step in y.
- x_max (float) – The maximum x-value.
- y_max (float) – The maximum y-value.
- x_min (float) – The minimum x-value.
- y_min (float) – The minimum x-value.
- n_background (float) – The nominal refractive index.
- wavelength (float) – The wavelength the structure operates at.
-
position¶ int – A unique identifier for the
-
:class:`Slab` object.
Attributes Summary
epsnp.array – A grid of permittivies representing the permittivity profile of the structure. eps_funcfunction – a function that when passed a x and y values, returns the permittivity profile of the structure, interpolating if necessary. nnp.array – A grid of refractive indices representing the refractive index profile of the structure. n_funcfunction – a function that when passed a x and y values, returns the refractive index profile of the structure, interpolating if necessary. positionxnp.array – The grid points in x. x_ctrfloat – The centre distance in x. x_ptsint – The number of grid points in x. xcnp.array – The centre points of the x points. xc_maxfloat – The maximum value of xc. xc_minfloat – The minimum value of xc. xc_ptsint – The number of points in xc. ynp.array – The grid points in y. y_ctrfloat – The centre distance in y y_ptsint – The number of grid points in y. ycnp.array – The centre points of the y points. yc_maxfloat – The maximum value of yc. yc_minfloat – The minimum value of yc. yc_ptsint – The number of points in yc. Methods Summary
add_material(x_min, x_max, n[, angle])Add a refractive index between two x-points. write_to_file([filename, plot])Write the refractive index profile to file. Attributes Documentation
-
eps¶ np.array – A grid of permittivies representing the permittivity profile of the structure.
-
eps_func¶ function – a function that when passed a x and y values, returns the permittivity profile of the structure, interpolating if necessary.
-
n¶ np.array – A grid of refractive indices representing the refractive index profile of the structure.
-
n_func¶ function – a function that when passed a x and y values, returns the refractive index profile of the structure, interpolating if necessary.
-
position= 0
-
x¶ np.array – The grid points in x.
-
x_ctr¶ float – The centre distance in x.
-
x_pts¶ int – The number of grid points in x.
-
xc¶ np.array – The centre points of the x points.
-
xc_max¶ float – The maximum value of xc.
-
xc_min¶ float – The minimum value of xc.
-
xc_pts¶ int – The number of points in xc.
-
y¶ np.array – The grid points in y.
-
y_ctr¶ float – The centre distance in y
-
y_pts¶ int – The number of grid points in y.
-
yc¶ np.array – The centre points of the y points.
-
yc_max¶ float – The maximum value of yc.
-
yc_min¶ float – The minimum value of yc.
-
yc_pts¶ int – The number of points in yc.
Methods Documentation
-
add_material(x_min, x_max, n, angle=0)[source]¶ Add a refractive index between two x-points.
Parameters: - x_min (float) – The start x-point.
- x_max (float) – The stop x-point.
- n (float, function) – Refractive index between x_min and x_max. Either a constant (float), or a function that accepts one parameters, the wavelength, and returns a float of the refractive index. This is useful when doing wavelength sweeps and solving for the group velocity. The function provided could be a Sellmeier equation.
- angle (float) – Angle in degrees of the slope of the sidewalls at x_min and x_max. This is useful for defining a ridge with angled sidewalls.
-
write_to_file(filename='material_index.dat', plot=True)¶ Write the refractive index profile to file.
Parameters: - filename (str) – The nominal filename the refractive index data should be saved to.
- plot (bool) – True if plots should be generates, otherwise False. Default is True.