Home > . > getifo.m

getifo

PURPOSE ^

GETIFO - get detector coordinates

SYNOPSIS ^

function Cordnt = getifo(detId)

DESCRIPTION ^

 GETIFO - get detector coordinates

 Cordnt = getifo(detId)

 detId      detector identifier string in any form of mixed case

 Cordnt    structure containing coordinate info for IFO
   .V         X-arm unit vector in Cartesian coordinates
   .W         Y-arm unit vector in Cartesian coordinates
   .LAT       beam splitter latitude in rad
   .CODEC     cosine of the beam splitter co-declination
   .LONG      beam splitter longitude in rad
   .WGS84     beam splitter location in WGS-84 coordinates in m
   .R         beam splitter distance from center of the earth in m

 Currently supported detectors are:
       'H1'    LIGO 4km IFO at LHO
       'H2'    LIGO 2km IFO at LHO
       'L1'    LIGO 4km IFO at LLO

 SEE ALSO: GRAVEN, IFODELAY, DETPROJ, MAKELIST

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SUBFUNCTIONS ^

SOURCE CODE ^

0001 function Cordnt = getifo(detId)
0002 
0003 % GETIFO - get detector coordinates
0004 %
0005 % Cordnt = getifo(detId)
0006 %
0007 % detId      detector identifier string in any form of mixed case
0008 %
0009 % Cordnt    structure containing coordinate info for IFO
0010 %   .V         X-arm unit vector in Cartesian coordinates
0011 %   .W         Y-arm unit vector in Cartesian coordinates
0012 %   .LAT       beam splitter latitude in rad
0013 %   .CODEC     cosine of the beam splitter co-declination
0014 %   .LONG      beam splitter longitude in rad
0015 %   .WGS84     beam splitter location in WGS-84 coordinates in m
0016 %   .R         beam splitter distance from center of the earth in m
0017 %
0018 % Currently supported detectors are:
0019 %       'H1'    LIGO 4km IFO at LHO
0020 %       'H2'    LIGO 2km IFO at LHO
0021 %       'L1'    LIGO 4km IFO at LLO
0022 %
0023 % SEE ALSO: GRAVEN, IFODELAY, DETPROJ, MAKELIST
0024 
0025 % $Id: getifo.m,v 1.6 2004/05/07 19:57:37 stuver Exp $
0026 
0027 % DETERMINE desired detector
0028 % GENERATE structure containing coordinates
0029 % RETURN structure
0030 
0031 % Initalize Cordnt struct
0032 Cordnt = deal(struct('V', [], 'W', [], 'LAT', [], 'CODEC', [], 'LONG', ...
0033     [], 'WGS84', [], 'R', []));
0034 
0035 % Define converstion constant from degrees to radians
0036 DEG2RAD = pi/180;
0037 
0038 % Make detId all uppercase
0039 detId = upper(detId);
0040 
0041 % All LIGO coordinates (except CODEC & R) are verbatim from LIGO-P000006-D-E:
0042 %   Rev. Sci. Instrum., Vol. 72, No. 7, July 2001
0043 
0044 if strcmp(detId, 'H1') | strcmp(detId, 'H2')
0045     % Generate coordinates for LHO:
0046     
0047     % X-arm unit vector
0048     Cordnt.V = [-0.223891216, 0.799830697, 0.556905359];
0049     % Y-arm unit vector
0050     Cordnt.W = [-0.913978490, 0.0260953206, -0.404922650];
0051     % Beam splitter latitude
0052     Cordnt.LAT = dms2dec('N', [46, 27, 18.527841])*DEG2RAD; % rad
0053     % Beam splitter co-declination determined from latitude
0054     Cordnt.CODEC = cos((pi/2)-Cordnt.LAT);
0055     % Beam splitter longitude
0056     Cordnt.LONG = dms2dec('W', [119, 24, 27.565681])*DEG2RAD; % rad
0057     % WGS-84 coordinates of beam splitter (Only one coordinate specified in
0058     % the document for both H1 and H2)
0059     Cordnt.WGS84 = [-2.161414928e+6, -3.834695183e+6, 4.600350224e+6]; % m
0060     % Beam splitter distance from center of the Earth determined from
0061     % WGS-84 coordinates
0062     Cordnt.R = sqrt(sum(Cordnt.WGS84.^2)); % m
0063 elseif strcmp(detId, 'L1')
0064     % Generate coordinates for LLO:
0065     
0066     % X-arm unit vector
0067     Cordnt.V = [-0.954574615, -0.141579994, -0.262187738];
0068     % Y-arm unit vector
0069     Cordnt.W = [0.297740169, -0.487910627, -0.820544948]; % rad
0070     % Beam splitter latitude
0071     Cordnt.LAT = dms2dec('N', [30, 33, 46.419531])*DEG2RAD; % rad
0072     % Beam splitter co-declination determined from latitude
0073     Cordnt.CODEC = cos((pi/2)-Cordnt.LAT);
0074     % Beam splitter longitude
0075     Cordnt.LONG = dms2dec('W', [90, 46, 27.265294])*DEG2RAD; % rad
0076     % WGS-84 coordinates of beam splitter
0077     Cordnt.WGS84 = [-74276.04192, -5.496283721e+6, 3.224257016e+6]; % m
0078     % Beam splitter distance from center of the Earth determined from
0079     % WGS-84 coordinates
0080     Cordnt.R = sqrt(sum(Cordnt.WGS84.^2)); % m
0081 else
0082     error('getifo: The detId you entered is not currently listed.')
0083 end
0084 
0085 return
0086 
0087 % ~~~ END MAIN ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
0088 
0089 function degdec = dms2dec(nsew, coord);
0090 
0091 % DMS2DEC - convert longitude and latitude in dms to degrees decimal
0092 %
0093 % deg2dec = dms2dec(nsew, coord)
0094 %
0095 % nsew    string indicating whether longitude is measured east ('E') or
0096 %         west ('W') or latitude is measured north ('N') or south ('S')
0097 % coord   1x3 vector defining the coordinates in degrees (coord(1)),
0098 %         minutes (coord(2)) and seconds (coord(3))
0099 %
0100 % degdec    coordinates in degrees decimal.  A negative longiude indicates
0101 %           Western Hemisphere while a negative latitude value indicates
0102 %           Southern Hemisphere
0103 
0104 % MAKE nsew upper case for ease of comparison
0105 % DEFINE sign of converted coordinates
0106 % CONVERT coordinates
0107 
0108 % Initialize degdec
0109 degdec = [];
0110 
0111 % Make nsew all upper case for ease in using strcmp
0112 nsew = upper(nsew);
0113 
0114 % Define sign of converted coordinates
0115 if strcmp(nsew, 'S')
0116     % If in Southern Hemisphere, the coordinates will be negative
0117     pm = -1;
0118 elseif strcmp(nsew, 'N')
0119     % If in the Northern Hemisphere, the coordinates will be positive
0120     pm = 1;
0121 elseif strcmp(nsew, 'W')
0122     % If in the Western Hemisphere, the coordinates will be negative
0123     pm = -1;
0124 elseif strcmp(nsew, 'E')
0125     % If in the Eastern Hemisphere, the coordinates will be postive
0126     pm = 1;
0127 else
0128     error(['getifo -> dms2dec: Please enter ''N'', ''S'', ''E'' ' ...
0129             'or ''W'' for nsew'])
0130 end
0131 
0132 % Convert dms into degrees decimal
0133 degdec = pm*(coord(1)+(coord(2)/60)+(coord(3)/3600));
0134 
0135 return

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