Home > . > makett.m

makett

PURPOSE ^

MAKETT - projects metric perturbation into TT gauge

SYNOPSIS ^

function htt = makett(hij, Internal)

DESCRIPTION ^

 MAKETT - projects metric perturbation into TT gauge

 htt = makett(hij, Internal);

 hij       metric perturbation for gravitational wave source in 3x3xtime
           format
 Internal  struct describing source orientation to line of sight
   .x      cos angle with respect to source Z-axis
   .phi    azimuth angle from source x axis

 htt       metric perturbation projected into TT gauge in 2xtime format
       htt(1,:) - plus polarization
       htt(2,:) - cross polarization
   q.v. LIGO-T040020-01-Z for + and x conventions

 SEE ALSO: GRAVEN

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SUBFUNCTIONS ^

SOURCE CODE ^

0001 function htt = makett(hij, Internal)
0002 
0003 % MAKETT - projects metric perturbation into TT gauge
0004 %
0005 % htt = makett(hij, Internal);
0006 %
0007 % hij       metric perturbation for gravitational wave source in 3x3xtime
0008 %           format
0009 % Internal  struct describing source orientation to line of sight
0010 %   .x      cos angle with respect to source Z-axis
0011 %   .phi    azimuth angle from source x axis
0012 %
0013 % htt       metric perturbation projected into TT gauge in 2xtime format
0014 %       htt(1,:) - plus polarization
0015 %       htt(2,:) - cross polarization
0016 %   q.v. LIGO-T040020-01-Z for + and x conventions
0017 %
0018 % SEE ALSO: GRAVEN
0019 
0020 % $Id: makett.m,v 1.10 2004/05/12 19:59:10 stuver Exp $
0021 
0022 % INITIALIZE output variable
0023 % CHECK inputs for errors
0024 % DEFINE angles
0025 % DEFINE rotation matrix
0026 % DEFINE plus and cross bases
0027 % PROJECT metric pertubation onto bases
0028 % RETURN pluss and cross polarization timeseries
0029 
0030 
0031 % Initalize output variable
0032 htt = [];
0033 
0034 % Check for errors
0035 errorcheck(hij, Internal);
0036 
0037 % Define angles from structure
0038 cosTheta = Internal.x;
0039 sinTheta = sqrt(1-cosTheta^2);
0040 phi = Internal.phi;
0041 
0042 % Rotate coordinates
0043 R = [cos(phi)*cosTheta, sin(phi)*cosTheta, -sinTheta; ...
0044       -sin(phi), cos(phi), 0; ...
0045       cos(phi)*sinTheta, sin(phi)*sinTheta, cosTheta];
0046 
0047 % Form the plus and cross bases
0048 % R(1,:) = x basis
0049 % R(2,:) = y basis
0050 eplus = R(1,:)'*R(1,:)-R(2,:)'*R(2,:);
0051 ecross = R(1,:)'*R(2,:)+R(2,:)'*R(1,:);
0052 
0053 % For each timestep, project the metric perturbation onto the plus and
0054 % cross basis
0055 % h+ = 0.5*(h^{ij}eplus_{ij})
0056 % hx = 0.5*(h^{ij}ecross_{ij})
0057 % * N.B. Multiply h^{ij}e_{ij} by 0.5 since dot(e_{ij},e_{ij}) = 2
0058 for k = 1:size(hij,3)
0059     htt(1,k) = 0.5*sum(sum(hij(:,:,k).*eplus));
0060     htt(2,k) = 0.5*sum(sum(hij(:,:,k).*ecross));
0061 end
0062 
0063 return
0064 
0065 % ~~~ END MAIN ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
0066 
0067 function errorcheck(hij, Internal)
0068 
0069 % ERRORCHECK - checks makeh's input data for errors and stops the code if
0070 %              an error is found
0071 %
0072 % errorcheck(hij, Internal)
0073 %
0074 % hij       metric perturbation for gravitational wave source
0075 % Internal  struct describing location of detector on source sky
0076 %   .x      cos angle with respect to source Z-axis
0077 %   .phi    azimuth angle from source x axis
0078 
0079 % DETERMINE size of hij
0080 % CHECK all inputs for errors
0081 
0082 % Determine size of hij
0083 checkSizeHij = size(hij);
0084 
0085 if checkSizeHij(1) ~= 3 & checkSizeHij(2) ~= 3
0086     % hij must be in 3x3xtime form
0087     checkSizeHij
0088     error('makeh: hij is not in 3x3xtime form')
0089 end
0090 
0091 % Internal must be a structure
0092 if ~strcmp(class(Internal), 'struct')
0093     Internal
0094     error('makett: Internal must be a structure')
0095 end
0096 
0097 if ~isfield(Internal, 'x')
0098     % Internal must contain the field x
0099     Internal
0100     error('makeh: The Internal struct must contain the field x')
0101 end
0102 
0103 if ~isfield(Internal, 'phi')
0104     % Internal must contain the field phi
0105     Internal
0106     error('makeh: The Internal struct must contain the field phi')
0107 end
0108 
0109 if abs(Internal.x) > 1 | ~isreal(Internal.x)
0110     % If Internal.x exists, it must have a value between -1 and 1
0111     Internal.x
0112     error('makeh: Internal.x must be real and between -1 and 1')
0113 end
0114 
0115 if Internal.phi < -pi | Internal.phi > pi | ~isreal(Internal.phi)
0116     % If Internal.phi exits, it must be real and have a value between
0117     % -pi and pi
0118     Internal.phi
0119     error(['makeh: Internal.phi must be real and betweeen -pi '...
0120             'and pi'])
0121 end
0122 
0123 return

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