-
Notifications
You must be signed in to change notification settings - Fork 61
refractive index computed for a given temperature #203
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
Conversation
Updated to compute refractive index also as a function of temperature
Hi @mattemilio, Thanks for the contribution! Adding support for temperature- and pressure-dependent refractive index is a great improvement, and this will be very useful for many applications. Since this is your first time contributing: welcome! Don’t worry about formatting or coding conventions. What matters most is that you’ve taken the time to improve the package, and that’s always appreciated. Before merging, there are just a few things I’d like to clean up:
I’m happy to make these changes myself, but if you’d prefer to continue working on the PR, that’s very welcome too. If you push new commits to this branch, they’ll appear automatically here. I can also push my own edits to your branch if you’re okay with that. Let me know how you’d like to proceed, and thanks again for your contribution! Best, |
Thanks @HarrisonKramer for the feedback. Kind regards |
fixed 1 bug sometimes the reference temperature exist in the yaml file but not the thermal dispersion coefficients (e.g. fused_silica). In that case there was a problem in the previous version
Codecov ReportAttention: Patch coverage is
@@ Coverage Diff @@
## master #203 +/- ##
=======================================
Coverage 95.51% 95.51%
=======================================
Files 163 163
Lines 9133 9169 +36
=======================================
+ Hits 8723 8758 +35
- Misses 410 411 +1
🚀 New features to boost your workflow:
|
…tical implementation consistent with original
…ynamic coefficients are available
Thanks again for writing this, @mattemilio! I made some formatting changes, keeping the original mathematics from your code. We still need to add tests for the new functionality before we can merge. That could involve making comparisons against commercial code or just systematically going through the equations by hand for a few materials and comparing them to the values calculated in Optiland. I will try to do these comparisons and add some tests in the coming days. You can also do this if you prefer - just let me know if so. Regards, |
Thanks a lot @HarrisonKramer. |
A correction need to be applied for the input wavelength to compute the base_relative_n in case of arbitrary temperature and pressure
I obtain very similar refractive index values but not exactly the same. I simulated an aspheric N-BK7 lens in Zemax optimised to have perfect geometrical spot on axis at a temperature of -40 degrees and P = 0 atm. I compare the spot size between optiland and Zemax |
Hi @mattemilio, Thanks for making the comparison. The results look very close, and the discrepancies seem minor enough to merge for now, especially given potential differences in coefficients or even numerical precision. Before merging, I'd like to add unit tests to structurally test the model outputs against the underlying equations. I will do this over the coming days and will push my changes to this PR. Regards, |
Hi @mattemilio, I just added a few more tests to improve coverage. Everything else remains as it was. I also added you to the authors page. If you prefer not to be listed, just let me know. Thanks again for the solid addition. For a first contribution, it's excellent - and we'd be happy to see more ideas, suggestions or PRs from you in the future! Best, |
Hi @mattemilio, We have a discord server for all contributors. We use it to discuss new features, get feedback on implementations, etc. Feel free to join if you like, even just as an observer. Link to join: Regards, |
In case the thermal dispersion coefficients are available in the yml file the coefficients are read and used to compute refractive index of the material for a specific temperature
This is important for optical designs that do not work at ambient temperature (e.g. some optical systems in space missions)
I am not a programmer and this is the first time I contribute to a repository. Please forgive any potential mistake