# 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 format y "%2.0f" #set format y "%2.0t{/Symbol \264}10^{%L}" set format x "%2.1f" set tics scale 2 set tics nomirror set xrange [0:2] set xtics 0.2 set mxtics 5 set yrange [0:57000] set ytics 5000 set mytics 5 set border linewidth 2 set xlabel "Obstruction Position (mm)" set ylabel "Photoevents/sec" dark(x)=55000 total(x)=693000 # 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" lw 1 title 'Higher Order Modes', 'inversion.txt' using ($1*0.01-0.01):2:(sqrt($2)) w yerrorbars lc rgb "blue" lw 1 title 'Common Mode', 'inversion.txt' using ($1*0.01-0.01):($2+$3):(sqrt($2+$3)) w yerrorbars lc rgb "black" lw 1 title 'Total' #, dark(x) w l lc rgb "red" lw 2, total(x) w l lc rgb "black" lw 2 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" 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" lw 1 title 'Total Signal' set yrange [0:200] set xr [0:2] set ytics 25 set mytics 5 set ylabel "Signal-to-Noise Ratio (SNR)" # 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 title 'Higher Order SNR', 'inversion.txt' using ($1*0.01-0.01):((51432-($2+$3))/(sqrt($2+$3))) w l lc rgb "black" lw 2 title 'Total SNR' # comparison SNR gain in Dark over Total deltas set yrange [0:10] unset mytics set ytics 1 set mytics 1 set format y "%2.0f" set ylabel "Gain in Signal-to-Noise Ratio" reference(x)=1 set output 'gain.eps' set xr [0:100] set xtics 10 set mxtics 5 set format x "%2.0f" set xlabel "Obstruction by Intensity (%)" plot 'inversion.txt' using (100*(51432-$2-$3)/51432):((sqrt($2+$3))/(sqrt($3)))*($3-1084)/(51432-($2+$3)) w points ps 3 lc rgb "red" lw 2 title 'With Inversion', reference(x) dt 2 lc rgb "black" lw 2 title 'Without Inversion', 'model.txt' using 1:2 w l lc rgb 'black' lw 2 title 'Model' 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.png' #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 reset