PAHFIT / pahfit

Model Decomposition for Near- to Mid-Infrared Spectroscopy of Astronomical Sources
https://pahfit.readthedocs.io/
18 stars 26 forks source link

Implement Modified Blackbody #176

Closed jdtsmith closed 2 years ago

jdtsmith commented 2 years ago

Formerly BlackBody1D was actually a modified blackbody. With this fix, two separate components are created. The sci-pack is updated accordingly. Fixes #171.

Improves the compositing of models to guard against missing components. Formerly if no BB continua were set, the model setup would fail.

jdtsmith commented 2 years ago

Looks like our "test" comparison to M101 nucleus hard-codes the outdated fit. @karllark is that easy to update?

karllark commented 2 years ago

Yes it is easy. Look at pahfit/test_fitting_spitzer.py. You need to do the fit with the new code and then print out the parameters as an array. Useprint(repr(model.parameters)) to get something that is easy to cut and paste into the testing code.

karllark commented 2 years ago

Ok. Now I see it. You removed the line that modified the blackbody and then put it in "ModifiedBlackBody". Looks great.

karllark commented 2 years ago

The PAHFITBase.write function needs to be updated to handle the ModifiedBlackBody and output it. This will address #180.

jdtsmith commented 2 years ago

Fixed in 166d6dc. Uses isinstance instead of comparing class string, so that component classes can be inherited. We could for example make AsymmetricDrude1D a subclass of Drude1D.

karllark commented 2 years ago

Will merge and fix failing tests in a separate PR.