rsoft_cad.layout package

Submodules

rsoft_cad.layout.mode_selective_layout module

Layout management for photonic lantern structures.

rsoft_cad.layout.mode_selective_layout.multilayer_lantern_layout(cladding_dia, layers_config)[source]

Computes the positions of circles arranged in multiple concentric layers with truly optimal packing.

Parameters:
  • cladding_dia (float) – Diameter of the smaller circles (cladding diameter).

  • layers_config (list) –

    List of tuples (n, radius_factor) where: - n: Number of circles in this layer - radius_factor: Factor to multiply the reference radius for this layer

    (1.0 means standard positioning, >1.0 means further from center)

Returns:

(layer_centres, layer_radii) where:

layer_centres (list): List of lists, each containing tuples of (x,y) coordinates for each layer layer_radii (list): List of reference radii for each layer

Return type:

tuple

rsoft_cad.layout.mode_selective_layout.create_layers_config(radial_groups, scale_factors=None)[source]

Create a layers configuration based on radial groups of modes.

Rules: - Modes with radial number = 1 are in the outer layer - Each radial mode group represents a layer - Number of circles in a ring depends on the azimuthal number:

  • If azimuthal number > 0: 2 circles

  • Otherwise: 1 circle

Parameters:
  • radial_groups (dict) – Dictionary mapping radial numbers to lists of modes

  • scale_factors (dict) – Optional scale factors for each radial layer, defaults to {0: 1.0, 1: 1.5, 2: 1.7, …}

Returns:

List of tuples (num_circles, scale_factor) for each layer int: Total number of cores

Return type:

list

rsoft_cad.layout.mode_selective_layout.create_core_map(lp_mode_str, cladding_dia)[source]

Creates a mapping between optical modes and their physical coordinates in the fiber.

This function: 1. Determines which modes are supported based on a cutoff frequency 2. Groups these modes by their radial number 3. Creates a layer configuration where:

  • Modes with radial number = 1 are in the outer layer (reverse sorting)

  • Each radial mode group represents a layer

  1. Returns a dictionary where: - Keys are mode strings (e.g., “LP01”, “LP11”) - Values are single (x,y) coordinate tuples

Parameters:
  • lp_mode_str (str) – The highest LP mode to support (e.g., “LP21”)

  • cladding_dia (float) – Cladding diameter in microns

Returns:

(core_map, cap_dia) where:

core_map (dict): Mapping of mode strings to their coordinate tuples cap_dia (float): Diameter of the capillary

Return type:

tuple

rsoft_cad.layout.mode_selective_layout.create_indexed_core_map(layer_config, cladding_dia)[source]

Creates a mapping between simple indices and their physical coordinates in the fiber.

This function: 1. Uses the provided layer configuration directly 2. Creates coordinates for each layer using multilayer_lantern_layout 3. Returns a dictionary where:

  • Keys are simple integer indices (0, 1, 2, …)

  • Values are single (x,y) coordinate tuples

Parameters:
  • layer_config (list) – List of tuples (num_circles, scale_factor) for each layer

  • cladding_dia (float) – Cladding diameter in microns

Returns:

(core_map, cap_dia) where:

core_map (dict): Mapping of integer indices to their coordinate tuples cap_dia (float): Diameter of the capillary

Return type:

tuple