{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Phenomenological model constraining: SSC theory" ] }, { "cell_type": "code", "execution_count": 1, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "tested on jetset 1.3.0rc8\n" ] } ], "source": [ "import jetset\n", "print('tested on jetset',jetset.__version__)" ] }, { "cell_type": "code", "execution_count": 2, "metadata": {}, "outputs": [], "source": [ "import matplotlib\n", "\n", "from matplotlib import pyplot as plt\n", "\n", "import matplotlib.colors as mcolors\n", "\n", "font = {'family' : 'sans-serif',\n", " 'weight' : 'normal',\n", " 'size' : 18}\n", "\n", "matplotlib.rc('font', **font)\n", "matplotlib.pyplot.rc('font', **font)\n", "\n", "\n", "colors=list(mcolors.TABLEAU_COLORS)\n", "\n", "\n", "import numpy as np\n", "import warnings\n", "warnings.filterwarnings('ignore')" ] }, { "cell_type": "code", "execution_count": 3, "metadata": {}, "outputs": [], "source": [ "\n", "\n", "from jetset.poly_fit_tools import get_SED_pl_fit, get_SED_log_par_fit, get_nu_p_S_delta_approx, get_n_gamma_log_par_fit, get_nu_p_S_delta_approx" ] }, { "cell_type": "code", "execution_count": 4, "metadata": {}, "outputs": [], "source": [ "def n_distr_plot(j,ax,c=None,gmin=None):\n", " x=j.electron_distribution.gamma_e\n", " y=j.electron_distribution.n_gamma_e\n", " ax.plot(np.log10(x),np.log10(y*x*x*x),color=c)\n", " if gmin is not None:\n", " ymax=np.log10(y[0]*x[0]*x[0]*x[0])\n", " ymin=np.log10(y[-1]*x[-1]*x[-1]*x[-1])\n", " \n", " ax.vlines(np.log10(gmin),ymin=ymin,ymax=ymax,color=c)\n", " " ] }, { "cell_type": "raw", "metadata": {}, "source": [ "This section is based on the work presented in \n", "\n", "- Tramacere et al. (2009) [Tramacere2009]_\n", "\n", "- Massaro et al. (2006) [Massaro2006]_ \n", "\n", "- Jones (1968) [Jones1968]_\n", "\n", "- Blumenthal & Gould (1970) [BG1970]_ \n", "\n", "- Rybicki & Lightman (1986) [RL1986]_ " ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "" ] }, { "cell_type": "code", "execution_count": 5, "metadata": {}, "outputs": [], "source": [ "from jetset.plot_sedfit import PlotSED,PlotPdistr,PlotSpecComp\n", "from jetset.jet_model import Jet" ] }, { "cell_type": "code", "execution_count": 6, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "===> setting C threads to 12\n", "\n", "--------------------------------------------------------------------------------\n", "model description: \n", "--------------------------------------------------------------------------------\n", "type: Jet\n", "name: jet_leptonic \n", "geometry: spherical \n", "\n", "electrons distribution:\n", " type: lppl \n", " gamma energy grid size: 201\n", " gmin grid : 2.000000e+00\n", " gmax grid : 1.000000e+06\n", " normalization: True\n", " log-values: False\n", " ratio of cold protons to relativistic electrons: 1.000000e+00\n", "\n", "radiative fields:\n", " seed photons grid size: 100\n", " IC emission grid size: 100\n", " source emissivity lower bound : 1.000000e-120\n", " spectral components:\n", " name:Sum, state: on\n", " name:Sum, hidden: False\n", " name:Sync, state: self-abs\n", " name:Sync, hidden: False\n", " name:SSC, state: on\n", " name:SSC, hidden: False\n", "external fields transformation method: blob\n", "\n", "SED info:\n", " nu grid size jetkernel: 1000\n", " nu size: 500\n", " nu mix (Hz): 1.000000e+06\n", " nu max (Hz): 1.000000e+30\n", "\n", "flux plot lower bound : 1.000000e-30\n", "\n", "--------------------------------------------------------------------------------\n" ] }, { "data": { "text/html": [ "Table length=12\n", "
| model name | name | par type | units | val | phys. bound. min | phys. bound. max | log | frozen |
|---|---|---|---|---|---|---|---|---|
| jet_leptonic | R | region_size | cm | 5.000000e+15 | 1.000000e+03 | 1.000000e+30 | False | False |
| jet_leptonic | R_H | region_position | cm | 1.000000e+17 | 0.000000e+00 | -- | False | True |
| jet_leptonic | B | magnetic_field | gauss | 1.000000e-01 | 0.000000e+00 | -- | False | False |
| jet_leptonic | NH_cold_to_rel_e | cold_p_to_rel_e_ratio | 1.000000e+00 | 0.000000e+00 | -- | False | True | |
| jet_leptonic | beam_obj | beaming | 1.000000e+01 | 1.000000e-04 | -- | False | False | |
| jet_leptonic | z_cosm | redshift | 1.000000e-01 | 0.000000e+00 | -- | False | False | |
| jet_leptonic | gmin | low-energy-cut-off | lorentz-factor* | 2.000000e+00 | 1.000000e+00 | 1.000000e+09 | False | False |
| jet_leptonic | gmax | high-energy-cut-off | lorentz-factor* | 1.000000e+06 | 1.000000e+00 | 1.000000e+15 | False | False |
| jet_leptonic | N | emitters_density | 1 / cm3 | 1.000000e+02 | 0.000000e+00 | -- | False | False |
| jet_leptonic | gamma0_log_parab | turn-over-energy | lorentz-factor* | 1.000000e+04 | 1.000000e+00 | 1.000000e+09 | False | False |
| jet_leptonic | s | LE_spectral_slope | 2.000000e+00 | -1.000000e+01 | 1.000000e+01 | False | False | |
| jet_leptonic | r | spectral_curvature | 1.000000e+00 | -1.500000e+01 | 1.500000e+01 | False | False |