-
Notifications
You must be signed in to change notification settings - Fork 0
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
Merging in Spectral Reflctance Changes #43
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This code includes the modifications to the `Reflectance` model struct. It uses `Spectrum` objects to hold whatever kind of reflectance spectrum we require. This comes with its accompanying builder object. I have also implemented the code to load from parameters and into attributes.
The logic in the spectral interpolation let through photons that were above the maximum wavelength in the loaded spectrum. It should not do this. So, I have fixed this with an extract check before performing interpolation. I have also written a new unit test to check this behaviour in the reflectance class.
Also added documentation to all of the `Spectrum` test cases.
The reflectance spectra should be between 0.0 -> 1.0, so check that they are when we init the reflectance, else we should gracefully exit and warn the user.
This means that we can more efficiently handle special cases and explictly specify behaviour more easily. In particular, it allows us to offer a `Constant` variant, which is not bounded by wavelengths. This includes all the changes required to make it work in the model.
In the the `Reflector` attribute, the ratio between diffuse and specular reflection is not required if only using a single reflectance model. However, it will assert that it is defined if both are used.
This is so that we can create constants in the `Spectrum` object form the parameter file.
The interpolation was not working the way that I’d expected. I should now have written it in the correct way. Tests show that it is working.
After fixing the interpolation problems, I have added some tests that check that things work with more points. This should be a better test as to whether the interpolation is actually working.
Fixed the warnings that were currently in the codebase. Just cleans up compiling a little.
Also fixed a few more compiler warnings.
We can now keep track of the progress through the lights in a given simulation.
Added unit tests to improve test coverage of core library.
Attempted to apply a fix for a crash that happens when the azimuthal component of the spherical CDF would return a value that would not map on to a valid plane, returning a `None`. I have made it iterate this process until a valid plane is found.
The idea of specularity is more elegant, and already well defined in computer graphics. Having it this way around makes more sense. Tests pass with this change applied.
- Description changed to `specularity`.
This is just to keep the intermediate steps and output in-line with the changes I've made today.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I am merging in the implementation of code for the spectral reflectance. This also includes a number of bug fixes that we found during simulations.