Skip to main content

refidx2se

CI PyPI Python License: MIT

A lightweight Python interface to the refractiveindex.info database, with built-in conversion to refellips RI objects for spectroscopic ellipsometry workflows.

Features

  • Search the full refractiveindex.info catalog by material name (case-insensitive, partial matching).
  • Load any material entry directly into a refellips.RI object — no manual file management.
  • Wavelength ranges are automatically clipped to the material's valid range.
  • Catalog fetched from GitHub and cached in-process — only one network request per session.

Installation

pip install refidx2se

Or from source:

git clone https://github.com/agauer/refidx2se.git
cd refidx2se
pip install -e ".[dev]"

Quick start

import numpy as np
import refidx2se
from refellips.reflect_modelSE import ReflectModelSE
from refellips.dispersion import RI, load_material

# 1. Explore available entries
refidx2se.print_material_options("SiO2")
# 4 entries matching 'SiO2':
#   option   shelf        book                      page                                description
#   -------- ------------ ------------------------- ----------------------------------- ---------------------------------------------
#   0        main         SiO2                      Malitson                            Malitson 1965: n 0.21–6.7 µm
#   1        main         SiO2                      ...

# 2. Pick one by index
shelf, book, page = refidx2se.return_material_option("SiO2", idx=0)

# 3. Load into refellips
wavelengths = np.linspace(400, 900, 200)   # nm
ri = refidx2se.rim_to_refellips(shelf, book, page, wavelengths)

# 4. Create a model
si = load_material("silicon")
air = RI("/path/to/refellips/materials/air.csv")

est_thickness = 20  # Å
min_thickness = 1
max_thickness = 50

sio2 = ri(est_thickness)
sio2.thick.setp(vary=True, bounds=(min_thickness, max_thickness))

stack = air() | sio2 | si()
model = ReflectModelSE(stack)

# 5. Continue with refellips analysis

API reference

search_material(book: str) -> list[dict]

Returns all catalog entries whose book name contains book (case-insensitive). Each dict has keys shelf, book, page, name.

return_material_option(book: str, idx: int = 0) -> tuple[str, str, str]

Returns (shelf, book, page) for the idx-th match. Raises ValueError if no matches exist or idx is out of range.

print_material_options(book: str) -> None

Pretty-prints a numbered table of all matches — handy for interactive use.

rim_to_refellips(shelf, book, page, wavelengths_nm) -> refellips.RI

Fetches the material from refractiveindex.info, clips the requested wavelength array to the material's valid range, and returns a refellips.RI object. Missing k data is silently replaced with zeros.

License

MIT — see LICENSE.

Metadata

Release files for refidx2se 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for refidx2se 0.1.1
File Size Uploaded Provenance Actions
refidx2se-0.1.1.tar.gz 7.9 kB Without provenance Details for refidx2se-0.1.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for refidx2se 0.1.1
File Interpreter ABI Platform Actions
refidx2se-0.1.1-py3-none-any.whl Python 3 none any Details for refidx2se-0.1.1-py3-none-any.whl

Total release size: 14.5 kB

Release files / refidx2se-0.1.1.tar.gz

Download URL refidx2se-0.1.1.tar.gz
Size 7.9 kB
Tags Source
SHA-256 checksum
How to use checksums
ae7e9a550f3b6a70f6b7a3787f45638f2b60e883d70b16e7e560c23544be5db5
BLAKE2b-256 checksum
How to use checksums
639c014bf5eb9931945d0e052a1203c010c7df8169f25882debc059d6e6f6c30
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.5

Release files / refidx2se-0.1.1-py3-none-any.whl

Download URL refidx2se-0.1.1-py3-none-any.whl
Size 6.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
37cba1774b7428b66d2323b452eb5e05362e0b2d77d3ad140835263c07b20fe9
BLAKE2b-256 checksum
How to use checksums
60de9601e7b7086716bc30b887dd955ca41ca8b41da4cce111d7bfa258f57217
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.5

Security for refidx2se 0.1.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page