87#include <lal/LALStdlib.h>
88#include <lal/AVFactories.h>
89#include <lal/PrintFTSeries.h>
90#include <lal/LALFrStream.h>
92#include <lal/BandPassTimeSeries.h>
97#define FRAMEHEARSEEC_ENORM 0
98#define FRAMEHEARSEEC_EARG 2
100#define FRAMEHEARSEEC_MSGENORM "Normal exit"
101#define FRAMEHEARSEEC_MSGEARG "Error parsing arguments"
104#define USAGE "Usage: %s [options] | xmgr -pipe\n"\
105 " --help Print this help message\n" \
106 " --channel name Name of frame channel\n" \
107 " [--duration secs] How many seconds to look at\n"\
108 " [--epoch sec nsec] The starting epoch\n"\
109 " [--framedir dirname] Directory containing frame files\n"\
110 " [--highpass freq attenuation] High-pass filter parameters \n"\
111 " [--numpts npoints] Points per graph displayed\n"
115#ifndef HAVE_LIBLALFRAME
118 fputs(
"Disabled: LALApps compiled with non-frame-enabled LAL\n", stderr );
124static void graphout(
float x1,
float x2,
int thistime,
int last) {
129 printf(
"@doublebuffer true\n");
130 printf(
"@s0 color 3\n");
131 printf(
"@view 0.1, 0.1, 0.9, 0.45\n");
132 printf(
"@with g1\n");
133 printf(
"@view 0.1, 0.6, 0.9, 0.95\n");
134 printf(
"@with g0\n");
135 printf(
"@world xmin %f\n",x1);
136 printf(
"@world xmax %f\n",x2);
137 printf(
"@autoscale\n");
138 printf(
"@focus off\n");
139 printf(
"@xaxis label \"t (sec)\"\n");
140 printf(
"@fft(s0, 1)\n");
141 printf(
"@s1 color 2\n");
142 printf(
"@move g0.s1 to g1.s0\n");
143 printf(
"@with g1\n");
144 printf(
"@g1 type logy\n");
145 printf(
"@autoscale\n");
146 printf(
"@subtitle \"Spectrum\"\n");
147 printf(
"@xaxis label \"f (Hz)\"\n");
148 printf(
"@with g0\n");
149 printf(
"@subtitle \"IFO output %d\"\n",thistime);
151 if (!last) printf(
"@kill s0\n");
155 printf(
"@s0 color 3\n");
156 printf(
"@fft(s0, 1)\n");
157 printf(
"@s1 color 2\n");
158 printf(
"@move g0.s1 to g1.s0\n");
159 printf(
"@subtitle \"IFO output %d\"\n",thistime);
161 printf(
"@world xmin %f\n",x1);
162 printf(
"@world xmax %f\n",x2);
163 printf(
"@autoscale yaxes\n");
164 printf(
"@clear stack\n");
165 if (!last) printf(
"@kill s0\n");
166 printf(
"@with g1\n");
167 printf(
"@g1 type logy\n");
168 printf(
"@clear stack\n");
169 if (!last) printf(
"@kill s0\n");
170 printf(
"@with g0\n");
177int main(
int argc,
char *argv[] )
182 REAL4 itime, numSeconds=0;
192 dirname = getenv(
"LAL_FRAME_PATH" );
195 highpassParam.
nMax = 4;
196 highpassParam.
f1 = -1.0;
197 highpassParam.
a1 = -1.0;
208 while ( inarg < argc ) {
210 if ( !strcmp( argv[inarg],
"--help" ) ) {
211 if ( argc > inarg + 1 ) {
213 fprintf(stderr,
"Should be a usage message\n");
220 else if ( !strcmp( argv[inarg],
"--epoch" ) ) {
221 if ( argc > inarg + 1 ) {
223 epoch.gpsSeconds = atoi( argv[inarg++] );
224 epoch.gpsNanoSeconds = atoi( argv[inarg++] );
231 else if ( !strcmp( argv[inarg],
"--numpts" ) ) {
232 if ( argc > inarg + 1 ) {
240 else if ( !strcmp( argv[inarg],
"--highpass" ) ) {
241 if ( argc > inarg + 1 ) {
244 highpassParam.
f2 = atof( argv[inarg++] );
245 highpassParam.
a2 = atof( argv[inarg++] );
251 else if ( !strcmp( argv[inarg],
"--duration" ) ) {
252 if ( argc > inarg + 1 ) {
254 numSeconds = atof( argv[inarg++] );
260 else if ( !strcmp( argv[inarg],
"--channel" ) ) {
261 if ( argc > inarg + 1 ) {
263 channelIn.
name = argv[inarg++];
270 else if ( !strcmp( argv[inarg],
"--framedir" ) ) {
271 if ( argc > inarg + 1 ) {
273 dirname = argv[inarg++];
280 else if ( argv[inarg][0] ==
'-' ) {
294 series.epoch.gpsNanoSeconds =
epoch.gpsNanoSeconds;
313 for (
i=0 ;
i<32 ;
i++ ){
315 printf(
"%e\t%e\n", itime,0.0);
326 >=
epoch.gpsSeconds + (
INT4)(numSeconds)) ));
void LALFrSeek(LALStatus *status, const LIGOTimeGPS *epoch, LALFrStream *stream)
void LALFrOpen(LALStatus *status, LALFrStream **stream, const CHAR *dirname, const CHAR *pattern)
void LALFrGetREAL4TimeSeries(LALStatus *status, REAL4TimeSeries *series, FrChanIn *chanin, LALFrStream *stream)
void LALFrClose(LALStatus *status, LALFrStream **stream)
void LALCheckMemoryLeaks(void)
#define FRAMEHEARSEEC_EARG
void LALButterworthREAL4TimeSeries(LALStatus *stat, REAL4TimeSeries *series, PassBandParamStruc *params)
int LALPrintError(const char *fmt,...)
void LALSDestroyVector(LALStatus *, REAL4Vector **)
void LALCreateVector(LALStatus *, REAL4Vector **, UINT4)