Skip to main content

Python interface for various refractive index databases

Project description

RefIdxDB-Logo

RefIdxDB

Python interface for various refractive index databases

I was tired to download files from here and there, parse them each manually and locally. Hence, I copied most of my parsing code into this project, so it can be developed further.

[!note] If your source is not implemented, feel free to open an issue! You can also try to implement it yourself. You can take refidx and aria as a reference on what needs to be implemented.

Installation

refidxdb can be downloaded from PiPy.org:

pip install refidxdb

After the pip command, the refidxdb command should be available. The main purpose of this command is to download and cache the databases locally. They will be downloaded to $HOME/.cache/refidxdb under a folder corresponding to the class name.

API

RefIdxDB: is the main blueprint class from which all the specific parser classes need to inherit. This yields a unified API, i.e., all the instances have the same methods available.

path: is the path leading to the wanted file relative to the database. This value can be usually copied from the URL.

data: represents the raw data obtained from the file found under path.

nk: are the parsed real and imaginary parts of the refractive index. The main column is always the wavelength, i.e., wave numbers will always be transformed into wavelengths.

interpolate: you rarely want to use the tables as is, therefore an interpolation method is implemented to calculate n and k for a target wavelength.

[!warning] Only wavelengths are currently supported, since they are my main use-case. If you have a proposal on how to add wave number support, please submit an issue/PR.

Supported DBs

refractiveindex.info

refractiveindex.info mainly differentiates between raw data with wavelengths in micrometers, or polynomial functions which hold for a certain range. The raw data is contained in YAML files, with each data type being referenced.

Currently, supported data types are:

  • tabulated_nk

ARIA - Aerosol Refractive Index Archive

Aria consists of ri files, which are whitespace separated values. The header is prefixed by a hashtag #. The FORMAT value gives information about the column labels. Both wavelengths WAVL and wave numbers WAVN will be read correctly and transformed into wavelengths with no SI prefix (meters [m]). The default scales for wavelengths and wave numbers are 1e-6 (micrometers) and 1e2 (centimeters^-1).

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

refidxdb-0.0.1.tar.gz (5.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

refidxdb-0.0.1-py3-none-any.whl (6.8 kB view details)

Uploaded Python 3

File details

Details for the file refidxdb-0.0.1.tar.gz.

File metadata

  • Download URL: refidxdb-0.0.1.tar.gz
  • Upload date:
  • Size: 5.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for refidxdb-0.0.1.tar.gz
Algorithm Hash digest
SHA256 82cbd031f7edfe193afd59b42b774becf8f1d4f91cfa150b828a89622e2efe75
MD5 1d8740c1757910a8a4938c181afeee35
BLAKE2b-256 ea06675ae5d08b1b85f391f432cc62f875a081773abb0f6ffc5ece8f191962af

See more details on using hashes here.

Provenance

The following attestation bundles were made for refidxdb-0.0.1.tar.gz:

Publisher: pypi.yml on arunoruto/RefIdxDB

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file refidxdb-0.0.1-py3-none-any.whl.

File metadata

  • Download URL: refidxdb-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 6.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for refidxdb-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 694a26953b348b45bec39d2a826bc8064f96d354130cccf033dc0f252b5fbdd7
MD5 2d8abdab1d6e4bb0235e24af9d34f4f5
BLAKE2b-256 e0828526ce172fee88f346fd18a991367d257b25067d1904a6bb47168a48b444

See more details on using hashes here.

Provenance

The following attestation bundles were made for refidxdb-0.0.1-py3-none-any.whl:

Publisher: pypi.yml on arunoruto/RefIdxDB

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page