diff options
Diffstat (limited to 'xmds2/Nlevels_no_dopler_with_z_4wm')
-rw-r--r-- | xmds2/Nlevels_no_dopler_with_z_4wm/map2dat.m | 33 | ||||
-rw-r--r-- | xmds2/Nlevels_no_dopler_with_z_4wm/plot_fields_propagation_I2.gp | 15 | ||||
-rw-r--r-- | xmds2/Nlevels_no_dopler_with_z_4wm/pp_I2.m | 7 | ||||
l---------[-rw-r--r--] | xmds2/Nlevels_no_dopler_with_z_4wm/slow_light/map2dat.m | 34 | ||||
l---------[-rw-r--r--] | xmds2/Nlevels_no_dopler_with_z_4wm/slow_light/plot_fields_propagation_I2.gp | 16 | ||||
l---------[-rw-r--r--] | xmds2/Nlevels_no_dopler_with_z_4wm/slow_light/pp_I2.m | 68 |
6 files changed, 58 insertions, 115 deletions
diff --git a/xmds2/Nlevels_no_dopler_with_z_4wm/map2dat.m b/xmds2/Nlevels_no_dopler_with_z_4wm/map2dat.m new file mode 100644 index 0000000..969b6dc --- /dev/null +++ b/xmds2/Nlevels_no_dopler_with_z_4wm/map2dat.m @@ -0,0 +1,33 @@ +function map2dat(outfile, x,y,z, xskip, yskip) +% saves 3D data in suitable way to be drawn by gnuplot +% x,y - vectors of x,y values +% z map of z values as used by Octave/Matlab +% xskip, yskip - skip paprameters +% only every, xskip, yskip point will be written + + + +Nx=length(x); +Ny=length(y); +Nxs=Nx/xskip; +Nys=Ny/yskip; +points=zeros(1,3*Nxs*Nys); +%points=[]; +tic; +for i=1:Nxs + for k=1:Nys + %points=[points x(i*xskip) y(k*yskip) z(k*yskip,i*xskip)]; + points((i-1)*(Nys-1)*3+3*(k-1)+1) = x(i*xskip); + points((i-1)*(Nys-1)*3+3*(k-1)+2) = y(k*yskip); + points((i-1)*(Nys-1)*3+3*(k-1)+3) = z(k*yskip,i*xskip); + end +end +disp('=== points formation complete ==='); +toc +tic; +%points +fd = fopen(outfile, "wt"); +fprintf (fd, "%g %g %g\n", points); +fclose(fd); +disp('=== points saving complete ==='); +toc; diff --git a/xmds2/Nlevels_no_dopler_with_z_4wm/plot_fields_propagation_I2.gp b/xmds2/Nlevels_no_dopler_with_z_4wm/plot_fields_propagation_I2.gp new file mode 100644 index 0000000..b6721d4 --- /dev/null +++ b/xmds2/Nlevels_no_dopler_with_z_4wm/plot_fields_propagation_I2.gp @@ -0,0 +1,15 @@ +set terminal postscript portrait enhanced color solid size 5,3.5 +set output 'fields_propagation_I2.eps' +set dgrid3d 100,100 qnorm 4 +set pm3d map +#set contour +set hidden3d +set palette rgb 10,13,31 negative + + +set xlabel "z (cm)" +set ylabel "t ({/Symbol m}S)" +set zlabel "I_2 (1/S)" +set nokey +#set view map +splot [0:1.5][-0.4:0.4] 'I2.dat' diff --git a/xmds2/Nlevels_no_dopler_with_z_4wm/pp_I2.m b/xmds2/Nlevels_no_dopler_with_z_4wm/pp_I2.m index 4f5d677..73487e0 100644 --- a/xmds2/Nlevels_no_dopler_with_z_4wm/pp_I2.m +++ b/xmds2/Nlevels_no_dopler_with_z_4wm/pp_I2.m @@ -11,6 +11,12 @@ ylabel('t (uS)') zlabel('I_2') title('I_2') +xskip=1; +yskip=10; +map2dat('I2.dat',z_1,t_1, I2_out_1, xskip, yskip); + + + print('-color','fields_propagation_I2.eps') @@ -25,6 +31,7 @@ plot( ... xlabel('t (uS)') ylabel('I_2 (1/s)^2') title('I_2 before and after cell') +legend('location', 'southwest'); [b, a]=butter(3, 0.05); I2_out_after=I2_out_1(:,end); diff --git a/xmds2/Nlevels_no_dopler_with_z_4wm/slow_light/map2dat.m b/xmds2/Nlevels_no_dopler_with_z_4wm/slow_light/map2dat.m index 969b6dc..14fae30 100644..120000 --- a/xmds2/Nlevels_no_dopler_with_z_4wm/slow_light/map2dat.m +++ b/xmds2/Nlevels_no_dopler_with_z_4wm/slow_light/map2dat.m @@ -1,33 +1 @@ -function map2dat(outfile, x,y,z, xskip, yskip) -% saves 3D data in suitable way to be drawn by gnuplot -% x,y - vectors of x,y values -% z map of z values as used by Octave/Matlab -% xskip, yskip - skip paprameters -% only every, xskip, yskip point will be written - - - -Nx=length(x); -Ny=length(y); -Nxs=Nx/xskip; -Nys=Ny/yskip; -points=zeros(1,3*Nxs*Nys); -%points=[]; -tic; -for i=1:Nxs - for k=1:Nys - %points=[points x(i*xskip) y(k*yskip) z(k*yskip,i*xskip)]; - points((i-1)*(Nys-1)*3+3*(k-1)+1) = x(i*xskip); - points((i-1)*(Nys-1)*3+3*(k-1)+2) = y(k*yskip); - points((i-1)*(Nys-1)*3+3*(k-1)+3) = z(k*yskip,i*xskip); - end -end -disp('=== points formation complete ==='); -toc -tic; -%points -fd = fopen(outfile, "wt"); -fprintf (fd, "%g %g %g\n", points); -fclose(fd); -disp('=== points saving complete ==='); -toc; +../map2dat.m
\ No newline at end of file diff --git a/xmds2/Nlevels_no_dopler_with_z_4wm/slow_light/plot_fields_propagation_I2.gp b/xmds2/Nlevels_no_dopler_with_z_4wm/slow_light/plot_fields_propagation_I2.gp index b6721d4..e11c569 100644..120000 --- a/xmds2/Nlevels_no_dopler_with_z_4wm/slow_light/plot_fields_propagation_I2.gp +++ b/xmds2/Nlevels_no_dopler_with_z_4wm/slow_light/plot_fields_propagation_I2.gp @@ -1,15 +1 @@ -set terminal postscript portrait enhanced color solid size 5,3.5 -set output 'fields_propagation_I2.eps' -set dgrid3d 100,100 qnorm 4 -set pm3d map -#set contour -set hidden3d -set palette rgb 10,13,31 negative - - -set xlabel "z (cm)" -set ylabel "t ({/Symbol m}S)" -set zlabel "I_2 (1/S)" -set nokey -#set view map -splot [0:1.5][-0.4:0.4] 'I2.dat' +../plot_fields_propagation_I2.gp
\ No newline at end of file diff --git a/xmds2/Nlevels_no_dopler_with_z_4wm/slow_light/pp_I2.m b/xmds2/Nlevels_no_dopler_with_z_4wm/slow_light/pp_I2.m index 73487e0..4a1ed9b 100644..120000 --- a/xmds2/Nlevels_no_dopler_with_z_4wm/slow_light/pp_I2.m +++ b/xmds2/Nlevels_no_dopler_with_z_4wm/slow_light/pp_I2.m @@ -1,67 +1 @@ -Nlevels_no_dopler_with_z_4wm - -%% field propagation -z_1=z_1*100; % z in cm -t_1=t_1*1e6; % time now measured in uS -figure(1) -set(gca,'fontsize',20); -imagesc(z_1, t_1, I2_out_1); colorbar -xlabel('z (cm)') -ylabel('t (uS)') -zlabel('I_2') -title('I_2') - -xskip=1; -yskip=10; -map2dat('I2.dat',z_1,t_1, I2_out_1, xskip, yskip); - - - -print('-color','fields_propagation_I2.eps') - - - -%% fields before and after the cell -figure(2) -%set(gca,'fontsize',30); -plot( ... - t_1,I2_out_1(:,1),'.-;before;', "linewidth", 4, ... - t_1,I2_out_1(:,end), '-;after;', "linewidth", 4 ... - ) -xlabel('t (uS)') -ylabel('I_2 (1/s)^2') -title('I_2 before and after cell') -legend('location', 'southwest'); - -[b, a]=butter(3, 0.05); -I2_out_after=I2_out_1(:,end); -I2_out_after_filtered=filtfilt(b,a,I2_out_after); -settling_time=0.8; %uS -t_good_indx=t_1> min(t_1 + settling_time); -[m,max_pos_before]=max(I2_out_1(t_good_indx,1) ); [m,max_pos_after]=max(I2_out_after_filtered(t_good_indx)); -delay_time=t_1(max_pos_after)-t_1(max_pos_before); -printf('Second field delay time = %f uS\n',delay_time); - -%set(gca,'fontsize',40); -set (gcf,'paperposition',[0.5 0 2.5,1.5]); % IMPORTANT to shrink eps size for readable fonts -print('-color','fields_before_after_cell_I2.eps') - -figure(4) -I2_max_in=max(I2_out_1(t_good_indx,1)); -I2_max_out=max(I2_out_1(t_good_indx,end)); -I2_in_norm=(I2_out_1(:,1))/I2_max_in; -I2_out_norm=(I2_out_1(:,end))/I2_max_out; -tmin=-0.05; -tmax=0.05; -indx=(t_1>=tmin & t_1<=tmax); % soom in in time to this region -plot( ... - t_1(indx),I2_in_norm(indx),'.-;before;', "linewidth", 4, ... - t_1(indx),I2_out_norm(indx), '-;after;', "linewidth", 4 ... - ) -xlim([tmin,tmax],'manual'); -xlabel('t (uS)') -ylabel('I_2') -title('I_2 before and after cell normalized') -set (gcf,'paperposition',[0.5 0 2.5,1.5]); % IMPORTANT to shrink eps size for readable fonts -print('-color','probe_before_after_cell_I2_normalized.eps') - +../pp_I2.m
\ No newline at end of file |