Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move component methods into Fitter, refactor tabulate #302

Open
jdtsmith opened this issue Dec 2, 2024 · 0 comments
Open

Move component methods into Fitter, refactor tabulate #302

jdtsmith opened this issue Dec 2, 2024 · 0 comments

Comments

@jdtsmith
Copy link
Contributor

jdtsmith commented Dec 2, 2024

Model.tabulate is slow, and relies on Model-recreation and a single hard-coded Fitter class. This is also part of why Model.plot is so slow.

How about the following idea for component computation:

  • Elevate Fitter to be a proper super-class.
  • Give Fitter it its own component methods, one for each component (starlight, blackbody, modified_blackbody, power_gaussian, power_drude). They will take wavelength and standardized component parameters in a fixed order
  • Make Model.tabulate use its own Fitter object compute (creating one if it needs to).
  • Model.tabulate can use rich keywords to return a dictionary of data, similar to the IDL pahfit_components, which had:
                            DUST_CONTINUUM=dust_continuum, $
                            TOTAL_DUST_CONTINUUM=dc_tot,STARLIGHT=stars, $
                            TOTAL_CONTINUUM=tot_cont, $
                            DUST_FEATURES=dust_features, $
                            TOTAL_DUST_FEATURES=df_tot, $
                            LINES=lines,TOTAL_LINES=lines_tot, $
                            EXTINCTION_FAC=ext, $
                            EXTINCTION_CURVE=ext_curve, $
                            DISABLE_EXTINCTION=de
    
- We introduce tests to ensure all `Fitter`'s (including the parent class itself) give the same component outfit for the same input.

I think to start the base `Fitter` components would just be lifted from `APFitter`.  

One minor variation of this is to create _two_ abstractions: `Fitter` and `Components`, with the latter doing the component work.  But I think that's likely overkill.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant