Home > test > testdetproj.m

testdetproj

PURPOSE ^

$Id: testdetproj.m,v 1.8 2004/05/11 15:08:06 stuver Exp $

SYNOPSIS ^

function rho = testdetproj(detId, varargin)

DESCRIPTION ^

 $Id: testdetproj.m,v 1.8 2004/05/11 15:08:06 stuver Exp $

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function rho = testdetproj(detId, varargin)
0002 
0003 % $Id: testdetproj.m,v 1.8 2004/05/11 15:08:06 stuver Exp $
0004 
0005 addpath ../
0006 
0007 if length(varargin) ~= 0
0008     if length(varargin) == 1
0009         plotSwitch = varargin{:};
0010         if strcmp(lower(plotSwitch), 'off')
0011             off = true;
0012         else
0013             off = ~true;
0014         end
0015         
0016     else
0017         error('testdetproj: varargin = plotSwitch')
0018     end
0019 else
0020     off = ~true;
0021 end
0022 
0023 xx=0:pi/100:pi; % rad
0024 yy=-pi:pi/50:pi; % rad
0025 psi=0; %:2:90;
0026 
0027 htt=[1/sqrt(2); 1/sqrt(2)];
0028 
0029 b=waitbar(0,['Calculating antenna pattern for ' detId '...']);
0030 
0031 for f=1:length(psi)
0032     External.psi=psi(f)*(pi/180);
0033     for g=1:length(xx)
0034         External.x=cos(xx(g));
0035         for h=1:length(yy)
0036             External.phi=yy(h);
0037             [aitch, fPlus, fCross] = ...
0038                 detproj(htt, detId, External);
0039             H(g,h,f)=aitch;
0040             Fp(g,h)=fPlus;
0041             Fc(g,h)=fCross;
0042         end
0043     end
0044     waitbar(f/length(psi),b)
0045 end
0046 
0047 close(b)
0048 %
0049 % load ligomapdata
0050 % if ~off
0051 %     % Animate resulting strain for different values of psi
0052 %     clear f
0053 %     for f=1:length(psi)
0054 %
0055 %         figure(1)
0056 %
0057 %         subplot(121)
0058 %         surf(-pi:pi/50:pi,-pi/2:pi/100:pi/2,flipud(H(:,:,f)),'linestyle','none')
0059 %         title(['h for \psi = ' num2str(f-1) '^o at ' upper(detId)])
0060 %         shading('interp');
0061 %         colorbar('horiz');
0062 %         view(0,90);
0063 %         hold on;
0064 %         plot(Coast.map(1,1:end), Coast.map(2,1:end), 'w');
0065 %         plot(Llo.map(1,:), Llo.map(2,:), 'gx');
0066 %         plot(Lho.map(1,:), Lho.map(2,:), 'wx');
0067 %         axis equal;
0068 %         axis([-pi, pi, -pi/2, pi/2]);
0069 %         xlabel('Longitude');
0070 %         ylabel('Latitude');
0071 %         xlim([-pi, pi]);
0072 %         ylim([-pi/2, pi/2]);
0073 %         set(gca, 'XTick', -pi:pi/4:pi);
0074 %         set(gca, 'XTickLabel', {'180 W', '135 W', '90 W', '45 W', '0', '45 E', ...
0075 %                 '90 E', '135 E', '180 E'});
0076 %         set(gca, 'YTick', -pi/2:pi/4:pi/2);
0077 %         set(gca, 'YTickLabel', {'90 S', '45 S', '0', '45 N', '90 N'});
0078 %
0079 %         subplot(122)
0080 %         sphere(36)
0081 %         h1 = findobj('Type', 'surface');
0082 %         set(h1, 'CData', flipud(H(:,:,f)), 'FaceColor', 'texturemap')
0083 %         set(gca, 'CameraPosition', 1.4*[Lho.globe(1,:), Lho.globe(2,:), Lho.globe(3,:)], 'CameraTarget', ...
0084 %             [0, 0, 0])
0085 %         axis off;
0086 %         axis square;
0087 %         hold on;
0088 %         plot3(Coast.globe(1,1:end), Coast.globe(2,1:end), Coast.globe(3,1:end), 'w');
0089 %         plot3(Llo.globe(1,:), Llo.globe(2,:), Llo.globe(3,:), 'gx');
0090 %         plot3(Lho.globe(1,:), Lho.globe(2,:), Lho.globe(3,:), 'wx');
0091 %
0092 %         figure(1), shg
0093 %
0094 %         pause(0.01)
0095 %     end
0096 % end
0097 % clf
0098 
0099 rho=Fp.^2+Fc.^2;
0100 
0101 if ~off
0102     ligomap(-pi:pi/50:pi,-pi/2:pi/100:pi/2,flipud(rho));
0103     
0104     figure(1)
0105     title(['Antanna Pattern for ' upper(detId)])
0106     figure(2)
0107     title(['Antanna Pattern for ' upper(detId)])
0108 end
0109 
0110 return

Generated on Tue 05-Oct-2004 10:40:50 by m2html © 2003