#!/usr/bin/gnuplot infile1 = 'tmp' #set terminal postscript eps color enhanced solid font "Helvetica,26" size 16cm,10cm #set term pdf #set output "sat_spectrum_20us.pdf" attenuation = 0.0073 #0.012 fibercoupling = 0.65 apdeff = 0.52 opticalpath = 0.9 col_attn = 1.0 #0.726 bg_red = 400*20e-6 # bg per atom bin bg_blue = 180*20e-6 # bg per atom bin gamma = 1/26.24e-9 h = 6.626e-34 c = 3e8 lambda = 780.24e-9 eff_correction = 1/(fibercoupling*attenuation*opticalpath) a=0 refl=0.008 gamma0 = 6.8 x0 = 46 lorentz(x) = refl * gamma0**2 * 1 / ( 4*(x0-x)**2 + (gamma0)**2 ) f(x) = 0.006 * 7**2 * 1 / ( 4*(x0-x)**2 + (7)**2 ) fit [20:55] lorentz(x) infile1 u (($1-190000)/1000*2):(($3-bg_blue*$8)/($5*eff_correction)*100):(sqrt ( (sqrt($3)/($5*eff_correction) )**2 + (sqrt($5)*$3/($5**2*eff_correction))**2 )*100) via refl,x0,gamma0 set title "reflection of a faint coherent field 2us pulse, 05 July 2016 " set xlabel "detuning from bare atomic resonance (MHz)" set ylabel 'reflectivity (%)' set key right bottom set pointsize 1.0 set label 1 sprintf("peak refl = %.3g %\n", refl) at graph 0.05,0.7 set label 2 sprintf("Gamma = %.3g MHz\n", gamma0) at graph 0.05,0.65 set label 3 sprintf("tx = %.3g %\n", sqrt(refl/100*4)*100) at graph 0.05,0.6 plot infile1 u (($1-190000)/1000*2):(($3-bg_blue*$8)/($5*eff_correction)*100):(sqrt ( (sqrt($3)/($5*eff_correction) )**2 + (sqrt($5)*$3/($5**2*eff_correction))**2 )*100) w yerr ps 0.8 pt 7 lw 2 not , lorentz(x) lc 1 lw 2 not unset output pause -1