function [st,brk,dl]=GuildSingleIfoStats(filename,outname) %[st,brk,dl]=GuildSingleIfoStats(filename,outname) %LockStatistics infered from a guild query stored in "filename". %The file should be an ascii file and the name should have no extensions. %The data stored in the file should be ONLY start and edn times of guild query. %Editing the file after querying may be needed. % %st and brk are start and break GPS times. %dl is the length of each segment. % %If an argument 'outname' is given, it will print out start and stop times in that file. eval(['load -ascii '''filename '''']) eval(['Data=' filename ';']); t0=693597613; %12/28/01 18:00 UTC: start of E7 p1=Data(:,1); p2=Data(:,2); %rows that indicate a breakpoint dp=find(p1(2:end)-p1(1:end-1)~=200); %start and end GPS times of locked segments st=[p1(1);p1(dp+1)]; brk=[p2(dp);p2(end)]; N=length(brk); %number of locked segments: dl=brk-st+1; %length of segments dnl=st(2:end)-brk(1:end-1); %length of unlocked segments T=p2(end)-p1(1); %total time considered disp(['Total locked time: ' num2str(sum(dl)/3600,3) ' hrs']) disp(['Duty cycle: ' num2str(sum(dl)/T*100,3) ' %']) disp([]) disp(['Total time locked with locks longer than 15min: ' num2str(sum(dl(find(dl>15*60)))/3600,3) ' hrs']) disp(['Duty cycle for long locks: ' num2str(sum(dl(find(dl>15*60)))/T*100,3) ' %']) %day labels days={'12/28','12/29','12/30','12/31',... '01/01','01/02','01/03','01/04',... '01/05','01/06','01/07','01/08',... '01/09','01/10','01/11','01/12',... '01/13','01/14'}; %Plot length of locked segments vs time figure(1) Nmx=ceil(max(dl/600))*10; bar((st-t0)/(3600*24),dl/60), axis([-.5 17.5 0 Nmx]) hold on plot((st-t0)/(3600*24),cumsum(dl/60)/60,'r',... (st(find(dl>15*60))-t0)/(3600*24),cumsum(dl(find(dl>15*60))/60)/60,'k') hold off title(filename) set(gca,'XTick',[.5:1:17]) set(gca,'XTickLabel',[]) for i=1:18 text(i-1.4,-Nmx/20,days{i},'FontSize',8) end legend(['cum sum of locked segments(hrs), total=' num2str(sum(dl/3600),3)],... ['cumsum of locked segments > 15min (hrs),total=' num2str(sum(dl(find(dl>15*60))/3600),3)],... 'locked segments (min)') grid on shg figure(2) xx=[2.5:5:ceil(max(dl)/600)*10]; hist(dl/60,xx) ylabel('# of locked segments') xlabel('minutes') title(filename) shg figure(3) xx=[2.5:5:ceil(max(dnl)/600)*10]; hist(dnl/60,xx); ylabel('# of unlocked segments') xlabel('minutes') title(filename) shg %mean lock length depending on the time of the day for i=1:2:24 z=find(mod((st-t0)/3600+18,24)>=(i-1) & mod((st-t0)/3600+18,24)1, E7days={'Dec 28','Dec 29','Dec 30','Dec 31',... 'Jan 01','Jan 02','Jan 03','Jan 04',... 'Jan 05','Jan 06','Jan 07','Jan 08',... 'Jan 09','Jan 10','Jan 11','Jan 12',... 'Jan 13','Jan 14'}; stday=floor(((st-t0)/3600+18)/24); sthr=floor((st-t0)/3600+18-24*stday); stmin=round((st-t0)/60+18*60-sthr*60-24*60*stday); brkday=floor(((brk-t0)/3600+18)/24); brkhr=floor((brk-t0)/3600+18-24*brkday); brkmin=round((brk-t0)/60+18*60-brkhr*60-24*60*brkday); eval(['fid=fopen(''' outname ''',''w'');']) fprintf(fid,'%s\t','Seg#'); fprintf(fid,'%s ','Start Time UTC'); fprintf(fid,'\t %s','Stop Time UTC'); fprintf(fid,'\t %s \t \t %s \t %s \n','DT(min)','Start GPS','Stop GPS'); fprintf(fid,'\n'); for i=1:length(st) if dl(i)>5*60 %only write segments longer than 5 minutes fprintf(fid,'%d \t%',i); fprintf(fid,'%s ',E7days{stday(i)+1}); fprintf(fid,'%02.0f',sthr(i)); fprintf(fid,'%s',':'); fprintf(fid,'%02.0f',stmin(i)); fprintf(fid,'\t %s ',E7days{brkday(i)+1}); fprintf(fid,'%02.0f',brkhr(i)); fprintf(fid,'%s',':'); fprintf(fid,'%02.0f',brkmin(i)); fprintf(fid,'\t %3.0f \t \t %d \t %d \n',dl(i)/60,st(i),brk(i)); end if i