The LogWavelengthDistribution class is user-configurable with a wavelength range at the highest user experience level. The default range, inserted automatically in all other cases, matches the widest wavelength range allowed in SKIRT. When the minimum value of 1 pm is converted to keV and back, the rounding errors cause the resulting value to be outside of the allowed range. This causes an error when reading the ski file.
With the spectral output style set to energy, the default units for wavelengths in the Q&A and in MakeUp are still micron, causing unexpected results when the user does not explicitly specify a unit string.
Description
This update fixes these issues as follows:
The new DefaultWavelengthDistribution class is now used as the default wavelength distribution. This class has no configuration options so it sidesteps the problem of imprecise unit conversions. In user experience level 3, the LogWavelengthDistribution class can still be used; however in that case the minimum and maximum wavelengths will almost surely be explicitly set to values that are well within the allowed range.
When there is no unit string, the Q&A and MakeUp now honor the default spectral units depending on the configured style.
Tests
All functional tests still work; a test for DefaultWavelengthDistribution has been added.
Motivation After the previous update #194:
LogWavelengthDistribution
class is user-configurable with a wavelength range at the highest user experience level. The default range, inserted automatically in all other cases, matches the widest wavelength range allowed in SKIRT. When the minimum value of 1 pm is converted to keV and back, the rounding errors cause the resulting value to be outside of the allowed range. This causes an error when reading the ski file.MakeUp
are still micron, causing unexpected results when the user does not explicitly specify a unit string.Description This update fixes these issues as follows:
DefaultWavelengthDistribution
class is now used as the default wavelength distribution. This class has no configuration options so it sidesteps the problem of imprecise unit conversions. In user experience level 3, the LogWavelengthDistribution class can still be used; however in that case the minimum and maximum wavelengths will almost surely be explicitly set to values that are well within the allowed range.MakeUp
now honor the default spectral units depending on the configured style.Tests All functional tests still work; a test for
DefaultWavelengthDistribution
has been added.