fdtdx.detectors_from_gds_ports#
- fdtdx.detectors_from_gds_ports(gds_source, cell_name, port_specs, wave_characters, simulation_volume, gds_center, direction='+', mode_index=0, filter_pol=None, height_axis=2, flatten=True)[source]#
Create
ModeOverlapDetectorobjects from GDS port markers.Mirrors
sources_from_gds_ports()exactly but producesModeOverlapDetectorobjects.wave_charactersis a sequence to match the detector constructor signature.See
sources_from_gds_ports()for full documentation of the constraint layout, ordering guarantee, anddirectiondict usage.- Parameters:
gds_source (
str|Path|Library) – Path to a.gdsfile or an already-loadedgdstk.Library.cell_name (
str) – GDS cell containing the port marker polygons.port_specs (
list[GDSPortSpec]) – List ofGDSPortSpecobjects.wave_characters (
Sequence[WaveCharacter]) – Sequence of wavelength characters forwarded to each detector.simulation_volume (
SimulationVolume) – Reference object for size/position constraints. Itspartial_real_shapemust be set onpropagation_axis.gds_center (
tuple[float,float]) – GDS coordinate (in metres) mapped to the x/y centre of the simulation volume.direction (
Union[Literal['+','-'],dict[str,Literal['+','-']]]) – Propagation direction ("+"or"-"), applied to all detectors. Pass adictmapping port names to individual directions when needed.mode_index (
int) – Waveguide mode index.filter_pol (
Optional[Literal['te','tm']]) – Optional polarisation filter.height_axis (
int) – Simulation axis treated as the out-of-plane height; detectors are made to span the full simulation extent on this axis (default 2 = z). This assumes a single vertical stack — detectors run from one face of the simulation volume to the other alongheight_axis.flatten (
bool) – Flatten sub-cell references before reading polygons.
- Returns:
propagation position, transverse center, full-height size, and vertical center.
- Return type:
(detectors, constraints)— four constraints per detector- Raises:
ValueError – If
propagation_axisis not 0 or 1, or ifsimulation_volume.partial_real_shapeisNoneonpropagation_axis.