agnpy icon indicating copy to clipboard operation
agnpy copied to clipboard

Return the different SED components after a fit

Open cosimoNigro opened this issue 3 years ago • 2 comments

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?

cosimoNigro avatar May 02 '23 10:05 cosimoNigro

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.

sekerby avatar May 02 '23 12:05 sekerby

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, ...}

jsitarek avatar May 02 '23 12:05 jsitarek