#!/bin/bash # #%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% # # Plots 2*2-panels for systems with 2 planets # # INPUT: - sp0#.dat [BLS spectrum of the #-th component] # - tr#.lc [decomposed, folded LC/fit of the #-th component] # - tr#_fit.lc [best-fitting trapezoidal] # - multi_par.dat [parameters of the component candidates] # - ts_4.dat [needed ONLY for the target name] # # # OUTPUT: - mult_plot.png # # DATE: - 2020.05.26 # # NOTES: - run like: gnuplot mult_2.sh # - INPUT files are the outputs of "tran_k2" # - PLOT arangement: BLS #1 LC #1 # BLS #2 LC #2 # ... ... # #%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% # #............... Get target name ! grep "TARGET" ts_4.dat > a.dat ! awk '{print $3}' a.dat > sname.txt target=system('head -n 1 sname.txt') # #................. Set BLS plot parameters # fmin=-0.03 fmax=1.53 bls_min=-0.04 bls_max=1.09 # #................. Set LC plot parameters # ppt=1000.0 ph_min=-0.105 ph_max=0.105 yf1_1=0.30 yf2_1=0.10 yf1_2=0.40 yf2_2=0.20 # #................. Set panel positions # x0=0.13 y0=0.16 dx=0.05 dy=0.02 xr=0.40 yr=0.40 # #................. BLS, LC ranges # stats "sp00.dat" using 2 noout fx1=1.0/STATS_max stats "sp01.dat" using 2 noout fx2=1.0/STATS_max stats "tr1.lc" using (ppt*$2) noout ymin1=STATS_min ymax1=STATS_max yr1=ymax1-ymin1 ymin1=ymin1-yr1*yf2_1 ymax1=ymax1+yr1*yf1_1 stats "tr2.lc" using (ppt*$2) noout ymin2=STATS_min ymax2=STATS_max yr2=ymax2-ymin2 ymin2=ymin2-yr2*yf2_2 ymax2=ymax2+yr2*yf1_2 # #.................. Initialize plot # set term png size 800,450 crop enhanced set output 'mult_plot.png' set multiplot layout 2,2 # #%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 1ST PLANET # unset key set border lc rgb "black" set border linewidth 1.3 # set bmargin at screen y0+yr+dy set tmargin at screen y0+2*yr+dy set lmargin at screen x0 set rmargin at screen x0+xr # set xrange [fmin:fmax] set yrange [bls_min:bls_max] # set object 1 rect from graph 0,0 rto 1,1 fc rgb "black" fs solid 0.07 behind lw 0 set label 1 target font "Helvetica-Bold, 20" at graph 0.55,0.85 front tc rgb "#1E90FF" # set ytics -1.5,0.5,1.50 font "Helvetica, 15" set ytics format '%3.1f' offset 0.8,0,0 set mytics 5 set xtics format "" # plot 'sp00.dat' using 1:(fx1*$2) with lines lw 1.5 lt -1 lc rgb "black" # unset label set lmargin at screen x0+xr+dx set rmargin at screen x0+2*xr+dx # set xrange [ph_min:ph_max] set yrange [ymin1:ymax1] set ytics -20.0,0.5,20.0 font "Helvetica, 15" set ytics format '%2.1f' offset 1.0,0,0 set mytics 5 set xtics format "" # set label 2 "pc01" font "Helvetica-Bold, 20" at graph 0.78,0.85 front tc rgb "brown" # plot 'tr1.lc' using 1:(ppt*$2) with points pt 7 ps 1 lc rgb "#696969",\ 'tr1_fit.lc' using 1:(ppt*$2) with lines lw 4 lt -1 lc rgb "black" # # #%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 2ND PLANET # unset key unset label set border lc rgb "black" set border linewidth 1.3 # set bmargin at screen y0 set tmargin at screen y0+yr set lmargin at screen x0 set rmargin at screen x0+xr # set xrange [fmin:fmax] set yrange [bls_min:bls_max] # set object 1 rect from graph 0,0 rto 1,1 fc rgb "black" fs solid 0.07 behind lw 0 set label 11 "Frequency [c/d]" font "Helvetica-Bold, 20" at graph 0.18,-0.24 front tc rgb "black" # set xtics -2.0,0.5,60.0 font "Helvetica, 15" set xtics format '%3.1f' offset 0,0.2,0 set mxtics 5 set ytics -1.5,0.5,1.50 font "Helvetica, 15" set ytics format '%3.1f' offset 0.8,0,0 set mytics 5 # plot 'sp01.dat' using 1:(fx2*$2) with lines lw 1.5 lt -1 lc rgb "black" # unset label set lmargin at screen x0+xr+dx set rmargin at screen x0+2*xr+dx # set xrange [ph_min:ph_max] set yrange [ymin2:ymax2] set xtics -1.0,0.05,1.0 font "Helvetica, 15" set xtics format '%3.2f' offset 0,0.2,0 set mxtics 5 set ytics -20.0,0.2,20.0 font "Helvetica, 15" set ytics format '%2.1f' offset 1.0,0,0 set mytics 2 # if(ymax2-ymin2 > 1.5) { set ytics -20.0,0.5,20.0 font "Helvetica, 15" } if(ymax2-ymin2 > 1.5) { set ytics format '%2.1f' offset 1.0,0,0 } if(ymax2-ymin2 > 1.5) { set mytics 5 } # if(ymax2-ymin2 > 3.0) { set ytics -20.0,1.0,20.0 font "Helvetica, 15" } if(ymax2-ymin2 > 3.0) { set ytics format '%2.0f' offset 1.0,0,0 } if(ymax2-ymin2 > 3.0) { set mytics 5 } # set label 2 "pc02" font "Helvetica-Bold, 20" at graph 0.78,0.85 front tc rgb "brown" set label 12 "Phase" font "Helvetica-Bold, 20" at graph 0.38,-0.24 front tc rgb "black" # plot 'tr2.lc' using 1:(ppt*$2) with points pt 7 ps 1 lc rgb "#696969",\ 'tr2_fit.lc' using 1:(ppt*$2) with lines lw 4 lt -1 lc rgb "black" # exit #