GNiendorf / tracepy

Ray Tracing and Optical Design in Python
https://tracepy.readthedocs.io
MIT License
60 stars 14 forks source link

Added glass index dictionary and functions #19

Closed MikeMork closed 5 years ago

MikeMork commented 5 years ago

Added in files and functions to allow the glass type to be set for different optical elements. Glass dictionary comes from refractiveindexinfo.com and is a folder filled with YAML files that contain the glass information.

The index file contains the function to read the YAML files and return functions for refractive index for different materials.

Slight modifications to geometry and ray to allow index to be a function.

Added example notebook modified version of Newtonian Telescope to show that it works when you set the glass type instead of a constant index:

Examples/Newtonian_Telescope_Specify_Glass_Type.ipnb

GNiendorf commented 5 years ago

Looks great! A couple things to change before we merge this:

  1. I think we should keep N as a constant input and add another attribute to geometry called "glass" that users can use to specify the glass input. So they would either specify a constant N value or a glass string input.
  2. Two of the notebooks have errors saying they can't locate the glass database. Probably just need to re-run them.

I look forward to working with you on this project!

GNiendorf commented 5 years ago

Excellent work! This is a major upgrade for TracePy.