EBL#

import jetset
print('tested with',jetset.__version__)
tested with 1.4.0rc3
import warnings
warnings.filterwarnings('ignore')

EBL models#

import matplotlib.pyplot as plt
import numpy as np

EBL models are implemented using a 2D interpolation where the x and y axes represent the redshift and the frequency, and the z axes represents the value of \(e^{-\tau}\)

Included models are:

from jetset.template_2Dmodel import EBLAbsorptionTemplate
ebl_dominguez_2010=EBLAbsorptionTemplate.from_name('Dominguez_2010_v2011')
ebl_dominguez_lopez=EBLAbsorptionTemplate.from_name('Dominguez_2023')
ebl_finke=EBLAbsorptionTemplate.from_name('Finke_2010')
ebl_franceschini=EBLAbsorptionTemplate.from_name('Franceschini_2008')
z=0.1
nu=np.logspace(23,30,100)
ebl_dominguez_lopez.parameters.z_cosm.val=z
ebl_dominguez_lopez.eval(nu=nu)
ebl_finke.parameters.z_cosm.val=z
ebl_finke.eval(nu=nu)
ebl_franceschini.parameters.z_cosm.val=z
ebl_franceschini.eval(nu=nu)
p=ebl_dominguez_lopez.plot_model()
ebl_finke.plot_model(p)
ebl_franceschini.plot_model(p)
p.setlim(y_max=1,y_min=-10,x_max=29)
../../../../_images/EBL_9_0.png
plt.figure(dpi=150)

nu=1E26
z_range=np.linspace(0.001,1,100)
y_fr = np.zeros(z_range.size)
y_fi = np.zeros(z_range.size)
y_do = np.zeros(z_range.size)
for ID,z in enumerate(z_range):
    ebl_franceschini.parameters.z_cosm.val=z
    ebl_finke.parameters.z_cosm.val=z
    ebl_dominguez_lopez.parameters.z_cosm.val=z
    y_fr[ID]=ebl_franceschini.eval(nu=nu,get_model=True)
    y_fi[ID]=ebl_finke.eval(nu=nu,get_model=True)
    y_do[ID]=ebl_dominguez_lopez.eval(nu=nu,get_model=True)


plt.plot(z_range,y_fr,label='%s'%ebl_franceschini.name)
plt.plot(z_range,y_fi,label='%s'%ebl_finke.name)
plt.plot(z_range,y_do,label='%s'%ebl_dominguez_lopez.name)

plt.xlabel('z')
plt.ylabel(r'$exp^{-\tau}$')
plt.legend()
plt.semilogy()
t=plt.title(r'$\nu=%1.1E Hz$'%nu)
../../../../_images/EBL_10_0.png
%matplotlib inline
z_range=np.linspace(0.001,1,100)
y_fr = np.zeros(z_range.size)
y_fi = np.zeros(z_range.size)
y_do = np.zeros(z_range.size)
nu=1E27
for ID,z in enumerate(z_range):
    ebl_franceschini.parameters.z_cosm.val=z
    ebl_finke.parameters.z_cosm.val=z
    ebl_dominguez_lopez.parameters.z_cosm.val=z
    y_fr[ID]=ebl_franceschini.eval(nu=nu,get_model=True)
    y_fi[ID]=ebl_finke.eval(nu=nu,get_model=True)
    y_do[ID]=ebl_dominguez_lopez.eval(nu=nu,get_model=True)


plt.plot(z_range,y_fr,label='%s'%ebl_franceschini.name)
plt.plot(z_range,y_fi,label='%s'%ebl_finke.name)
plt.plot(z_range,y_do,label='%s'%ebl_dominguez_lopez.name)

plt.xlabel('z')
plt.ylabel(r'$exp^{-\tau}$')
plt.legend()
plt.semilogy()
t=plt.title(r'$\nu=%1.1E Hz$'%nu)
../../../../_images/EBL_11_0.png

Combine a Jet model with the EBL model#

To apply the EBL model to a Jet model we need to define a composite model, read the section Composite Models and depending pars for more information regarding the composite models.

We start by combining a Jet model with the EBL absorption model. Please, keep in mind that the EBL absorption model is a multiplicative model, i.e. it has to multiplied and not added to the Jet model.

As first step, we define our Jet model

from jetset.jet_model import Jet
from jetset.model_manager import FitModel

my_jet=Jet(electron_distribution='lppl',name='jet_leptonic')

As second step, we define the EBL model, and we use in this case the Franceschini_2008 model

from jetset.template_2Dmodel import EBLAbsorptionTemplate
ebl_franceschini=EBLAbsorptionTemplate.from_name('Franceschini_2008')

As third step, we add the components models to the the FitModel class, using the FitModel.add_component() method

composite_model=FitModel(nu_size=500,name='EBL corrected')
composite_model.add_component(my_jet)
composite_model.add_component(ebl_franceschini)
composite_model.show_pars()
Table length=14
model namenamepar typeunitsvalphys. bound. minphys. bound. maxlogfrozen
jet_leptonicRregion_sizecm5.000000e+151.000000e+031.000000e+30FalseFalse
jet_leptonicR_Hregion_positioncm1.000000e+170.000000e+00--FalseTrue
jet_leptonicBmagnetic_fieldgauss1.000000e-010.000000e+00--FalseFalse
jet_leptonicNH_cold_to_rel_ecold_p_to_rel_e_ratio1.000000e+000.000000e+00--FalseTrue
jet_leptonicbeam_objbeaming1.000000e+011.000000e-04--FalseFalse
jet_leptonicz_cosmredshift1.000000e-010.000000e+00--FalseFalse
jet_leptonicgminlow-energy-cut-offlorentz-factor*2.000000e+001.000000e+001.000000e+09FalseFalse
jet_leptonicgmaxhigh-energy-cut-offlorentz-factor*1.000000e+061.000000e+001.000000e+15FalseFalse
jet_leptonicNemitters_density1 / cm31.000000e+020.000000e+00--FalseFalse
jet_leptonicgamma0_log_parabturn-over-energylorentz-factor*1.000000e+041.000000e+001.000000e+09FalseFalse
jet_leptonicsLE_spectral_slope2.000000e+00-1.000000e+011.000000e+01FalseFalse
jet_leptonicrspectral_curvature4.000000e-01-1.500000e+011.500000e+01FalseFalse
Franceschini_2008scale_factorscale_factor1.000000e+000.000000e+00--FalseTrue
Franceschini_2008z_cosmredshift1.000000e+000.000000e+00--FalseTrue

Important

Starting from version 1.2.0 we have changed the syntax of link_par, please update your scripts

Since, both the Jet model the EBL share the same parameter, i.e. the redshift, we link the two parameters

composite_model.link_par(par_name='z_cosm', from_model='Franceschini_2008', to_model='jet_leptonic')
composite_model.show_pars()
Table length=14
model namenamepar typeunitsvalphys. bound. minphys. bound. maxlogfrozen
jet_leptonicRregion_sizecm5.000000e+151.000000e+031.000000e+30FalseFalse
jet_leptonicR_Hregion_positioncm1.000000e+170.000000e+00--FalseTrue
jet_leptonicBmagnetic_fieldgauss1.000000e-010.000000e+00--FalseFalse
jet_leptonicNH_cold_to_rel_ecold_p_to_rel_e_ratio1.000000e+000.000000e+00--FalseTrue
jet_leptonicbeam_objbeaming1.000000e+011.000000e-04--FalseFalse
jet_leptonicz_cosm(M)redshift1.000000e-010.000000e+00--FalseFalse
jet_leptonicgminlow-energy-cut-offlorentz-factor*2.000000e+001.000000e+001.000000e+09FalseFalse
jet_leptonicgmaxhigh-energy-cut-offlorentz-factor*1.000000e+061.000000e+001.000000e+15FalseFalse
jet_leptonicNemitters_density1 / cm31.000000e+020.000000e+00--FalseFalse
jet_leptonicgamma0_log_parabturn-over-energylorentz-factor*1.000000e+041.000000e+001.000000e+09FalseFalse
jet_leptonicsLE_spectral_slope2.000000e+00-1.000000e+011.000000e+01FalseFalse
jet_leptonicrspectral_curvature4.000000e-01-1.500000e+011.500000e+01FalseFalse
Franceschini_2008scale_factorscale_factor1.000000e+000.000000e+00--FalseTrue
Franceschini_2008z_cosm(L,jet_leptonic)redshift------FalseTrue

As you can see, now the parameter z_cosm in Franceschini_2008 is the linked paramter (flagge by the L in parenthesis), and the one belonging to the jet_flaring component is the master one (flagged by the M in parenthesis).

These methods are alternative ways to set a parameter in a composite model

composite_model.jet_leptonic.parameters.z_cosm.val=0.1
composite_model.set_par('jet_leptonic','z_cosm',0.1)
composite_model.set_par(my_jet,'z_cosm',0.1)

Since by default, added components are summed together, so we need to define the correct multiplicative for for the composite model.

composite_model.show_model_components()
--------------------------------------------------------------------------------
Composite model description
--------------------------------------------------------------------------------
name: EBL corrected
type: composite_model
components models:
 -model name: jet_leptonic model type: jet
 -model name: Franceschini_2008 model type: table2D

--------------------------------------------------------------------------------

This can be done just by writing the mathematical expression as a string, using the model names reported in the model description table, and that’s it!

composite_model.composite_expr='jet_leptonic*Franceschini_2008'
composite_model.jet_leptonic.IC_nu_size=150
composite_model.eval()
p=composite_model.plot_model()
p.setlim(y_max=1E-12)
../../../../_images/EBL_33_0.png

if you want to remove the link from the parameter

composite_model.parameters.reset_dependencies()
composite_model.parameters
Table length=14
model namenamepar typeunitsvalphys. bound. minphys. bound. maxlogfrozen
jet_leptonicRregion_sizecm5.000000e+151.000000e+031.000000e+30FalseFalse
jet_leptonicR_Hregion_positioncm1.000000e+170.000000e+00--FalseTrue
jet_leptonicBmagnetic_fieldgauss1.000000e-010.000000e+00--FalseFalse
jet_leptonicNH_cold_to_rel_ecold_p_to_rel_e_ratio1.000000e+000.000000e+00--FalseTrue
jet_leptonicbeam_objbeaming1.000000e+011.000000e-04--FalseFalse
jet_leptonicz_cosmredshift1.000000e-010.000000e+00--FalseFalse
jet_leptonicgminlow-energy-cut-offlorentz-factor*2.000000e+001.000000e+001.000000e+09FalseFalse
jet_leptonicgmaxhigh-energy-cut-offlorentz-factor*1.000000e+061.000000e+001.000000e+15FalseFalse
jet_leptonicNemitters_density1 / cm31.000000e+020.000000e+00--FalseFalse
jet_leptonicgamma0_log_parabturn-over-energylorentz-factor*1.000000e+041.000000e+001.000000e+09FalseFalse
jet_leptonicsLE_spectral_slope2.000000e+00-1.000000e+011.000000e+01FalseFalse
jet_leptonicrspectral_curvature4.000000e-01-1.500000e+011.500000e+01FalseFalse
Franceschini_2008scale_factorscale_factor1.000000e+000.000000e+00--FalseTrue
Franceschini_2008z_cosmredshift1.000000e-010.000000e+00--FalseTrue
None

now the two z_cosm parameters are not linkend anymore

Example of model fitting with EBL#

from jetset.test_data_helper import  test_SEDs
from jetset.data_loader import ObsData,Data
test_SEDs
['/Users/orion/miniforge3/envs/jetset/lib/python3.12/site-packages/jetset/test_data/SEDs_data/SED_3C345.ecsv',
 '/Users/orion/miniforge3/envs/jetset/lib/python3.12/site-packages/jetset/test_data/SEDs_data/SED_MW_Mrk421_EBL_DEABS.ecsv',
 '/Users/orion/miniforge3/envs/jetset/lib/python3.12/site-packages/jetset/test_data/SEDs_data/SED_MW_Mrk501_EBL_ABS.ecsv',
 '/Users/orion/miniforge3/envs/jetset/lib/python3.12/site-packages/jetset/test_data/SEDs_data/SED_MW_Mrk501_EBL_DEABS.ecsv']
%matplotlib inline
data=Data.from_file(test_SEDs[2])
sed_data=ObsData(data_table=data)
myPlot=sed_data.plot_sed()

sed_data.group_data(bin_width=0.2)
sed_data.add_systematics(0.1,[10.**6,10.**29])
myPlot.add_data_plot(sed_data,label='rebinned')
myPlot.setlim(y_min=1E-14,y_max=1E-9,x_min=1E9,x_max=1E29)
================================================================================

*  binning data  *
---> N bins= 88
---> bin_width= 0.2
================================================================================
../../../../_images/EBL_41_1.png
from jetset.sed_shaper import  SEDShape
my_shape=SEDShape(sed_data)
my_shape.eval_indices(silent=True)
p=my_shape.plot_indices()
p.setlim(y_min=1E-15,y_max=1E-6)
================================================================================

* evaluating spectral indices for data *
================================================================================
../../../../_images/EBL_42_1.png
mm,best_fit=my_shape.sync_fit(check_host_gal_template=True,
                  Ep_start=None,
                  minimizer='lsb',
                  silent=True,
                  fit_range=[10,21])
================================================================================

* Log-Polynomial fitting of the synchrotron component *
---> first blind fit run,  fit range: [10, 21]
---> class:  HSP

---> class:  HSP
Table length=6
model namenamevalbestfit valerr +err -start valfit range minfit range maxfrozen
LogCubicb-5.589204e-02-5.589204e-026.234641e-03---5.237376e-02-1.000000e+010.000000e+00False
LogCubicc-3.292704e-04-3.292704e-048.968206e-04--7.639964e-03-1.000000e+011.000000e+01False
LogCubicEp1.698160e+011.698160e+018.583094e-02--1.556163e+010.000000e+003.000000e+01False
LogCubicSp-1.030620e+01-1.030620e+011.607997e-02---1.019011e+01-3.000000e+010.000000e+00False
host_galaxynuFnu_p_host-9.972939e+00-9.972939e+003.177593e-02---1.019011e+01-1.219011e+01-8.190114e+00False
host_galaxynu_scale-2.290459e-03-2.290459e-031.811408e-03--0.000000e+00-2.908697e-032.908697e-03False
---> sync       nu_p=+1.698160e+01 (err=+8.583094e-02)  nuFnu_p=-1.030620e+01 (err=+1.607997e-02) curv.=-5.589204e-02 (err=+6.234641e-03)
================================================================================
my_shape.IC_fit(fit_range=[23,29],minimizer='minuit')
p=my_shape.plot_shape_fit()
p.setlim(y_min=1E-15)
================================================================================

* Log-Polynomial fitting of the IC component *
---> fit range: [23, 29]
---> LogCubic fit
-------------------------------------------------------------------------
Fit report

Model: IC-shape-fit
Table length=4
model namenamepar typeunitsvalphys. bound. minphys. bound. maxlogfrozen
LogCubicbcurvature-1.627265e-01-1.000000e+010.000000e+00FalseFalse
LogCubiccthird-degree-4.569970e-02-1.000000e+011.000000e+01FalseFalse
LogCubicEppeak freqHz2.526444e+010.000000e+003.000000e+01TrueFalse
LogCubicSppeak fluxerg / (s cm2)-1.057790e+01-3.000000e+010.000000e+00TrueFalse
converged=True
calls=104
mesg=
Migrad
FCN = 3.232 Nfcn = 104
EDM = 8.24e-09 (Goal: 0.0002)
Valid Minimum Below EDM threshold (goal x 10)
No parameters at limit Below call limit
Hesse ok Covariance accurate
Name Value Hesse Error Minos Error- Minos Error+ Limit- Limit+ Fixed
0 par_0 -0.163 0.025 -10 0
1 par_1 -0.046 0.020 -10 10
2 par_2 25.26 0.17 0 30
3 par_3 -10.58 0.05 -30 0
dof=6
chisq=3.231556, chisq/red=0.538593 null hypothesis sig=0.779273

stats without the UL
dof  UL=6
chisq=3.231556, chisq/red=0.538593 null hypothesis sig=0.779273


best fit pars
Table length=4
model namenamevalbestfit valerr +err -start valfit range minfit range maxfrozen
LogCubicb-1.627265e-01-1.627265e-012.483991e-02---1.000000e+00-1.000000e+010.000000e+00False
LogCubicc-4.569970e-02-4.569970e-021.984551e-02---1.000000e+00-1.000000e+011.000000e+01False
LogCubicEp2.526444e+012.526444e+011.736457e-01--2.531190e+010.000000e+003.000000e+01False
LogCubicSp-1.057790e+01-1.057790e+014.914805e-02---1.000000e+01-3.000000e+010.000000e+00False
-------------------------------------------------------------------------
Table length=4
model namenamevalbestfit valerr +err -start valfit range minfit range maxfrozen
LogCubicb-1.627265e-01-1.627265e-012.483991e-02---1.000000e+00-1.000000e+010.000000e+00False
LogCubicc-4.569970e-02-4.569970e-021.984551e-02---1.000000e+00-1.000000e+011.000000e+01False
LogCubicEp2.526444e+012.526444e+011.736457e-01--2.531190e+010.000000e+003.000000e+01False
LogCubicSp-1.057790e+01-1.057790e+014.914805e-02---1.000000e+01-3.000000e+010.000000e+00False
---> IC         nu_p=+2.526444e+01 (err=+1.736457e-01)  nuFnu_p=-1.057790e+01 (err=+4.914805e-02) curv.=-1.627265e-01 (err=+2.483991e-02)
================================================================================
../../../../_images/EBL_44_9.png
from jetset.obs_constrain import ObsConstrain
from jetset.model_manager import  FitModel
sed_obspar=ObsConstrain(beaming=25,
                        B_range=[0.001,0.1],
                        distr_e='lppl',
                        t_var_sec=3*86400,
                        nu_cut_IR=1E11,
                        SEDShape=my_shape)


prefit_jet=sed_obspar.constrain_SSC_model(electron_distribution_log_values=False, silent=True)
prefit_jet.save_model('prefit_jet_gal_templ.pkl')
================================================================================

*  constrains parameters from observable *
/Users/orion/miniforge3/envs/jetset/lib/python3.12/site-packages/jetset/obs_constrain.py:1514: RankWarning: Polyfit may be poorly conditioned
  p=polyfit(nu_p_IC_model_log,B_grid_log,2)
Table length=12
model namenamepar typeunitsvalphys. bound. minphys. bound. maxlogfrozen
jet_leptonicRregion_sizecm1.214702e+161.000000e+031.000000e+30FalseFalse
jet_leptonicR_Hregion_positioncm1.000000e+170.000000e+00--FalseTrue
jet_leptonicBmagnetic_fieldgauss5.050000e-020.000000e+00--FalseFalse
jet_leptonicNH_cold_to_rel_ecold_p_to_rel_e_ratio1.000000e+000.000000e+00--FalseTrue
jet_leptonicbeam_objbeaming2.500000e+011.000000e-04--FalseFalse
jet_leptonicz_cosmredshift3.360000e-020.000000e+00--FalseFalse
jet_leptonicgminlow-energy-cut-offlorentz-factor*1.487509e+021.000000e+001.000000e+09FalseFalse
jet_leptonicgmaxhigh-energy-cut-offlorentz-factor*2.121873e+061.000000e+001.000000e+15FalseFalse
jet_leptonicNemitters_density1 / cm32.378576e+010.000000e+00--FalseFalse
jet_leptonicgamma0_log_parabturn-over-energylorentz-factor*6.673207e+031.000000e+001.000000e+09FalseFalse
jet_leptonicsLE_spectral_slope2.251647e+00-1.000000e+011.000000e+01FalseFalse
jet_leptonicrspectral_curvature2.794602e-01-1.500000e+011.500000e+01FalseFalse
================================================================================
composite_model=FitModel(nu_size=500,name='EBL corrected',template=my_shape.host_gal)
composite_model.add_component(prefit_jet)
composite_model.eval()
composite_model.plot_model()
<jetset.plot_sedfit.PlotSED at 0x16ffc0a10>
../../../../_images/EBL_46_1.png
from jetset.template_2Dmodel import EBLAbsorptionTemplate
ebl_franceschini=EBLAbsorptionTemplate.from_name('Franceschini_2008')
composite_model.add_component(ebl_franceschini)
composite_model.link_par(par_name='z_cosm', from_model='Franceschini_2008', to_model='jet_leptonic')
composite_model.composite_expr='(jet_leptonic+host_galaxy)*Franceschini_2008'
composite_model.show_model()
--------------------------------------------------------------------------------
Composite model description
--------------------------------------------------------------------------------
name: EBL corrected
type: composite_model
components models:
 -model name: host_galaxy model type: template
 -model name: jet_leptonic model type: jet
 -model name: Franceschini_2008 model type: table2D

--------------------------------------------------------------------------------
individual component description

--------------------------------------------------------------------------------
model description
--------------------------------------------------------------------------------
name: host_galaxy
type: template

--------------------------------------------------------------------------------
Table length=2
model namenamepar typeunitsvalphys. bound. minphys. bound. maxlogfrozen
host_galaxynuFnu_p_hostnuFnu-scaleerg / (s cm2)-9.972939e+00-2.000000e+012.000000e+01FalseFalse
host_galaxynu_scalenu-scaleHz-2.290459e-03-2.000000e+002.000000e+00FalseFalse
--------------------------------------------------------------------------------

--------------------------------------------------------------------------------
model description:
--------------------------------------------------------------------------------
type: Jet
name: jet_leptonic
geometry: spherical

electrons distribution:
 type: lppl
 gamma energy grid size:  201
 gmin grid : 1.487509e+02
 gmax grid : 2.121873e+06
 normalization:  True
 log-values:  False
 ratio of cold protons to relativistic electrons: 1.000000e+00

radiative fields:
 seed photons grid size:  100
 IC emission grid size:  100
 source emissivity lower bound :  1.000000e-120
 spectral components:
   name:Sum, state: on
   name:Sum, hidden: False
   name:Sync, state: self-abs
   name:Sync, hidden: False
   name:SSC, state: on
   name:SSC, hidden: False
external fields transformation method: blob

SED info:
 nu grid size jetkernel: 1000
 nu size: 500
 nu mix (Hz): 1.000000e+06
 nu max (Hz): 1.000000e+30

flux plot lower bound   :  1.000000e-30

--------------------------------------------------------------------------------
Table length=12
model namenamepar typeunitsvalphys. bound. minphys. bound. maxlogfrozen
jet_leptonicRregion_sizecm1.214702e+161.000000e+031.000000e+30FalseFalse
jet_leptonicR_Hregion_positioncm1.000000e+170.000000e+00--FalseTrue
jet_leptonicBmagnetic_fieldgauss5.050000e-020.000000e+00--FalseFalse
jet_leptonicNH_cold_to_rel_ecold_p_to_rel_e_ratio1.000000e+000.000000e+00--FalseTrue
jet_leptonicbeam_objbeaming2.500000e+011.000000e-04--FalseFalse
jet_leptonicz_cosm(M)redshift3.360000e-020.000000e+00--FalseFalse
jet_leptonicgminlow-energy-cut-offlorentz-factor*1.487509e+021.000000e+001.000000e+09FalseFalse
jet_leptonicgmaxhigh-energy-cut-offlorentz-factor*2.121873e+061.000000e+001.000000e+15FalseFalse
jet_leptonicNemitters_density1 / cm32.378576e+010.000000e+00--FalseFalse
jet_leptonicgamma0_log_parabturn-over-energylorentz-factor*6.673207e+031.000000e+001.000000e+09FalseFalse
jet_leptonicsLE_spectral_slope2.251647e+00-1.000000e+011.000000e+01FalseFalse
jet_leptonicrspectral_curvature2.794602e-01-1.500000e+011.500000e+01FalseFalse
--------------------------------------------------------------------------------

--------------------------------------------------------------------------------
model description
--------------------------------------------------------------------------------
name: Franceschini_2008
type: table2D

--------------------------------------------------------------------------------
Table length=2
model namenamepar typeunitsvalphys. bound. minphys. bound. maxlogfrozen
Franceschini_2008scale_factorscale_factor1.000000e+000.000000e+00--FalseTrue
Franceschini_2008z_cosm(L,jet_leptonic)redshift------FalseTrue
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
composite_model.eval()
composite_model.plot_model()
<jetset.plot_sedfit.PlotSED at 0x32cd4bbf0>
../../../../_images/EBL_50_1.png
from jetset.minimizer import ModelMinimizer
from jetset.model_manager import  FitModel
from jetset.jet_model import Jet



composite_model.freeze(prefit_jet,'z_cosm')
composite_model.freeze(prefit_jet,'R_H')
composite_model.jet_leptonic.parameters.beam_obj.fit_range=[5,50]
composite_model.jet_leptonic.parameters.R.fit_range=[10**15.5,10**17.5]
composite_model.jet_leptonic.parameters.gmax.fit_range=[1E4,1E8]
composite_model.jet_leptonic.parameters.z_cosm.val=0.03


composite_model.host_galaxy.parameters.nuFnu_p_host.frozen=False
composite_model.host_galaxy.parameters.nu_scale.frozen=True
composite_model.jet_leptonic.nu_size=200
composite_model.jet_leptonic.IC_nu_size=100
model_minimizer_lsb=ModelMinimizer('lsb')
best_fit=model_minimizer_lsb.fit(composite_model,sed_data,1E11,1E29,fitname='SSC-best-fit-lsb',repeat=3)
filtering data in fit range = [1.000000e+11,1.000000e+29]
data length 31
================================================================================

* start fit process *
-----
fit run: 0
0it [00:00, ?it/s]
- best chisq=2.45711e+01

fit run: 1
- old chisq=2.45711e+01
0it [00:00, ?it/s]
- best chisq=1.50148e+01

fit run: 2
- old chisq=1.50148e+01
0it [00:00, ?it/s]
- best chisq=1.50148e+01

-------------------------------------------------------------------------
Fit report

Model: SSC-best-fit-lsb
Table length=16
model namenamepar typeunitsvalphys. bound. minphys. bound. maxlogfrozen
host_galaxynuFnu_p_hostnuFnu-scaleerg / (s cm2)-9.963022e+00-2.000000e+012.000000e+01FalseFalse
host_galaxynu_scalenu-scaleHz-2.290459e-03-2.000000e+002.000000e+00FalseTrue
jet_leptonicRregion_sizecm1.178190e+161.000000e+031.000000e+30FalseFalse
jet_leptonicR_Hregion_positioncm1.000000e+170.000000e+00--FalseTrue
jet_leptonicBmagnetic_fieldgauss1.588009e-020.000000e+00--FalseFalse
jet_leptonicNH_cold_to_rel_ecold_p_to_rel_e_ratio1.000000e+000.000000e+00--FalseTrue
jet_leptonicbeam_objbeaming4.165537e+011.000000e-04--FalseFalse
jet_leptonicz_cosm(M)redshift3.000000e-020.000000e+00--FalseTrue
jet_leptonicgminlow-energy-cut-offlorentz-factor*1.088387e+021.000000e+001.000000e+09FalseFalse
jet_leptonicgmaxhigh-energy-cut-offlorentz-factor*1.994112e+061.000000e+001.000000e+15FalseFalse
jet_leptonicNemitters_density1 / cm32.324878e+010.000000e+00--FalseFalse
jet_leptonicgamma0_log_parabturn-over-energylorentz-factor*3.489722e+031.000000e+001.000000e+09FalseFalse
jet_leptonicsLE_spectral_slope2.145819e+00-1.000000e+011.000000e+01FalseFalse
jet_leptonicrspectral_curvature2.201140e-01-1.500000e+011.500000e+01FalseFalse
Franceschini_2008scale_factorscale_factor1.000000e+000.000000e+00--FalseTrue
Franceschini_2008z_cosm(L,jet_leptonic)redshift------FalseTrue
converged=True
calls=94
mesg=
'ftol termination condition is satisfied.'
dof=21
chisq=15.014771, chisq/red=0.714989 null hypothesis sig=0.822210

best fit pars
Table length=16
model namenamevalbestfit valerr +err -start valfit range minfit range maxfrozen
host_galaxynuFnu_p_host-9.963022e+00-9.963022e+002.014599e-02---9.972939e+00-1.219011e+01-8.190114e+00False
host_galaxynu_scale-2.290459e-03-------2.290459e-03-2.908697e-032.908697e-03True
jet_leptonicR1.178190e+161.178190e+161.360728e+16--1.214702e+163.162278e+153.162278e+17False
jet_leptonicR_H1.000000e+17------1.000000e+170.000000e+00--True
jet_leptonicB1.588009e-021.588009e-027.227427e-03--5.050000e-020.000000e+00--False
jet_leptonicNH_cold_to_rel_e1.000000e+00------1.000000e+000.000000e+00--True
jet_leptonicbeam_obj4.165537e+014.165537e+011.764974e+01--2.500000e+015.000000e+005.000000e+01False
jet_leptonicz_cosm(M)3.000000e-02------3.000000e-020.000000e+00--True
jet_leptonicgmin1.088387e+021.088387e+026.417763e+01--1.487509e+021.000000e+001.000000e+09False
jet_leptonicgmax1.994112e+061.994112e+067.828353e+05--2.121873e+061.000000e+041.000000e+08False
jet_leptonicN2.324878e+012.324878e+012.809480e+01--2.378576e+010.000000e+00--False
jet_leptonicgamma0_log_parab3.489722e+033.489722e+034.019028e+03--6.673207e+031.000000e+001.000000e+09False
jet_leptonics2.145819e+002.145819e+001.100511e-01--2.251647e+00-1.000000e+011.000000e+01False
jet_leptonicr2.201140e-012.201140e-014.201285e-02--2.794602e-01-1.500000e+011.500000e+01False
Franceschini_2008scale_factor1.000000e+00------1.000000e+000.000000e+00--True
Franceschini_2008z_cosm(L,jet_leptonic)3.000000e-02--------0.000000e+00--True
-------------------------------------------------------------------------

================================================================================
composite_model.nu_min=1E8
composite_model.jet_leptonic.nu_min=1E8
composite_model.eval()
p=composite_model.plot_model(sed_data=sed_data)
../../../../_images/EBL_52_0.png