%% function plotOffsetMatrix(opt,sigDC,probeNames, mPrb, cPrbNames) % % Plot an offset matrix of specified probes and drives. % % === Inputs === % % opt: Optickle instance. % % sigDC: Output of tickle. tickle has to be called with only one frequency % point. [Nprb] % % probeNames: A cell array of probe names. % % mPrb: A matrix of size [length(probeNames)*length(cPrbNames)]. % This matrix is used to convert from normal probes to compound % probes. % % cPrbNames: A cell array of compound probe names. % function plotOffsetMatrix(opt,sigDC,probeNames, mPrb, cPrbNames) %% test=0; if test probeNames={'REFL_1I','REFL_1Q','REFL_2I','REFL_2Q'}; mPrb=[1,0,0,0;0,1,1,0]; cPrbNames={'REFL_1I','Some shit'}; driveNames={'PRM','BS','ETMX','ETMY'}; mDrv=[1,0,0,0;0,1,0,0;0,0,1,1;0,0,1,-1]; cDrvNames={'PRM','BS','CARM','DARM'}; end %% try probeNames; catch probeNames=getProbeName(opt); mPrb = eye(length(probeNames)); cPrbNames=probeNames; end %% Complex sensing matrix iPrb=cellfun(@(x)getProbeNum(opt,x),probeNames); sigDCr=sigDC(iPrb); mOfs = mPrb*sigDCr; %% Plot Nprb=length(cPrbNames); ax=axes(); %Make grid for ii=0:Nprb line([0,1],[ii,ii]); end for ii=0:1 line([ii,ii],[0,Nprb]); end set(ax, 'XLim',[0,1],'YLim',[0,Nprb]); set(ax,'XTick',[0.5:1-0.5], 'YTick', [0.5:Nprb-0.5]); set(ax,'XTickLabel','Offset','YTickLabel',cPrbNames); for ii=1:Nprb jj=1; text(jj-0.5,ii-0.5,num2str(abs(mOfs(ii)), '%5.1e'), 'HorizontalAlignment','center'); end title('Offset Matrix [W]','FontSize',16);