You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
using dev branch version, there is an error when trying to get single component sub_models like the starlight continuum
my code, after fitting a spectrum spec with model: starspec = model.sub_model(instrumentname=spec.meta['instrument'], redshift=spec.redshift, kind='starlight') PAHFITModelError: Fewer than 2 features! Single component models are no allowed!
The text was updated successfully, but these errors were encountered:
Thank you for reminding me of this restriction I put in. I did this because there is some code that can't deal with a single-component model. (The resulting astropy model is no longer a multi-component model, so loops "over the components" won't work).
I would like a workaround for this, we also need to consider that
We will remove sub_model and replace it with tabulate. See Tabulate model spectrum #249. (This will still have the same issue though...)
A different fitting backend is being developed (not based on astropy). But this will take a while before it gets merged.
As a temporary workaround, you can go head and comment out these lines in the source code of model.py, in Model.__init__()
# if len(features) < 2:
# raise PAHFITModelError(
# "Fewer than 2 features! Single component models are not allowed!"
# )
I did a quick test, and sub_model() will work for single components if you do this. It's just guess() and fit() that will fail, when those functions try to parse the components of the astropy model.
sub_model does not exist anymore, and its replacement tabulate() works for a single component (as tested with the current state of the dev branch). This issue can therefore be closed.
using dev branch version, there is an error when trying to get single component sub_models like the starlight continuum
my code, after fitting a spectrum
spec
withmodel
:starspec = model.sub_model(instrumentname=spec.meta['instrument'], redshift=spec.redshift, kind='starlight') PAHFITModelError: Fewer than 2 features! Single component models are no allowed!
The text was updated successfully, but these errors were encountered: