Optical constants for elements and various materials in the EUV and VUV wavelengths.

Welcome! This is the documentation for ocdb, a Python package for easily accessing the X-ray/EUV/VUV scattering and absorption data contained in the Optical Constants Database (OCDB) provided by the German National Metrology Institute, the Physikalisch-Technische Bundesanstalt, PTB.

This is a first glimpse on how working with the ocdb package may look like:

import ocdb

# All available values for n
[co_wl, co_n] = ocdb.elements.Co.n()

# Complex index of refraction for a given wavelength
_, co_13_5 = ocdb.elements.Co.index_of_refraction(13.5)

# All available values for k with uncertainties
[co_wl, co_k, co_k_lb, co_k_ub] = ocdb.elements.Co.k(uncertainties=True)

For further details, have a look at the use cases section.


A list of features:

  • Access to X-ray/EUV/VUV scattering and absorption coefficients (n and k)

  • Interface similar/compatible to the periodictable Python package

  • Provides data and uncertainties

  • FAIR and linked data: citable, reliable, and reproducible

  • Community-driven: easy to contribute

And to make it even more convenient for users and future-proof:

  • Open source project written in Python (>= 3.9)

  • Developed fully test-driven

  • Extensive user and API documentation


The ocdb package is currently under active development and still considered in beta development state. Therefore, expect frequent changes in features and public APIs that may break your own code. Nevertheless, feedback as well as feature requests are highly welcome.


The ocdb package comes with a rather minimal set of requirements:

  • Python >= 3.9

  • numpy, oyaml, and bibrecord packages

In case you would like to make use of the optional plotting and report generating capabilities, you would need to install additional dependencies, namely Matplotlib (with all its dependencies) and Jinja. Have a look at the installation instructions for further details.

How to cite

The Python ocdb package is free software. However, if you use it for your own research, please consider to cite it appropriately:

Furthermore, if you use the data the ocdb package provides access to for your own research, use the appropriate references for each individual dataset, as available from its metadata. Have a look at the documentation of the ocdb.material.Material class for details how to conveniently obtain the relevant bibliographic data, either as string or as BibTeX record.


To install the ocdb package on your computer (sensibly within a Python virtual environment), open a terminal (activate your virtual environment), and type in the following:

pip install ocdb

Have a look at the more detailed installation instructions as well.


This program is free software: you can redistribute it and/or modify it under the terms of the GPLv3 License. Please note that this license only applies to the ocdb Python package, not to the data contained in the Optical Constants Database (OCDB). The data themselves are licensed under CC BY 4.0, if not explicitly stated otherwise. If you use the ocdb Python package or the data contained in the OCDB, please cite the relevant references. See the How to cite section for further details.

OCDB funding

Development of the Optical Constants Database (OCDB) containing the data the ocdb Python package provides convenient access to has been funded by the EMPIR project 20IND04-ATMOC.