jaxlayerlumos.utils_materials
Material property utilities for optical calculations.
This module provides functions for loading, interpolating, and converting material properties including refractive indices (n, k), permittivity (ε), and permeability (μ). It supports both optical materials (from CSV files) and radar materials, with automatic interpolation to desired frequency ranges.
The module handles: - Loading material data from CSV files - Interpolation of material properties to specific frequencies - Conversion between refractive indices and permittivity/permeability - Special materials like Air and PEC (Perfect Electric Conductor) - Integration with radar material databases
- jaxlayerlumos.utils_materials.convert_n_k_to_eps_mu_for_non_magnetic_materials(n_k)
Convert refractive indices to permittivity and permeability for non-magnetic materials.
This function assumes μ = 1 (non-magnetic materials) and calculates ε = n² using the relationship between refractive index and material properties.
- Parameters:
n_k (jnp.ndarray) – Complex refractive indices.
- Returns:
- (eps, mu) - Relative permittivity and permeability arrays.
mu will be all ones for non-magnetic materials.
- Return type:
tuple
- jaxlayerlumos.utils_materials.get_all_materials()
Get a list of all available material names.
- Returns:
Names of all materials available in the database.
- Return type:
list
- jaxlayerlumos.utils_materials.get_eps_mu(materials, frequencies)
Get permittivity and permeability for a list of materials.
This function handles radar materials using the Michielssen database and special materials like Air and PEC. It returns permittivity and permeability arrays suitable for multilayer calculations.
- Parameters:
materials (list or onp.ndarray) – List of material names or indices. First material must be “Air”.
frequencies (jnp.ndarray) – Frequencies in Hz.
- Returns:
- (eps_r, mu_r) - Relative permittivity and permeability arrays
with shape (n_freq, n_layers).
- Return type:
tuple
- Raises:
NotImplementedError – If the last material is not supported.
- jaxlayerlumos.utils_materials.get_n_k(materials, frequencies)
Get refractive indices for a list of materials.
This function interpolates refractive index data for each material to the target frequencies and returns a complex refractive index array.
- Parameters:
materials (list or onp.ndarray) – List of material names.
frequencies (jnp.ndarray) – Target frequencies in Hz.
- Returns:
Complex refractive indices with shape (n_freq, n_layers).
- Return type:
jnp.ndarray
- jaxlayerlumos.utils_materials.get_n_k_surrounded_by_air(materials, frequencies)
Get refractive indices for materials surrounded by air layers.
This function adds air layers at the beginning and end of the material stack, which is a common requirement for multilayer calculations.
- Parameters:
materials (list or onp.ndarray) – List of material names.
frequencies (jnp.ndarray) – Target frequencies in Hz.
- Returns:
Complex refractive indices with shape (n_freq, n_layers + 2).
- Return type:
jnp.ndarray
- jaxlayerlumos.utils_materials.interpolate(freqs_values, frequencies)
Interpolate frequency-dependent values to target frequencies.
This function performs linear interpolation of frequency-dependent data to the specified target frequencies. It includes bounds checking and warnings for extrapolation.
- Parameters:
freqs_values (jnp.ndarray) – Array with shape (n_points, 2) containing [frequency, value] pairs.
frequencies (jnp.ndarray) – Target frequencies for interpolation.
- Returns:
Interpolated values at the target frequencies.
- Return type:
jnp.ndarray
Note
Extrapolation is allowed but will generate a warning if frequencies are outside the data range.
- jaxlayerlumos.utils_materials.interpolate_material_eps_mu(material, frequencies)
Interpolate permittivity and permeability for a material.
This function loads frequency-dependent permittivity and permeability data and interpolates to the target frequencies.
- Parameters:
material (str) – Name of the material.
frequencies (jnp.ndarray) – Target frequencies in Hz.
- Returns:
- (eps_r_real, eps_r_imag, mu_r_real, mu_r_imag) - Real and
imaginary parts of permittivity and permeability.
- Return type:
tuple
Note
This function requires the material to have frequency-dependent permittivity and permeability data available.
- jaxlayerlumos.utils_materials.interpolate_material_n_k(material, frequencies)
Interpolate refractive indices for a material to target frequencies.
This function handles special materials (Air, PEC) and interpolates refractive index data for other materials to the specified frequencies.
- Parameters:
material (str) – Name of the material.
frequencies (jnp.ndarray) – Target frequencies in Hz.
- Returns:
- (n_material, k_material) - Real and imaginary parts of the
refractive index at the target frequencies.
- Return type:
tuple
- jaxlayerlumos.utils_materials.load_json()
Load the materials index file that maps material names to CSV files.
- Returns:
- (material_indices, current_dir) where material_indices is a dictionary
mapping material names to CSV filenames, and current_dir is the directory containing the materials data.
- Return type:
tuple
- jaxlayerlumos.utils_materials.load_material(material)
Load refractive index data for a material with frequencies in Hz.
This function loads material data and converts wavelengths to frequencies.
- Parameters:
material (str) – Name of the material to load.
- Returns:
- (data_n, data_k) where each is a jnp.ndarray with shape (n_points, 2)
containing [frequency_Hz, value] pairs.
- Return type:
tuple
- jaxlayerlumos.utils_materials.load_material_wavelength(material)
Load refractive index data for a material with wavelengths in meters.
This function loads material data and converts wavelengths from micrometers to meters.
- Parameters:
material (str) – Name of the material to load.
- Returns:
- (data_n, data_k) where each is a jnp.ndarray with shape (n_points, 2)
containing [wavelength_m, value] pairs.
- Return type:
tuple
- jaxlayerlumos.utils_materials.load_material_wavelength_um(material)
Load refractive index data for a material with wavelengths in micrometers.
This function reads the CSV file for the specified material and extracts the wavelength-dependent refractive index (n) and extinction coefficient (k). It supports both wl,n / wl,k blocks and merged wl,n,k files. The data is returned with wavelengths in micrometers.
- Parameters:
material (str) – Name of the material to load.
- Returns:
- (data_n, data_k) where each is a jnp.ndarray with shape (n_points, 2)
containing [wavelength_um, value] pairs.
- Return type:
tuple
- Raises:
ValueError – If the material is not found or the CSV format is invalid.