Skip to content

Refractiveindex #369

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 35 commits into
base: development
Choose a base branch
from
Open

Conversation

pots007
Copy link

@pots007 pots007 commented Mar 5, 2025

This PR adds the capability to calculate the the refractive index of a variety materials using the refractiveindex.info database.

Some features:

  • The database is downloaded upon first use, then used from there on
  • Material definition follows the book, shelf, page convention from refractiveindex.com. Some common materials can be initialised by just their name.
  • For any material, the refractive index can be calculated.
  • The spectral phase expansion terms dphi/dw, d2phi/dw2 and d3phi/w3 can be calculated.
  • For some materials also the extinction coefficient can be calculated.
  • Unit tests to test accuracy of all formulas, extinction coefficients and spectral phase expansion terms.

@pots007
Copy link
Author

pots007 commented Mar 5, 2025

Forgot to mention: pyyaml was also added to the requirements as it is required to parse the refractiveindex database files.

# Returns in s^n/m
return dphi, ddphi * 1e12, dddphi

def _dn_dw(self, lambda_mu, order=1):

Check notice

Code scanning / CodeQL

Explicit returns mixed with implicit (fall through) returns Note

Mixing implicit and explicit returns may indicate an error as implicit returns always return None.
Copy link
Contributor

@MaxThevenet MaxThevenet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this PR! Just a quick comment, could you fix the formatting of docstrings as below? I started putting comments accordingly

@MaxThevenet MaxThevenet added design Raise discussion on LASY architecture and design new feature request or implementation of a new feature labels Apr 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
design Raise discussion on LASY architecture and design new feature request or implementation of a new feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants