4. SED model emulation with machine learningΒΆ
As an example, we show how the SED library of CLUMPY AGN dust torus emission model can be imported into BayeSED and then used in the Bayesian analysis of photometric measurements of NGC1068 from GALSEDATLAS.
Preparation of SED library:
wget -P models https://www.clumpy.org/downloads/clumpy_models_201410_tvavg.hdf5
./models/clumpy/convert_clumpy.py tor
Principal Component Analysis (PCA):
./bin/mac/sed2pca clumpy201410tor 1 0.1 1e-6
K-Nearest Neighbors (KNN) algorithm:
./bin/train_knn clumpy201410tor 1 1 1e-6 mac
./bin/train_knn clumpy201410tor_derived 1 0 1e-6 mac
time ./bin/mac/bayesed --sampling 1,0,0,200,0.8,0.1,1000,-1e90,1,1,0,0,-1e90,100000,0.01 -i 1,observation/hlsps/test.txt --filters observation/hlsps/filters.txt --filters_selected observation/hlsps/filters_selected_gal.txt --ssp 0,bc2003_lr_BaSeL_kroup,1,3,1,0,0,0,0,0 --sfh 0,2,0,0 --ext 0,7 -ak 1,clumpy201410tor,1,1,1,0,0 --sys_err_obs 0,1 --outdir galsedatlas0 --save_bestfit
Artificial Neural Network (ANN):
./bin/train_ann clumpy201410tor 1 1 1e-6 mac
./bin/train_ann clumpy201410tor_derived 1 0 1e-6 mac
time ./bin/mac/bayesed --sampling 1,0,0,200,0.8,0.1,1000,-1e90,1,1,0,0,-1e90,100000,0.01 -i 1,observation/hlsps/test.txt --filters observation/hlsps/filters.txt --filters_selected observation/hlsps/filters_selected_gal.txt --ssp 0,bc2003_lr_BaSeL_kroup,1,3,1,0,0,0,0,0 --sfh 0,2,0,0 --ext 0,7 -a 1,clumpy201410tor,1 --sys_err_obs 0,1 --outdir galsedatlas0 --save_bestfit
Plot of best-fit results
gnuplot observation/hlsps/plot_bestfit_NGC1068.gpi
um='{/Symbol m}m'
lam='{/Symbol l}'
uJy='{/Symbol m}Jy'
set log xy 10
set xlabel lam.'_{rest}/'.um
set ylabel 'Flux/'.uJy
set key top left
set term postscript enhanced color eps lw 3 dl 2
#use ANN emulation of clumpy201410tor
set output 'NGC1068_ANN.eps'
plot [][1000:] 'galsedatlas0/galsedatlas/NGC1068/1clumpy201410tor_10csp200_bc2003_lr_BaSeL_kroup000_hyperz5_bestfit.txt' index 0 u 4:9:10 w ye t 'obs','' index 2 u 1:3 w l t 'stellar emission','' index 1 u 1:3 w l t 'AGN dust torus emission','' index 3 u 1:3 w l t 'Best-fit'
#use KNN emulation of clumpy201410tor
set output 'NGC1068_KNN.eps'
plot [][1000:] 'galsedatlas0/galsedatlas/NGC1068/6clumpy201410tor_10csp200_bc2003_lr_BaSeL_kroup000_hyperz5_bestfit.txt' index 0 u 4:9:10 w ye t 'obs','' index 2 u 1:3 w l t 'stellar emission','' index 1 u 1:3 w l t 'AGN dust torus emission','' index 3 u 1:3 w l t 'Best-fit'