# type the following command in gnuplot, in the directory that contains the .gnu and .txt datafile, as below: # load "inversion.gnu" # use this setting for .eps, common choice for use in LaTeX set terminal postscript eps color enhanced font "Helvetica,16pt" size 8.6cm,6cm # use this for .png, everyday use easier to open #set terminal pngcairo enhanced font "Helvetica,24pt" size 1920,1080 # common formatting settings set samples 1000 set format y "%2.0f" #set format y "%2.0t{/Symbol \264}10^{%L}" set format x "%2.1f" set tics scale 1 set tics nomirror set xrange [0:2] set yrange [0:53000] set ytics 10000 unset xtics #set mytics 5 set border linewidth 2 set output 'obstruction.eps' set multiplot set origin 0,0.5 set size 1,0.5 set ylabel "Photoevents/sec" #top subplot # comparison countrates of Dark v Bright v Total over Position #set output 'countrates.eps' plot 'inversion.txt' using ($1*0.01-0.01):3:(sqrt($3)) w yerrorbars lc rgb "red" ps 0 lw 1 notitle 'Higher Order Modes', 'inversion.txt' using ($1*0.01-0.01):2:(sqrt($2)) w yerrorbars lc rgb "blue" ps 0 lw 1 notitle 'Common Mode', 'inversion.txt' using ($1*0.01-0.01):($2+$3):(sqrt($2+$3)) w yerrorbars lc rgb "black" ps 0 lw 1 notitle 'Total Modes' #, dark(x) w l lc rgb "red" lw 2, total(x) w l lc rgb "black" lw 2 #bottom subplot set origin 0.038,0 set size 0.962,0.59 set yrange [0:249] set xr [0:2] set xtics 0.5 nomirror set mxtics 5 set ytics 50 #set mytics 2 set xlabel "Obstruction Position (mm)" set ylabel "SNR" offset -2.0,0 # comparison signal-to-noise ratio in Dark vs Total deltas #set output 'snr.eps' plot 'inversion.txt' using ($1*0.01-0.01):(($3-1084)/(sqrt($3))) w l lc rgb "red" lw 2 notitle 'Inversion', 'inversion.txt' using ($1*0.01-0.01):((51432-($2+$3))/(sqrt($2+$3))) w l lc rgb "black" lw 2 notitle 'Direct' unset multiplot # comparison SNR gain in Dark over Total deltas set yrange [0:10] unset mytics set size 1,1 set ytics 1 set mytics 1 set format y "%2.0f" set ylabel "Gain in Signal-to-Noise Ratio" offset 0,0 reference(x)=1 set samples 10000 set output 'gain.eps' set xr [-0.25:50] #up to 100 for obstruction, 50 for asymmetry set xtics 10 set mxtics 2 set format x "%2.0f" set xlabel "Asymmetric Modes N_A/N_S (%)" plot 'inversion.txt' using (100*(51432-$2-$3)/51432):((sqrt($2+$3))/(sqrt($3)))*($3-1084)/(51432-($2+$3)) w points ps 1 lc rgb "red" lw 2 title 'Measured', 'model.txt' using 1:2 w l lc rgb 'black' lw 2 title 'Expected' #reference(x) dt 2 lc rgb "black" lw 2 title 'Direct' set xr [0:2] set xtics 0.5 set mxtics 5 set format x "%2.1f" set format y "%2.0f" set xlabel "Obstruction Position (mm)" set yrange [0:250] set ytics 50 set mytics 5 set ylabel "Shot Noise SqrtN" # comparison shot noise sqrtN in Dark vs Total deltas #set output 'sqrtn.eps' #plot 'inversion.txt' using ($1*0.01):(sqrt($3)) w l lc rgb "red" lw 2 title 'sqrtN Higher Order Modes', 'inversion.txt' using ($1*0.01):(sqrt($2+$3)) w l lc rgb "black" lw 2 title 'sqrtN Total' # estimate of SNR against obstruction by intensity set ylabel "Gain in Signal-to-Noise Ratio" set xlabel "Obstruction Percentage by Intensity" set xr [0:100] set format x "%2.0f" set xtics 10 set yr [0:4] set ytics 1 set mytics 2 #set output 'theoretical_inversion_obstruction_to_SNR.png' #plot 'theoretical_inversion_obstruction_to_SNR.txt' using 1:2 w l lc rgb 'red' lw 2 notitle # estimate of max SNR gain against interferometric visibility set format x "%2.2f" set xr [0.5:1.0] set xtics 0.05 set mxtics 5 set xlabel "Interferometric Visibility" set format y "%2.0f" set yr [0:10] set ytics 1 set mytics 2 set ylabel "Gain in Signal-to-Noise Ratio" #set output 'theoretical_inversion_visibility_to_SNR.png' #plot 'theoretical_inversion_visibility_to_SNR.txt' using 1:2 w l lc rgb 'red' lw 2 notitle set xlabel "Obstruction Position (mm)" set ylabel "Signal (change in photoevents/sec)" set yrange [0:57000] #set ytics 5000 #set xr [-1:0] # comparison Delta change in Dark vs Total for Signal set output 'delta.eps' #set title offset -10,-10 #plot 'inversion.txt' using ($1*0.01-0.01):($3-1084):(sqrt($3)) w yerrorbars lc rgb "red" ps 0 lw 1 title 'Higher Order Signal', 'inversion.txt' using ($1*0.01-0.01):(51432-($2+$3)):(sqrt($2+$3)) w yerrorbars lc rgb "black" ps 0 lw 1 title 'Total Signal' reset