function [X Y wX wY]=weekendbeamtime(basename,guess,N) %fits 1D gaussian curve to N images in sequence of basename basefile thisfile=mfilename('fullpath'); thisdir=strrep(thisfile,mfilename(),''); i=0; X=[]; Y=[]; wX=[]; wY=[]; while i9 I = ['00' int2str(i)]; end if i>99 I = ['0' int2str(i)]; end if i>999 I = [int2str(i)]; end basefile=[basename I] [x y wx wy]=autogaussfit1(basefile,guess,['Image Number ' I]); close all wx=[500*i wx]; wy=[500*i wy]; X=cat(1,X,[500*i x]); Y=cat(1,Y,[500*i y]); wX=cat(1,wX,wx) wY=cat(1,wY,wy) figure hold plot(wX(:,1),wX(:,2),'Color',[1 0 0]) plot(wY(:,1),wY(:,2),'Color',[0 0 1]) title('Calculated Beam Size as function of time') xlabel('Time (seconds)') ylabel('Calculated Beam Size (mm)') text(0.0,-0.13,[thisfile,'.m'],'FontSize',8,'Interpreter','none','Units','normalized') legend('X Beam Size','Y Beam Size','Location','Northeast') orient landscape print('-dpdf','weekendbeamwidth.pdf') hold figure hold plot(X(:,1),X(:,2),'Color',[1 0 0]) plot(Y(:,1),Y(:,2),'Color',[0 0 1]) title('Calculated Offset as function of time') xlabel('Time (seconds)') ylabel('Calculated Beam Offset (counts)') text(0.0,-0.13,[thisfile,'.m'],'FontSize',8,'Interpreter','none','Units','normalized') legend('X Beam Offset','Y Beam Offset','Location','Northeast') orient landscape print('-dpdf','weekendbeamoffset.pdf') hold figure hold plot(X(:,1),X(:,3),'Color',[1 0 0]) plot(Y(:,1),Y(:,3),'Color',[0 0 1]) title('Calculated Amplitude as function of time') xlabel('Time (seconds)') ylabel('Calculated Beam Amplitude (counts)') text(0.0,-0.13,[thisfile,'.m'],'FontSize',8,'Interpreter','none','Units','normalized') legend('X Beam Amplitude','Y Beam Amplitude','Location','Northeast') orient landscape print('-dpdf','weekendbeamamplitude.pdf') hold figure hold plot(X(:,1),X(:,4)*12e-6/(61/1000),'Color',[1 0 0]) plot(Y(:,1),Y(:,4)*12e-6/(61/1000),'Color',[0 0 1]) title('Calculated Centroid Location as function of time') xlabel('Time (seconds)') ylabel('Calculated Centroid Location Displacement (radians)') text(0.0,-0.13,[thisfile,'.m'],'FontSize',8,'Interpreter','none','Units','normalized') legend('X','Y','Location','Northeast') orient landscape print('-dpdf','weekendbeamcentroid.pdf') hold i=i+1; end