ICSM / ampere

A tool to fit the SED and spectra of dusty objects to constrain, among other things, the dust properties and mineralogy
6 stars 2 forks source link

wavelength range cannot go beyond wavelength of lab opacities #44

Open SaschaZeegers opened 3 years ago

SaschaZeegers commented 3 years ago

When using one of the programs that uses the opacities listed in the opacity folder, it is impossible to select a wavelength below or above those of the opacities listed in the folder. If one tries to do so, a warning appears telling you that you are outside of the range and the code won't run. In case of photometry outside this range the warning is slightly more cryptic, the following warning appears: AttributeError: 'Photometry' object has no attribute 'covMatmask'. There are multiple ways to solve this problem, like extrapolating the lab data, or padding it with zeros. However, all should come with a warning, so that the user understands the consequences of these actions.

pscicluna commented 3 years ago

A specific error message describing the problem in more detail would be a good improvement for now

SaschaZeegers commented 1 year ago

This needs a check between data and models and give a warning why the fit doesn't work.

SaschaZeegers commented 1 year ago

If your dataset contains data outside of the defined optical constant wavelength values, you will get the following error:

Directory: /optical_const_bulk/ ['mgsio3_am_cde01.q' 'Mg06Fe04SiO3_Dorschner_copy.q' 'mg2sio4_jena_cr_av_50k_cde.q' 'Mg60Fe40_2_SiO4_Henning.q' 'Mg06Fe04SiO3_Dorschner.q' 'graphite_draine_cde.q'] mgsio3_am_cde01.q Mg06Fe04SiO3_Dorschner_copy.q Traceback (most recent call last): File "/cygob_2_12_lines_incl_sbi.py", line 201, in model = Blackbody_dust(wavelengths) File "/cygob_2_12_lines_incl_sbi.py", line 68, in init opacity_array[:,j] = f(wavelengths)#wavelengths) File "lib/python3.10/site-packages/scipy/interpolate/_polyint.py", line 78, in call y = self._evaluate(x) File "/lib/python3.10/site-packages/scipy/interpolate/_interpolate.py", line 707, in _evaluate below_bounds, above_bounds = self._check_bounds(x_new) File "/lib/python3.10/site-packages/scipy/interpolate/_interpolate.py", line 736, in _check_bounds raise ValueError("A value in x_new is below the interpolation " ValueError: A value in x_new is below the interpolation range.