.. _jet_numerical_guide:
Numerical setup
===============
.. code:: ipython3
import jetset
print('tested on jetset',jetset.__version__)
.. parsed-literal::
tested on jetset 1.2.2
Changing the grid size for the electron distribution
----------------------------------------------------
.. code:: ipython3
from jetset.jet_model import Jet
my_jet=Jet(name='test',electron_distribution='lppl',)
my_jet.show_model()
.. parsed-literal::
--------------------------------------------------------------------------------
model description:
--------------------------------------------------------------------------------
type: Jet
name: test
electrons distribution:
type: lppl
gamma energy grid size: 201
gmin grid : 2.000000e+00
gmax grid : 1.000000e+06
normalization: True
log-values: False
ratio of cold protons to relativistic electrons: 1.000000e-01
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:Sync, state: self-abs
name:SSC, state: on
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
--------------------------------------------------------------------------------
.. raw:: html
Table length=12
model name | name | par type | units | val | phys. bound. min | phys. bound. max | log | frozen |
test | R | region_size | cm | 5.000000e+15 | 1.000000e+03 | 1.000000e+30 | False | False |
test | R_H | region_position | cm | 1.000000e+17 | 0.000000e+00 | -- | False | True |
test | B | magnetic_field | gauss | 1.000000e-01 | 1.000000e-10 | 1.000000e+10 | False | False |
test | NH_cold_to_rel_e | cold_p_to_rel_e_ratio | | 1.000000e-01 | 0.000000e+00 | -- | False | True |
test | beam_obj | beaming | lorentz-factor* | 1.000000e+01 | 1.000000e-04 | 1.000000e+04 | False | False |
test | z_cosm | redshift | | 1.000000e-01 | 0.000000e+00 | -- | False | False |
test | gmin | low-energy-cut-off | lorentz-factor* | 2.000000e+00 | 1.000000e+00 | 1.000000e+09 | False | False |
test | gmax | high-energy-cut-off | lorentz-factor* | 1.000000e+06 | 1.000000e+00 | 1.000000e+15 | False | False |
test | N | emitters_density | 1 / cm3 | 1.000000e+02 | 0.000000e+00 | -- | False | False |
test | gamma0_log_parab | turn-over-energy | lorentz-factor* | 1.000000e+04 | 1.000000e+00 | 1.000000e+09 | False | False |
test | s | LE_spectral_slope | | 2.000000e+00 | -1.000000e+01 | 1.000000e+01 | False | False |
test | r | spectral_curvature | | 4.000000e-01 | -1.500000e+01 | 1.500000e+01 | False | False |
.. parsed-literal::
--------------------------------------------------------------------------------
It is possible to change the size of the grid for the electron
distributions. It is worth noting that at lower values of the grid size
the speed will increase, **but it is not recommended to go below 100**.
The actual value of the grid size is returned by the :meth:`.Jet.gamma_grid_size`
.. code:: ipython3
print (my_jet.gamma_grid_size)
.. parsed-literal::
201
and this value can be changed using the method :meth:`.Jet.set_gamma_grid_size`. In the following we show the result for a grid of size=10, as anticipated the final integration will be not satisfactory
.. code:: ipython3
my_jet.set_gamma_grid_size(10)
my_jet.eval()
sed_plot=my_jet.plot_model()
sed_plot.setlim(x_min=1E8,y_min=1E-20,y_max=1E-12)
.. image:: Jet_example_num_files/Jet_example_num_9_0.png
.. code:: ipython3
my_jet.set_gamma_grid_size(100)
my_jet.eval()
sed_plot=my_jet.plot_model()
sed_plot.setlim(x_min=1E8,y_min=1E-20,y_max=1E-12)
.. image:: Jet_example_num_files/Jet_example_num_10_0.png
Changing the grid size for the IC process spectra
-------------------------------------------------
**in the current version there is a limit of the size to 1000**
.. code:: ipython3
my_jet=Jet(name='test',electron_distribution='lppl',)
my_jet.show_model()
.. parsed-literal::
--------------------------------------------------------------------------------
model description:
--------------------------------------------------------------------------------
type: Jet
name: test
electrons distribution:
type: lppl
gamma energy grid size: 201
gmin grid : 2.000000e+00
gmax grid : 1.000000e+06
normalization: True
log-values: False
ratio of cold protons to relativistic electrons: 1.000000e-01
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:Sync, state: self-abs
name:SSC, state: on
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
--------------------------------------------------------------------------------
.. raw:: html
Table length=12
model name | name | par type | units | val | phys. bound. min | phys. bound. max | log | frozen |
test | R | region_size | cm | 5.000000e+15 | 1.000000e+03 | 1.000000e+30 | False | False |
test | R_H | region_position | cm | 1.000000e+17 | 0.000000e+00 | -- | False | True |
test | B | magnetic_field | gauss | 1.000000e-01 | 1.000000e-10 | 1.000000e+10 | False | False |
test | NH_cold_to_rel_e | cold_p_to_rel_e_ratio | | 1.000000e-01 | 0.000000e+00 | -- | False | True |
test | beam_obj | beaming | lorentz-factor* | 1.000000e+01 | 1.000000e-04 | 1.000000e+04 | False | False |
test | z_cosm | redshift | | 1.000000e-01 | 0.000000e+00 | -- | False | False |
test | gmin | low-energy-cut-off | lorentz-factor* | 2.000000e+00 | 1.000000e+00 | 1.000000e+09 | False | False |
test | gmax | high-energy-cut-off | lorentz-factor* | 1.000000e+06 | 1.000000e+00 | 1.000000e+15 | False | False |
test | N | emitters_density | 1 / cm3 | 1.000000e+02 | 0.000000e+00 | -- | False | False |
test | gamma0_log_parab | turn-over-energy | lorentz-factor* | 1.000000e+04 | 1.000000e+00 | 1.000000e+09 | False | False |
test | s | LE_spectral_slope | | 2.000000e+00 | -1.000000e+01 | 1.000000e+01 | False | False |
test | r | spectral_curvature | | 4.000000e-01 | -1.500000e+01 | 1.500000e+01 | False | False |
.. parsed-literal::
--------------------------------------------------------------------------------
.. code:: ipython3
my_jet.eval()
sed_plot=my_jet.plot_model()
sed_plot.setlim(x_min=1E8,y_min=1E-20,y_max=1E-12)
.. image:: Jet_example_num_files/Jet_example_num_14_0.png
To get a better sampling of the IC cut-off you can increase the IC
emission grid size
.. code:: ipython3
my_jet.set_IC_nu_size(200)
.. code:: ipython3
my_jet.eval()
sed_plot=my_jet.plot_model()
sed_plot.setlim(x_min=1E8,y_min=1E-20,y_max=1E-12)
.. image:: Jet_example_num_files/Jet_example_num_17_0.png
Changing the grid size for the seed photons
-------------------------------------------
.. code:: ipython3
my_jet=Jet(name='test',electron_distribution='lppl',)
my_jet.show_model()
.. parsed-literal::
--------------------------------------------------------------------------------
model description:
--------------------------------------------------------------------------------
type: Jet
name: test
electrons distribution:
type: lppl
gamma energy grid size: 201
gmin grid : 2.000000e+00
gmax grid : 1.000000e+06
normalization: True
log-values: False
ratio of cold protons to relativistic electrons: 1.000000e-01
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:Sync, state: self-abs
name:SSC, state: on
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
--------------------------------------------------------------------------------
.. raw:: html
Table length=12
model name | name | par type | units | val | phys. bound. min | phys. bound. max | log | frozen |
test | R | region_size | cm | 5.000000e+15 | 1.000000e+03 | 1.000000e+30 | False | False |
test | R_H | region_position | cm | 1.000000e+17 | 0.000000e+00 | -- | False | True |
test | B | magnetic_field | gauss | 1.000000e-01 | 1.000000e-10 | 1.000000e+10 | False | False |
test | NH_cold_to_rel_e | cold_p_to_rel_e_ratio | | 1.000000e-01 | 0.000000e+00 | -- | False | True |
test | beam_obj | beaming | lorentz-factor* | 1.000000e+01 | 1.000000e-04 | 1.000000e+04 | False | False |
test | z_cosm | redshift | | 1.000000e-01 | 0.000000e+00 | -- | False | False |
test | gmin | low-energy-cut-off | lorentz-factor* | 2.000000e+00 | 1.000000e+00 | 1.000000e+09 | False | False |
test | gmax | high-energy-cut-off | lorentz-factor* | 1.000000e+06 | 1.000000e+00 | 1.000000e+15 | False | False |
test | N | emitters_density | 1 / cm3 | 1.000000e+02 | 0.000000e+00 | -- | False | False |
test | gamma0_log_parab | turn-over-energy | lorentz-factor* | 1.000000e+04 | 1.000000e+00 | 1.000000e+09 | False | False |
test | s | LE_spectral_slope | | 2.000000e+00 | -1.000000e+01 | 1.000000e+01 | False | False |
test | r | spectral_curvature | | 4.000000e-01 | -1.500000e+01 | 1.500000e+01 | False | False |
.. parsed-literal::
--------------------------------------------------------------------------------
we can get the current value of the seed photons grid size using attribute :meth:`.Jet.nu_seed_size`
**in the current version there is lit of the size to 1000**
.. code:: ipython3
print (my_jet.nu_seed_size)
.. parsed-literal::
100
and this value can be changed using the method :meth:`.Jet.set_seed_nu_size`. In the following we show the result for a grid of nu_size=10
.. code:: ipython3
my_jet.nu_seed_size=10
my_jet.eval()
sed_plot=my_jet.plot_model()
sed_plot.setlim(x_min=1E8,y_min=1E-20,y_max=1E-12)
.. image:: Jet_example_num_files/Jet_example_num_24_0.png
.. code:: ipython3
my_jet=Jet(name='test',electron_distribution='lppl',)
my_jet.show_model()
.. parsed-literal::
--------------------------------------------------------------------------------
model description:
--------------------------------------------------------------------------------
type: Jet
name: test
electrons distribution:
type: lppl
gamma energy grid size: 201
gmin grid : 2.000000e+00
gmax grid : 1.000000e+06
normalization: True
log-values: False
ratio of cold protons to relativistic electrons: 1.000000e-01
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:Sync, state: self-abs
name:SSC, state: on
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
--------------------------------------------------------------------------------
.. raw:: html
Table length=12
model name | name | par type | units | val | phys. bound. min | phys. bound. max | log | frozen |
test | R | region_size | cm | 5.000000e+15 | 1.000000e+03 | 1.000000e+30 | False | False |
test | R_H | region_position | cm | 1.000000e+17 | 0.000000e+00 | -- | False | True |
test | B | magnetic_field | gauss | 1.000000e-01 | 1.000000e-10 | 1.000000e+10 | False | False |
test | NH_cold_to_rel_e | cold_p_to_rel_e_ratio | | 1.000000e-01 | 0.000000e+00 | -- | False | True |
test | beam_obj | beaming | lorentz-factor* | 1.000000e+01 | 1.000000e-04 | 1.000000e+04 | False | False |
test | z_cosm | redshift | | 1.000000e-01 | 0.000000e+00 | -- | False | False |
test | gmin | low-energy-cut-off | lorentz-factor* | 2.000000e+00 | 1.000000e+00 | 1.000000e+09 | False | False |
test | gmax | high-energy-cut-off | lorentz-factor* | 1.000000e+06 | 1.000000e+00 | 1.000000e+15 | False | False |
test | N | emitters_density | 1 / cm3 | 1.000000e+02 | 0.000000e+00 | -- | False | False |
test | gamma0_log_parab | turn-over-energy | lorentz-factor* | 1.000000e+04 | 1.000000e+00 | 1.000000e+09 | False | False |
test | s | LE_spectral_slope | | 2.000000e+00 | -1.000000e+01 | 1.000000e+01 | False | False |
test | r | spectral_curvature | | 4.000000e-01 | -1.500000e+01 | 1.500000e+01 | False | False |
.. parsed-literal::
--------------------------------------------------------------------------------
.. code:: ipython3
print(my_jet.IC_nu_size)
.. parsed-literal::
100
.. code:: ipython3
my_jet.IC_nu_size=20
my_jet.eval()
sed_plot=my_jet.plot_model()
sed_plot.setlim(x_min=1E8,y_min=1E-20,y_max=1E-12)
.. image:: Jet_example_num_files/Jet_example_num_27_0.png
.. code:: ipython3
my_jet.IC_nu_size=100
my_jet.eval()
sed_plot=my_jet.plot_model()
sed_plot.setlim(x_min=1E8,y_min=1E-20,y_max=1E-12)
.. image:: Jet_example_num_files/Jet_example_num_28_0.png
.. code:: ipython3
my_jet.IC_nu_size=200
my_jet.eval()
sed_plot=my_jet.plot_model()
sed_plot.setlim(x_min=1E8,y_min=1E-20,y_max=1E-12)
.. image:: Jet_example_num_files/Jet_example_num_29_0.png
.. code:: ipython3
my_jet._blob.IC_adaptive_e_binning
my_jet.IC_nu_size=100
my_jet.eval()
sed_plot=my_jet.plot_model()
sed_plot.setlim(x_min=1E8,y_min=1E-20,y_max=1E-12)
.. image:: Jet_example_num_files/Jet_example_num_30_0.png