andycasey / smhr

Spectroscopy Made Hard(er)
14 stars 7 forks source link

Exception raised: #265

Closed maddiecain closed 7 years ago

maddiecain commented 7 years ago

An exception was encountered using version 7b5597a on Python 2.7.6 | 32-bit | (default, Sep 15 2014, 17:36:57) [GCC 4.2.1 (Apple Inc. build 5666) (dot 3)]:

Traceback (most recent call last):

  File "/Users/madelyncain/smhr/smh/gui/chemical_abundances.py", line 838, in fit_one
    res = spectral_model.fit()

  File "/Users/madelyncain/smhr/smh/spectral_models/synthesis.py", line 394, in fit
    isotopes=self.session.metadata["isotopes"])

  File "/Users/madelyncain/smhr/smh/spectral_models/synthesis.py", line 93, in approximate_spectral_synthesis
    assert np.isfinite(call(*centroids)[1]).all()

AssertionError

Additional details on how this exception occurred:

maddiecain commented 7 years ago

happens when i try and measure synthesis on Mo

alexji commented 7 years ago

I believe this problem is because the interpolated synthesis model is somehow degenerate when synthesizing really small lines whose spectra don't really change with abundance. Maddie is trying to actually set an upper limit on this line but the current setup only allows doing so after successfully running a fit.

Once #260 is done, it will be possible to synthesize and determine the upper limit without having to run the fit first, and this should be resolved.

alexji commented 7 years ago

This turned out to be a problem with initial guess for synthesis using "nan" if you set it to nan.

I've now fixed it to default to scaled solar if the abundances are nan, so this should work now.