Running Bjet manually (bjet_core)

bjet_core contains an updated version of the multi-zone Bjet code developed in Hervet et al. (2015). This is the physical core of Bjet_MCMC and can be run in standalone mode outside the MCMC frame.

run_Bjet_manual.py

If you want to run Bjet manually in its variant forms (pure SSC, SSC+EIC, multi-zone SSC+EIC), it is advised to use the Python script run_Bjet_manual.py. This script launches bjet_core with a given parameter file and plots the resulting SED (data + model). Users can freely edit this script for their needs. This is especially useful for quick fit-by-eye processes, or to visualize the impact of parameters on the SED.

You can adapt lines 40-60 with your chosen setup and inputs. You will need to call a parameter file, following the format of the example given in parameter_files/J1010.par. The SED data file format is the same as for the general use of BJet_MCMC, with an example given in real_data/J1010_SED_reduced.dat

Parameter file

Example of parameter_files/J1010.par:

------------------------------------------------------------------------------
Transformation_parameters
------------------------------------------------------------------------------
0.143          redshift
69.6           Hubble_constant______________________________________[km/(sMpc)]
0.57           angle_to_the_line_of_sight___________________________[degrees]
------------------------------------------------------------------------------
Blob_parameters
------------------------------------------------------------------------------
8.38e+01        Doppler_factor
4.24e+03        Particle_density_____________________________________[1/cm^3]
2.56            First_slope_of_particle_energy_spectrum
3.75            Second_slope_of_particle_energy_spectrum
9.22            Minimum_electrons_energy
1.99e+06        Maximum_electrons_energy
2.13e+05        Break_in_electrons_energy_spectrum
1.71e-03        Magnetic_field_______________________________________[G]
1.40e+17        Radius_of_emitting_region____________________________[cm]
0              length_of_emitting_region_(0_for_spherical_geometry)_[cm]
1              absorption_by_EBL_(0=NO___1=YES)
9.0e+17        distance_blob_SMBH_(host_galaxy_frame)_______________[cm]
------------------------------------------------------------------------------
Extern_Inverse_Compton_parameter
------------------------------------------------------------------------------
0              compute_EIC_(0=NO___1=YES)
0              compute_X_corona_(0=NO___1=YES)
4.0e+4         Disk_black_body_temperature__________________________[K]
2.0e+4         Torus_black_body_temperature_________________________[K]
3.0e+43        Luminosity_of_the_disk_______________________________[erg/s]
9.0e-5         Tau___fraction_of_L_disk_reprocessed_isotropically
5.5e+20        Luminosity_of_the_torus______________________________[erg/s]
9.0e-5         Tau___fraction_of_L_tor_reprocessed_isotropically
------------------------------------------------------------------------------
Jet_parameters
------------------------------------------------------------------------------
0              compute_JET_(0=NO___1=YES)
3.0            Doppler_factor
1.0e+2         Initial_particle_density_____________________________[1/cm^3]
2.1            Slope_of_particle_energy_spectrum
1.0e+3         Minimum_electrons_energy
2.0e+4         Maximum_electrons_energy
0.08           Initial_magnetic_field_______________________________[G]
1.2e+17        Inner_radius_(host_galaxy_frame)_____________________[cm]
300            Jet_length_(host_galaxy_frame)_______________________[pc]
1.0            Half-opening_angle_of_jet_(host_galaxy_frame)________[deg]
50             number_of_slices
------------------------------------------------------------------------------
Numerical_parameters
------------------------------------------------------------------------------
99             number_of_spectral_points
50000000.0        minimal_frequency____________________________________[Hz]
1e+29        maximal_frequency____________________________________[Hz]
test_bj        prefix_of_file_names

Some instructions for using a parameter file:

  • Do not remove/add lines, do not change the order of parameters, this will crash the code.

  • You can activate/deactivate thermal EIC with the option compute_EIC_(0=NO___1=YES) and the extended SSC jet with compute_JET_(0=NO___1=YES).

  • The torus and X-ray corona parameters are unsafe to use.

  • I suggest not editing the Numerical_parameters, but you can increase the number of spectral points up to 200 if you want a smoother SED model (it will also take more time to compute).

Manual installation of bjet_core

The following parts are for more advanced users who want to use the C++ code bjet_core directly.

The code is in the bjet_core folder. The necessary files are bj_core.cpp, bj_core.h, processes_supp_core.cpp, and processes_supp_core.h.

Compile the executable with

$ make bj_core

Usage

Options for calling the executable:

  • Usage 1: bj_core --help

  • Usage 2: bj_core <parameter file>

  • Usage 3: bj_core 0 <parameter file> same execution as usage 2, _prev files made

  • Usage 4: bj_core 1 <parameter file> no _prev files made

  • Usage 5: bj_core 2 <data folder> <parameter file> _prev files made

  • Usage 6: bj_core 3 <data folder> <parameter file> no _prev files made

  • Usage 7: bj_core 0/1 <model type> <list of parameters>, 0 = yes _prev files, 1 = no

  • Usage 8: bj_core 2/3 <data folder> <model type> <list of parameters>, 2 = yes _prev files, 3 = no

Parameter files

Parameter files specified in the command line should be paths relative to the bj_core executable. See params.txt in bjet_core for an example parameter file.

Modes:

A _prev` file is a file with the previous model SED. When this option is activated, the model will not erase the SED from the former execution of the code. This is especially useful when doing “fit-by-eye”> to see the effects of a change in the model parameters on the same SED plot. - 0: _prev files are made, save in default data folder - 1: no _prev files are made, save in default data folder - 2: _prev files are made, save in specified data folder - 3: no _prev files are made, save in specified data folder

(The default data directory is in the same directory as the executable, named “data”)

Valid values for model type:

  • 0: model with just blob

  • 1: blob + EIC parameters

  • Other models not yet implemented. The full multi-zone model can be used only with a parameter file.

Order of parameters in command line:

  • Model type 0:

$ bj_core <0, 1, 2, 3> <data folder if applicable> 0 (model type) z, H_0, THETA, DOP_B, K1, N1, N2, GAMMA_MIN, GAMMA_MAX, GAMMA_BRK, B, R_src, L_src, IIR_level, D_b, NU_DIM, NU_STR, NU_END, prefix

argc should be 22 or 23 depending on if data folder is listed

  • Model type 1 [*]:

$ bj_core <0, 1, 2, 3> <data folder if applicable> 1 (model type) z, H_0, THETA, DOP_B, K1, N1, N2, GAMMA_MIN, GAMMA_MAX, GAMMA_BRK, B, R_src, L_src, IIR_level, D_b, T_BB, TBB_tor, L_nuc, tau, L_tor, tau, NU_DIM, NU_STR, NU_END, prefix

argc should be 28 or 29 depending on if data folder is listed

  • Example:

$ ./bj_core 3 /Users/sed_calculations 1 0.34 69.6 0.57 50.0 612.1 2.28 3.74 2816.9 1803000 44806 0.00236 5.94e+17 0 1 3.8e+15 2013 2.0e+4 1.7e+21 1.5e-10 5.5e+20 9.0e-5 99 50000000.0 1e+29 run

The 3 indicates that the data folder is specified and no prev file is made. 1 is the EIC model type. Then 0.34 is z (redshift) and the rest of the parameters are enumerated.