diff options
-rw-r--r-- | faraday/output_psr_results_vs_detuning.m | 59 | ||||
-rw-r--r-- | faraday/output_psr_results_vs_power.m | 70 | ||||
-rw-r--r-- | faraday/task_builder.m | 42 |
3 files changed, 42 insertions, 129 deletions
diff --git a/faraday/output_psr_results_vs_detuning.m b/faraday/output_psr_results_vs_detuning.m deleted file mode 100644 index 93912ae..0000000 --- a/faraday/output_psr_results_vs_detuning.m +++ /dev/null @@ -1,59 +0,0 @@ -function psr_rad=output_psr_results_vs_detuning() -load '/tmp/xi_vs_detuning.mat' ; - -Er=(1+I*xi_right)*E_field_pos_freq.right; -El=(1+I*xi_left) *E_field_pos_freq.left; - -Ex=(Er+El)/sqrt(2); -Ey=I*(Er-El)/sqrt(2); - -%extra rotation to compensate rotation due to ellipticity -% actually no need for it since x-polarization shifts by positive phase -% and y-pol by negative phase -%el_rot=0*psi_el; -%Ex=cos(el_rot)*Ex-sin(el_rot)*Ey; -%Ey=sin(el_rot)*Ex+cos(el_rot)*Ey; - -Ipos=(abs(Ey).^2)/2; -Ineg=(abs(Ex).^2)/2; - -figure(1); -hold off; -plot(detuning_freq, real(xi_left-xi_right), '-'); -title("differential real xi"); -xlabel("two photon detuning (MHz)"); - -figure(2); -hold off; -plot(detuning_freq, imag(xi_left-xi_right), '-'); -title("differential imag xi"); -xlabel("two photon detuning (MHz)"); - -figure(3); -hold off; -plot(detuning_freq, real(xi_left), '-', detuning_freq, real(xi_right), '-'); -title("real xi"); -xlabel("two photon detuning (MHz)"); - -figure(4); -hold off; -plot(detuning_freq, imag(xi_left), '-', detuning_freq, imag(xi_right), '-'); -title("imag xi"); -xlabel("two photon detuning (MHz)"); - -figure(5); -hold off; -I_probe=E_field_probe^2; -psr_rad=(Ipos-Ineg)/(2*I_probe); -plot(detuning_freq, psr_rad, '-'); -subt_str=sprintf("Laser Rabi freq normalized to upper state decay %.3f, ellipticity %.1f degree, \n B field ground level splitting %.3f Gauss", I_probe, psi_el*180/pi, B_field); -title(cstrcat("BPD normilized PSR signal at F_g=2 to F_e=1,2.\n ",subt_str) ); -xlabel("two photon detuning (MHz)"); -ylabel("PSR (radians)"); - -print("psr_vs_detuning.ps"); - -fname= sprintf("psr_vs_detuning_Fg=2toFe=1,2_Ip=%.3f_el_%.1f_B=%.3fG.mat", I_probe, psi_el*180/pi,B_field); -save(fname,'detuning_freq', 'psr_rad'); - -return; diff --git a/faraday/output_psr_results_vs_power.m b/faraday/output_psr_results_vs_power.m deleted file mode 100644 index 2d28565..0000000 --- a/faraday/output_psr_results_vs_power.m +++ /dev/null @@ -1,70 +0,0 @@ -1; - - -load '/tmp/xi_vs_power.mat' ; - -Er=(1+I*xi_right)*E_field_pos_freq.right; -El=(1+I*xi_left) *E_field_pos_freq.left; - -Ex=(Er+El)/sqrt(2); -Ey=I*(Er-El)/sqrt(2); - -%extra rotation to compensate rotation due to ellipticity -% actually no need for it since x-polarization shifts by positive phase -% and y-pol by negative phase -%el_rot=0*psi_el; -%Ex=cos(el_rot)*Ex-sin(el_rot)*Ey; -%Ey=sin(el_rot)*Ex+cos(el_rot)*Ey; - -Ipos=(abs(Ey).^2)/2; -Ineg=(abs(Ex).^2)/2; - -figure(1); -hold off; -plot(Ep.^2, real(xi_left-xi_right), '-'); -title("differential real xi"); -xlabel("two photon detuning"); - -figure(2); -hold off; -plot(Ep.^2, imag(xi_left-xi_right), '-'); -title("differential imag xi"); -xlabel("two photon detuning"); - -figure(3); -hold off; -plot(Ep.^2, imag(xi_left), '-', Ep, imag(xi_right), '-'); -title("imag xi"); -xlabel("two photon detuning"); - -figure(4); -hold off; -plot(Ep.^2, real(xi_left), '-', Ep.^2, real(xi_right), '-'); -title("real xi"); -xlabel("two photon detuning"); - -figure(5); -hold off; -%plot(Ep.^2, (Ipos-Ineg), '-'); -semilogx(Ep.^2, (Ipos-Ineg), '-'); -%semilogx(Ep.^2, (Ipos-Ineg)./(Ep.^2), '-'); -title("BPD signal xi"); -xlabel("two photon detuning"); - -%figure(1); - %hold off; - %plot(detuning_freq, imag(xi_linear), '-1;linear;'); - %hold on; - %plot(detuning_freq, imag(xi_left), '-2;left;'); - %plot(detuning_freq, imag(xi_right), '-3;right;'); - %title("probe absorption"); - %hold off; -%figure(2); - %hold off; - %plot(detuning_freq, real(xi_linear), '-1;linear;'); - %hold on; - %plot(detuning_freq, real(xi_left), '-2;left;'); - %plot(detuning_freq, real(xi_right), '-3;right;'); - %title("probe dispersion"); - %hold off; - diff --git a/faraday/task_builder.m b/faraday/task_builder.m new file mode 100644 index 0000000..46dcd64 --- /dev/null +++ b/faraday/task_builder.m @@ -0,0 +1,42 @@ +task_dir='tasks/'; +task_base_name='task_'; +task_ext='.mat'; +data_dir='results/'; +output_dir='results/'; +detuning_freq=0; + + +% assign some defaults +gmg=.7; % gyro magnetic ration for ground level + +%[psr_rad]=psr_vs_detuning(Ep, psi_el, B_field, theta, phi) + +% phi is angle between linear polarization and axis x +%phi=pi/4; +phi=pi/2; +% theta is angle between lab z axis (light propagation direction) and magnetic field axis (z') +theta=0; +% psi_el is the ellipticity parameter (phase difference between left and right polarization) +psi_el=-30/180*pi*e-8; + +Ep=sqrt(0.1); + +% we are going to sweep B so parts related to sweep paramer(s) +zeeman_splitting=+0.1; +Nsteps=100; +B_fields=linspace(-zeeman_splitting/gmg, zeeman_splitting/gmg, Nsteps); + +for i=1:Nsteps + filename_task=strcat(task_dir, task_base_name); + i_str=num2str(i, "%04d"); + filename_task=strcat(filename_task,i_str, task_ext); + B_field = B_fields(i); + save(filename_task, 'detuning_freq', 'Ep', 'psi_el', 'B_field', 'theta', 'phi'); +endfor +return; + + +%[psr_rad_smEp_pos_el]=psr_vs_detuning(detuning_freq, Ep, psi_el, B_field, theta, phi) ; +[psr_rad_smEp_pos_el]=faraday_vs_B(detuning_freq, Ep, psi_el, B_fields, theta, phi) ; + +plot(B_fields, psr_rad_smEp_pos_el) |