-
Notifications
You must be signed in to change notification settings - Fork 29
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
Spectrum of properties as a function of wavelength #141
Comments
Feature Proposal: Streamlining [MaterialProperty]_option Units Handling The current implementation of the [MaterialProperty]_option key in ratdb allows for specifying options energy, wavelength, and dy_dwavelength. However, this approach adds unnecessary complexity to how users configure optical properties in RAT software, when dealing with material properties and emission spectra. From the code, we see that the LoadProperty function handles transformations when data is provided as a function of wavelength, including a Jacobian transformation to energy when the dy_dwavelength option is specified. This transformation is required when the user inputs data as a probability density function (PDF) that needs to be converted from wavelength to energy. However, this explicit user-level control introduces potential for errors and confusion. I propose that the [MaterialProperty]_option should be simplified to only define the units in which the data is provided (i.e., energy or wavelength). The decision to apply a Jacobian transformation should be made internally, based on whether the data represents a probability density function (PDF) or a deterministic material property. Specifically:
There should never be a case where a specific [MaterialProperty]_option could be either a PDF or deterministic property. By making the transformation implicit in the type of parameter, the software can reduce the risk of misconfigurations, improve code clarity, and simplify the user experience. The software already distinguishes between these cases but would need to be rewritten to automate this process. This would lead to a more intuitive and error-resistant system, ensuring that users only need to specify the units of their data, while the software handles the transformations automatically where appropriate. |
When defining the emission spectrum (or re-emission in the case of WLS materials) as a function of the wavelength, Ratpac uses the spectrum defined in the RATDB file, but it converts the wavelength to energy. This approach does not accurately reproduce the property, which is defined as a function of the wavelength in the database.
To correctly define the property as a function of wavelength, which is then used as a function of energy, it is necessary to normalise the spectrum by the square of the wavelength. This requirement can make the definition of this type of property confusing and prone to errors.
Ideally, Ratpac should handle the conversion of the spectrum from being a function of wavelength to a function of energy.
PropertiesWavelength.pdf
The text was updated successfully, but these errors were encountered: