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
I'm getting an interesting error when fitting a compound model. The error is:
ValueError: Fitting a compound model without units can only be performed on
compound models that only use the arithmetic operators + and -
The model I'm fitting has units for a summed set of models including BlackBody, Drude1D, Gaussian1D models with units of MJy/sr that are then multiplied by a dust attenuation model that does not have units.
An example to reproduce the error:
import numpy as np
from astropy.modeling import fitting, models
fitter = fitting.LevMarLSQFitter()
model = models.BlackBody(temperature=3000 * u.K) * models.Const1D(amplitude=1.0)
x = [1.0, 2.0, 3.0] * u.micron
n = np.random.normal(3)
y = model(x) * (1.0 + n)
res = fitter(model, x, y)
Activity