materials.data#

Optical materials built from owned data, with self-contained native persistence.

Classes

DataMaterial(definition, *[, name, ...])

Own sampled or analytic dispersion and optional measured extinction.

class DataMaterial(definition: dict[str, Any], *, name: str = '', metadata: dict[str, Any] | None = None, propagation_model: BasePropagationModel | None = None, bounds: BoundsPolicy = 'raise')[source]#

Own sampled or analytic dispersion and optional measured extinction.

Use from_samples or from_coefficients to construct optical data, or pass an explicit native definition. No file or registry is accessed. Definition records are immutable; create a replacement to change optical data. Wavelengths use micrometers and extinction k is dimensionless.

Parameters:
  • definition – Native dispersion and optional extinction objects.

  • name – Descriptive label, never a catalog-lookup instruction.

  • metadata – JSON-compatible descriptive provenance, copied on input/output.

  • propagation_model – Optional registered propagation model.

  • bounds – Tabulated n/k queries outside their respective sample intervals raise by default. "clamp" holds the nearest endpoint value. Analytic formula validity limits remain enforced independently.

abbe() → float#

Calculate the Abbe number (Vd) of the material.

The Abbe number is a measure of the material’s dispersion, defined as Vd = (n_d - 1) / (n_F - n_C), where n_d, n_F, and n_C are the refractive indices at the Fraunhofer d (587.5618 nm), F (486.1327 nm), and C (656.2725 nm) spectral lines, respectively.

Returns:

The Abbe number of the material.

Return type:

float

property bounds: Literal['raise', 'clamp']#

The read-only out-of-range policy for tabulated n and k.

property definition: MaterialDefinition#

The read-only optical definition, independent of descriptive metadata.

property display_name: str#

Use the optional descriptive name without inventing catalog identity.

classmethod from_coefficients(formula: str, coefficients: Any, *, name: str = '', wavelength_range: Any = None, extinction: dict[str, Any] | None = None, metadata: dict[str, Any] | None = None, propagation_model: BasePropagationModel | None = None, bounds: BoundsPolicy = 'raise') → DataMaterial[source]#

Preserve an analytic equation; bounds controls tabulated k only.

A supplied formula wavelength range (in µm) is always enforced.

classmethod from_dict(data: dict[str, Any]) → DataMaterial[source]#

Restore owned optical data; BaseMaterial restores propagation dispatch.

classmethod from_samples(wavelengths: Any, indices: Any, *, name: str = '', extinction: dict[str, Any] | None = None, metadata: dict[str, Any] | None = None, propagation_model: BasePropagationModel | None = None, bounds: BoundsPolicy = 'raise') → DataMaterial[source]#

Interpolate n/k samples; optionally clamp outside each table’s interval.

k(wavelength: float | be.ndarray, **kwargs) → float | be.ndarray#

Calculates the extinction coefficient at a given wavelength with caching.

Parameters:
  • wavelength (float | be.ndarray) – The wavelength(s) of light in microns. Can be a float, numpy array, or torch tensor.

  • **kwargs – Additional keyword arguments for calculation.

Returns:

The extinction coefficient at the given wavelength(s).

Return type:

float | be.ndarray

property metadata: dict[str, Any]#

An independent copy of optional provenance.

n(wavelength: float | be.ndarray, **kwargs) → float | be.ndarray#

Calculates the refractive index at a given wavelength with caching.

Parameters:
  • wavelength (float | be.ndarray) – The wavelength(s) of light in microns. Can be a float, numpy array, or torch tensor.

  • **kwargs – Additional keyword arguments for calculation (e.g., temperature).

Returns:

The refractive index at the given wavelength(s).

Return type:

float | be.ndarray

spectral_range(property_name: str = 'n') → tuple[float, float] | None[source]#

Bounds of the requested property; absent extinction is unbounded zero.

to_dict() → dict[str, Any][source]#

Serialize the complete definition inline with independent containers.