Skip to content
Snippets Groups Projects
Commit 1f57432d authored by Patrick Brady's avatar Patrick Brady
Browse files

Added ability to use units counts/attostrain

parent 26c55673
No related branches found
Tags E7-020108
No related merge requests found
......@@ -10,7 +10,7 @@ zero-pole-gain representation.
\item[Synopsis]
\verb$lal_ZPG2Transfer$ [\verb$-z nz z_1 ... z_nz$] [\verb$-p np p_1 .... p_np$]
[\verb$-g gain$] [\verb$-f npoints fmin fmax$]
[\verb$-g gain$] [\verb$-f npoints fmin fmax$] [\verb$-t$]
[\verb$-o outfile$] [\verb$-i ilwdfile$]
\item[Description]
......@@ -31,6 +31,10 @@ The number of zeros \verb$np$ followed
by a space and a white space list of \emph{real} poles specified in units of Hz.
\item[\texttt{-g gain}]
The gain of the filter.
\item[\texttt{-t}]
If this flag is used, then the ilwd will indicate units of
counts/attostrain. The user must correctly choose the zeros, poles,
and gains, it is not handled automatically.
\item[\texttt{-f npoints fmin fmax}]
Information about the frequency series. \verb$npoints$ is the number
of points in the series, \verb$fmin$ is the lowest frequency to be
......
......@@ -28,7 +28,7 @@ NRCSID( RESPONSEC, "$Id$" );
/* Usage format string. */
#define USAGE "Usage: %s [-z nz z_1 ... z_nz] [-p np p_1 .... p_np]
[-g gain] [-f npoints fmin fmax] [-o outfile]
[-i ilwdfile] \n"
[-i ilwdfile] [-t] \n"
/* Macros for printing errors and testing subroutines. */
#define ERROR( code, msg, statement ) \
......@@ -63,6 +63,7 @@ int main(int argc, char **argv)
FILE *fp = NULL; /* generic file pointer */
REAL4 fmax=1024.0; /* max freq */
REAL4 fmin;
INT4 response=1; /* compute response if 1, transfer if 0 */
/* Create memory for the transfer function */
calrec.transfer = (COMPLEX8FrequencySeries *)LALMalloc(
......@@ -99,6 +100,10 @@ int main(int argc, char **argv)
return RESPONSEC_EARG;
}
}
else if ( !strcmp( argv[arg], "-t" ) ) {
arg++;
response = 0;
}
/* Parse zeros option. */
else if ( !strcmp( argv[arg], "-z" ) ) {
arg++;
......@@ -196,12 +201,21 @@ int main(int argc, char **argv)
return RESPONSEC_EFILE;
}
fprintf( fp, ilwdTop );
fprintf( fp, " <real_8 name='start_freq' units='hz'>%16.16e</real_8>\n",0.0);
fprintf( fp, " <real_8 name='start_freq' units='hz'>%16.16e</real_8>\n",
0.0);
fprintf( fp, " <real_8 name='stop_freq' units='hz'>%16.16e</real_8>\n",
fmax);
fprintf( fp, " <real_8 name='freq:step_size' units='hz'>%16.16e</real_8>\n",
calrec.transfer->deltaF);
fprintf( fp, " <complex_8 dims='%i' name='data' units='strain/volt'>",npoints);
if ( response ){
fprintf( fp, " <complex_8 dims='%i' name='data' units='strain/count'>",
npoints);
}
else {
fprintf( fp, " <complex_8 dims='%i' name='data' units='counts/attostrain'>",
npoints);
}
for(i=0;i<npoints;i++){
REAL4 re, im;
re = calrec.transfer->data->data[i].re;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment