cosimoNigro / agnpy

Modelling jetted Active Galactic Nuclei radiative processes with python
https://agnpy.readthedocs.io/en/latest/
BSD 3-Clause "New" or "Revised" License
45 stars 32 forks source link

Return the different SED components after a fit #141

Open cosimoNigro opened 1 year ago

cosimoNigro commented 1 year ago

I was asked to add a feature to return the different SED components after a fit. This would allow for example, to compute the synchrotron and SSC luminosities, separately, after a SSC scenario has been fitted to some MWL data.

Now, we can either return the different SED components (the vu and vuFnu for each radiative process) or we can return a blob with parameters initialised to the best-fit values. The user would then be able to recompute the corresponding radiation by themselves with the normal functions Synchrotron(blob).

Any preference? @sekerby, @jsitarek?

sekerby commented 1 year ago

I think that returning nu/nuFnu for each of the components is more general, easier to plot, and would allow for faster computation of the luminosities. Returning a blob with the parameters initialized with best-fit values could be useful for theory considerations, but one could also just initialize that manually after the fact.

jsitarek commented 1 year ago

Hi,

In principle it can be done already by running the individual processes with the parameters obtained from the fit. Returning a table of frequencies and SEDs is not a good solution in my opinion, because fits can be done with different processes, so the behaviour of the function will be difficult to describe (e.g. the sequence of SEDs), if you want to go in this direction the best would be to return a dictionary with names of every SED, and then also the blob can be returned, so something like: blob, table_of_nu, {'Synchrotron': SED_synch, "SSC": SED_SSC, "EC_BLR": SED_BLR, ...}