Home > . > calibsimfd.m

calibsimfd

PURPOSE ^

CALIBSIMFD - converts time-series in strain -> gw channel counts

SYNOPSIS ^

function [sigSeries] = calibsimfd(IFO,gpsSec,strainSeries,fs,sigType)

DESCRIPTION ^

 CALIBSIMFD - converts time-series in strain -> gw channel counts
       -- Uses Frequency-Domain conversion
   sigSeries = calibsimfd(IFO,gpsSec,strainSeries,fs[,sigType])
   IFO     - IFO name ('H1','H2','L1')
   gpsSec - GPS time of sim (whole seconds)
   strainSeries - time-series vector in strain amplitude
   fs    - time interval of time-series elements
   sigType [OPTIONAL] signal type
               'AS_Q'  original AS_Q
               'DARM_ERR'  DARM_ERR signal from S4
               <default = AS_Q>

   sigSeries - output time-series vector in signal channel counts

 $Id: calibsimfd.m,v 1.16 2005/04/13 00:50:39 thorne Exp $

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function [sigSeries] = calibsimfd(IFO,gpsSec,strainSeries,fs,sigType)
0002 % CALIBSIMFD - converts time-series in strain -> gw channel counts
0003 %       -- Uses Frequency-Domain conversion
0004 %   sigSeries = calibsimfd(IFO,gpsSec,strainSeries,fs[,sigType])
0005 %   IFO     - IFO name ('H1','H2','L1')
0006 %   gpsSec - GPS time of sim (whole seconds)
0007 %   strainSeries - time-series vector in strain amplitude
0008 %   fs    - time interval of time-series elements
0009 %   sigType [OPTIONAL] signal type
0010 %               'AS_Q'  original AS_Q
0011 %               'DARM_ERR'  DARM_ERR signal from S4
0012 %               <default = AS_Q>
0013 %
0014 %   sigSeries - output time-series vector in signal channel counts
0015 %
0016 % $Id: calibsimfd.m,v 1.16 2005/04/13 00:50:39 thorne Exp $
0017 
0018 % NEEDS: h2asq_fd,
0019 
0020 % To run, open the OS's .cshrc file and add the following:
0021 % setenv LIGO_CALIB_DATA xxxx
0022 % where xxx is the directory containing the calibration files
0023 
0024 inOk = nargchk(4,5,nargin);
0025 outOk = nargchk(1,1,nargout);
0026 if(~(isempty(inOk) && isempty(outOk)))
0027     error ('syntax is [sigSeries] = calibsim_fd(IFO,gpsSec,strainSeries,fs[,sigType])');
0028 end
0029 
0030 % CHECK for valid IFO (LIGO for now)
0031 % IF IFO has no calibration
0032 %   CLEAR output time series
0033 %   RETURN
0034 % ENDIF
0035 testIFO = upper(IFO);
0036 validIfoFlag = false;
0037 switch testIFO
0038     case 'H1'
0039         validIfoFlag = true;
0040     case 'H2'
0041         validIfoFlag = true;
0042     case 'L1'
0043         validIfoFlag = true;
0044     otherwise
0045         validIfoFlag = false;
0046 end
0047 if(validIfoFlag == false)
0048     sigSeries = [];
0049     return
0050 end
0051 
0052 % IF signal type was input
0053 %   CHECK for a valid type
0054 %   IF invalid
0055 %       CREATE error message
0056 %   ENDIF
0057 % ELSE
0058 %   SET to default type
0059 % ENDIF
0060 DEF_SIG = 'AS_Q';
0061 if(nargin > 4)
0062     if( (strcmp(sigType,'AS_Q')==false) && ...
0063         (strcmp(sigType,'DARM_ERR') == false))
0064         msgId = 'calibsim_fd:badSignal';
0065         warning(msgId,'%s: signal type %s is not valid - assume AS_Q',msgId,sigType);
0066         sigType = DEF_SIG;
0067     end
0068 else
0069     sigType = DEF_SIG;
0070 end
0071 
0072 % ADD zero-padding to input series (pad on both ends)
0073 % CONVERT input series to AS-Q counts
0074 % REMOVE zero-padding
0075 nsamp = length(strainSeries);
0076 padSeries = zeros([2*nsamp,1]);
0077 nstart  = floor(nsamp/2);
0078 nend = nstart + (nsamp-1);
0079 padSeries(nstart:nend) = strainSeries(1:nsamp);
0080 [outSeries] = h2asq_fd(IFO,gpsSec,padSeries,fs,sigType);
0081 sigSeries = outSeries(nstart:nend);
0082 return

Generated on Thu 12-May-2005 11:48:48 by m2html © 2003