Commit 330b9329 authored by Adam Mercer's avatar Adam Mercer

initial packaging of lalburst

this is the initial attempt at splitting the lal burst code off into a
separate package that can be released independantly. lalburst is
comprised of code from the burstsearch, clremoval, timefreq, and
tracksearch packages plus the burst simulation code from the inject
package.
Original: 9d8cfeffd041519c860474638d289cf9d8ab971e
parent c3b12129
......@@ -73,9 +73,6 @@ packages/bank/test/MetricTestBCV
packages/bank/test/MetricTestPTF
packages/bank/test/PNTemplates
packages/bank/test/SpaceCovering
packages/burstsearch/test/ThresholdsTest
packages/clremoval/test/CLRTest
packages/clremoval/test/CLRoutdata.asc
packages/date/test/TestDateString
packages/date/test/TestDelay
packages/date/test/TestGPStoFloat
......@@ -200,12 +197,6 @@ packages/support/test/UserInputTest
packages/tdfilter/test/BandPassTest
packages/tdfilter/test/IIRFilterTest
packages/tdfilter/test/LPCTest
packages/timefreq/doc/Tfr.log
packages/timefreq/doc/Tfr.pdf
packages/timefreq/test/TfrPswvTest
packages/timefreq/test/TfrRspTest
packages/timefreq/test/TfrSpTest
packages/timefreq/test/TfrWvTest
packages/tools/include/FrequencySeries.h
packages/tools/include/Sequence.h
packages/tools/include/TimeSeries.h
......@@ -224,7 +215,6 @@ packages/tools/test/SequenceTest
packages/tools/test/SkymapTest
packages/tools/test/TimeSeriesTest
packages/tools/test/UnitsTest
packages/tracksearch/test/TrackSearchTest
packages/utilities/src/MatrixOps.c
packages/utilities/test/CCoarseGrainFrequencySeriesTest
packages/utilities/test/DCoarseGrainFrequencySeriesTest
......
......@@ -72,11 +72,6 @@ AC_CONFIG_FILES([ \
packages/fft/include/Makefile \
packages/fft/src/Makefile \
packages/fft/test/Makefile \
packages/clremoval/Makefile \
packages/clremoval/doc/Makefile \
packages/clremoval/include/Makefile \
packages/clremoval/src/Makefile \
packages/clremoval/test/Makefile \
packages/inspiral/Makefile \
packages/inspiral/doc/Makefile \
packages/inspiral/include/Makefile \
......@@ -112,21 +107,6 @@ AC_CONFIG_FILES([ \
packages/houghpulsar/include/Makefile \
packages/houghpulsar/src/Makefile \
packages/houghpulsar/test/Makefile \
packages/burstsearch/Makefile \
packages/burstsearch/doc/Makefile \
packages/burstsearch/include/Makefile \
packages/burstsearch/src/Makefile \
packages/burstsearch/test/Makefile \
packages/tracksearch/Makefile \
packages/tracksearch/doc/Makefile \
packages/tracksearch/include/Makefile \
packages/tracksearch/src/Makefile \
packages/tracksearch/test/Makefile \
packages/timefreq/Makefile \
packages/timefreq/doc/Makefile \
packages/timefreq/include/Makefile \
packages/timefreq/src/Makefile \
packages/timefreq/test/Makefile \
packages/support/Makefile \
packages/support/doc/Makefile \
packages/support/include/Makefile \
......
......@@ -18,17 +18,13 @@ liblal_la_DEPENDENCIES = \
$(top_builddir)/packages/tdfilter/src/libtdfilter.la \
$(top_builddir)/packages/window/src/libwindow.la \
$(top_builddir)/packages/fft/src/libfft.la \
$(top_builddir)/packages/clremoval/src/libclremoval.la \
$(top_builddir)/packages/inspiral/src/libinspiral.la \
$(top_builddir)/packages/noisemodels/src/libnoisemodels.la \
$(top_builddir)/packages/bank/src/libbank.la \
$(top_builddir)/packages/ring/src/libring.la \
$(top_builddir)/packages/findchirp/src/libfindchirp.la \
$(top_builddir)/packages/pulsar/src/libpulsar.la \
$(top_builddir)/packages/houghpulsar/src/libhoughpulsar.la \
$(top_builddir)/packages/burstsearch/src/libburstsearch.la \
$(top_builddir)/packages/tracksearch/src/libtracksearch.la \
$(top_builddir)/packages/timefreq/src/libtimefreq.la
$(top_builddir)/packages/houghpulsar/src/libhoughpulsar.la
liblal_la_LIBADD = $(liblal_la_DEPENDENCIES) @LALLIBADD@
bin_PROGRAMS = lal-version
lal_version_SOURCES = lal-version.c
......
......@@ -11,7 +11,6 @@ SUBDIRS = \
tdfilter \
window \
fft \
clremoval \
inspiral \
noisemodels \
bank \
......@@ -19,9 +18,6 @@ SUBDIRS = \
findchirp \
pulsar \
houghpulsar \
burstsearch \
tracksearch \
timefreq \
support
include-links:
......
## Process this file with automake to produce Makefile.in
SUBDIRS = include src test doc
## Process this file with automake to produce Makefile.in
DOCSOURCEFILES = burstsearch.tex
MOSTLYCLEANFILES = .dvi-dep
CLEANFILES = main.dvi main.pdf main.ps
EXTRA_DIST = $(DOCSOURCEFILES)
dvi-local: .dvi-dep
distclean-local:
-rm -fr .adoc
@DOCMKFILE@
## Process this file with automake to produce Makefile.in
pkginclude_HEADERS = Thresholds.h TFTransform.h EPSearch.h
all-local: include-link
@INCLUDEMKFILE@
/*
* Copyright (C) 2007 Jolien Creighton, Julien Sylvestre, Kipp Cannon
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with with program; see the file COPYING. If not, write to the
* Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston,
* MA 02111-1307 USA
*/
/*-----------------------------------------------------------------------
*
* File Name: StdBurstSearch.h
*
* Author: Julien Sylvestre
*
* Revision: $$
*
*-----------------------------------------------------------------------
*/
#if 0
<lalVerbatim file="StdBurstSearchHV">
Author: Julien Sylvestre
$$
</lalVerbatim>
<lalLaTeX file="StdBurstSearchH">
\section{Header \texttt{StdBurstSearch.h}}
\label{s:StdBurstSearch.h}
Provides a standard environment for burst event trigger generators.
\subsection*{Synopsis}
\begin{verbatim}
#include <lal/StdBurstSearch.h>
\end{verbatim}
\subsection*{Error Conditions}
\input{STDBURSTSEARCHHErrTab}
</lalLaTeX>
#endif
#ifndef _STDBURSTSEARCH_H
#define _STDBURSTSEARCH_H
#ifdef __cplusplus
extern "C" {
#pragma }
#endif
#include <lal/LALStdlib.h>
#include <lal/LALDatatypes.h>
#include <lal/LALRCSID.h>
#include <lal/IIRFilter.h>
#include <lal/RealFFT.h>
NRCSID( STDBURSTSEARCHH, "$Id$" );
#include <lal/LIGOMetadataTables.h>
/******************************** <lalErrTable file="STDBURSTSEARCHHErrTab"> */
#define STDBURSTSEARCHH_ENULLP 1
#define STDBURSTSEARCHH_EMEM 2
#define STDBURSTSEARCHH_EUINP 3
#define STDBURSTSEARCHH_EIN 4
#define STDBURSTSEARCHH_ENULLPI 5
#define STDBURSTSEARCHH_MSGENULLP "Null pointer"
#define STDBURSTSEARCHH_MSGEMEM "memory error"
#define STDBURSTSEARCHH_MSGEUINP "unimplemented feature requested"
#define STDBURSTSEARCHH_MSGEIN "invalid input"
#define STDBURSTSEARCHH_MSGENULLPI "Parameter is not of the right type, or null pointer"
/*************************************************** </lalErrTable> */
/* <lalVerbatim file="StdBurstSearchH"> */
#define STDBURSTSEARCHSKIP_STARTTIME 1
#define STDBURSTSEARCHSKIP_CENTRALFREQ 2
#define STDBURSTSEARCHSKIP_DURATION 4
#define STDBURSTSEARCHSKIP_BANDWIDTH 8
#define STDBURSTSEARCHSKIP_AMPLITUDE 16
#define STDBURSTSEARCHSKIP_CONFIDENCE 32
#define STDBURSTSEARCHSKIP_SNR 128
typedef struct tagBurstParameter {
struct tagBurstParameter *next;
CHAR *char_;
INT4 *int4_;
REAL4 *real4_;
REAL4Vector *real4vector_;
INT4 random;
} BurstParameter;
/* </lalVerbatim> */
/* <lalVerbatim file="StdBurstSearchH"> */
void
LALTFClustersETG(
LALStatus *status,
EventIDColumn *output,
REAL4TimeVectorSeries *input,
BurstParameter *params);
/* </lalVerbatim> */
/* <lalVerbatim file="StdBurstSearchH"> */
void
LALSlopeETG(
LALStatus *status,
EventIDColumn *output,
REAL4TimeVectorSeries *input,
BurstParameter *params
);
/* </lalVerbatim> */
/* <lalVerbatim file="StdBurstSearchH"> */
typedef struct
tagBurstOutputDataSegment
{
REAL4TimeVectorSeries *data;
REAL4FrequencySeries *spec;
COMPLEX8FrequencySeries *resp;
REAL4IIRFilter *preprocessing_filter;
}
BurstOutputDataSegment;
/* </lalVerbatim> */
/* <lalVerbatim file="StdBurstSearchH"> */
typedef struct tagBurstOutputParameters {
BurstOutputDataSegment *data; /* input data and metadata */
INT4 method; /* 0 for plain copy; 1 for standard */
UINT4 skip; /* estimation to skip */
} BurstOutputParameters;
/* </lalVerbatim> */
typedef struct tagBurstOutputSpecStat {
struct tagBurstOutputSpecStat *next;
REAL8 duration;
UINT4 nTime;
UINT4 nFreq;
REAL4 *wwin;
REAL8 norm;
RealFFTPlan *pfwd;
COMPLEX8FrequencySeries *resp;
REAL8 *P0;
REAL8 *Q;
} BurstOutputSpecStat;
typedef struct tagRiceLikelihoodParams {
REAL8 P;
REAL8 P0;
REAL8 Q;
} RiceLikelihoodParams;
void
LALRiceLikelihood(
LALStatus *status,
REAL8 *llik,
REAL8 P,
void *params
);
/* <lalVerbatim file="StdBurstSearchH"> */
void
LALBurstOutput(
LALStatus *status,
EventIDColumn *output, /* output linked list of events */
EventIDColumn *input, /* linked list of events from ETG */
BurstOutputParameters *params
);
/* </lalVerbatim> */
#ifdef __cplusplus
#pragma {
}
#endif
#endif /* _STDBURSTSEARCH_H */
## Process this file with automake to produce Makefile.in
noinst_LTLIBRARIES = libburstsearch.la
libburstsearch_la_SOURCES = Thresholds.c CreateTFPlane.c FreqSeriesToTFPlane.c EPSearch.c
INCLUDES = -I$(top_builddir)/include -I$(srcdir)/../include
This diff is collapsed.
## Process this file with automake to produce Makefile.in
check_PROGRAMS = ThresholdsTest
ThresholdsTest_SOURCES = ThresholdsTest.c
ThresholdsTest_LDADD = $(top_builddir)/packages/support/src/liblalsupport.la $(top_builddir)/lib/liblal.la
INCLUDES = -I$(top_builddir)/include -I$(srcdir)/../include
TESTS = ThresholdsTest
TESTS_ENVIRONMENT = 1>/dev/null
MOSTLYCLEANFILES = PrintVector.*
/*
* Copyright (C) 2007 Julien Sylvestre
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with with program; see the file COPYING. If not, write to the
* Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston,
* MA 02111-1307 USA
*/
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <lal/LALStdlib.h>
#include <lal/Random.h>
#include <lal/StdBurstSearch.h>
NRCSID (MAIN, "$Id$");
#define CHKST if(status.statusCode != 0) {REPORTSTATUS (&status); return -1;}
#define SetStringParameter(par_, str_) par_->next = (BurstParameter *)LALCalloc(1, sizeof(BurstParameter)); \
par_ = par_->next; \
par_->char_ = (CHAR *)LALCalloc(1+strlen(str_), sizeof(CHAR)); \
strcpy(par_->char_, str_)
#define SetINT4Parameter(par_, str_) par_->next = (BurstParameter *)LALCalloc(1, sizeof(BurstParameter)); \
par_ = par_->next; \
par_->int4_ = (INT4 *)LALCalloc(1, sizeof(INT4)); \
*(par_->int4_) = str_
#define SetREAL4Parameter(par_, str_) par_->next = (BurstParameter *)LALCalloc(1, sizeof(BurstParameter)); \
par_ = par_->next; \
par_->real4_ = (REAL4 *)LALCalloc(1, sizeof(REAL4)); \
*(par_->real4_) = str_
#define SetREAL4VectorParameter(par_, str_) par_->next = (BurstParameter *)LALCalloc(1, sizeof(BurstParameter)); \
par_ = par_->next; \
par_->real4vector_ = NULL; \
LALCreateVector(&status, &(par_->real4vector_), str_->length); \
CHKST \
memcpy(par_->real4vector_->data, str_->data, str_->length * sizeof(REAL4))
INT4 lalDebugLevel = 2; /* set to 2 for full debug */
INT4 main(INT4 argc, CHAR *argv[]) {
static LALStatus status;
BurstParameter params, *par;
EventIDColumn output, *optr;
REAL4TimeVectorSeries input;
REAL4VectorSequence vseq;
REAL4Vector *data = NULL;
RandomParams *rpar = NULL;
REAL4Vector *coef = NULL;
CHAR channel[10] = "H1:test";
UINT4 N = 10*16384; /* length of data */
UINT4 i;
/* create ramp */
LALCreateVector(&status, &coef, 10);
CHKST
for(i=0;i<coef->length;i++) {
coef->data[i] = (12.0*16384.0/990.0)*((REAL4)i - 4.5);
}
/* set parameters */
par = &params;
SetStringParameter(par,channel); /* channel name */
SetREAL4Parameter(par, 7000.0); /* threshold */
SetREAL4VectorParameter(par,coef); /* filter coefficients */
SetINT4Parameter(par, 49); /* number of points in clustering */
SetREAL4Parameter(par, 800.0); /* min frequency */
SetREAL4Parameter(par, 1200.0); /* max frequency */
/* create input */
LALCreateRandomParams(&status, &rpar, 0);
CHKST
LALCreateVector(&status, &data, N);
CHKST
input.deltaT = 1.0/16384.0;
input.epoch.gpsSeconds = 700000000;
input.epoch.gpsNanoSeconds = 0;
input.data = &vseq;
vseq.length = 1;
vseq.vectorLength = N;
vseq.data = data->data;
LALNormalDeviates(&status, data, rpar);
CHKST
LALDestroyRandomParams(&status, &rpar);
CHKST
/* run ETG */
LALSlopeETG(&status, &output, &input, &params);
CHKST
/* report output */
optr = output.next;
while(optr) {
printf("%s %s\t%s\t%u\t%u\t%g\t%g\t%g\n",optr->snglBurstTable->ifo, optr->snglBurstTable->search, optr->snglBurstTable->channel, optr->snglBurstTable->start_time.gpsSeconds, optr->snglBurstTable->start_time.gpsNanoSeconds, optr->snglBurstTable->duration, optr->snglBurstTable->central_freq, optr->snglBurstTable->bandwidth);
optr = optr->next;
}
/* clean up */
LALDestroyVector(&status, &coef);
CHKST
LALDestroyVector(&status, &data);
CHKST
optr = output.next;
while(optr) {
EventIDColumn *optrn = optr->next;
if(optr->snglTransdataTable) {
if(optr->snglTransdataTable->trans_data) {
LALFree(optr->snglTransdataTable->trans_data);
}
LALFree(optr->snglTransdataTable);
}
LALFree(optr->snglBurstTable);
LALFree(optr);
optr = optrn;
}
par = params.next;
while(par) {
BurstParameter *tpar = par->next;
if(par->char_) {
LALFree(par->char_);
}
if(par->int4_) {
LALFree(par->int4_);
}
if(par->real4_) {
LALFree(par->real4_);
}
if(par->real4vector_) {
if(par->real4vector_->data) {
LALDestroyVector(&status, &(par->real4vector_));
CHKST
}
}
LALFree(par);
par = tpar;
}
return 0;
}
/*
* Copyright (C) 2007 Jolien Creighton, Julien Sylvestre
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with with program; see the file COPYING. If not, write to the
* Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston,
* MA 02111-1307 USA
*/
#include <config.h>
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <strings.h>
#include <lal/LALStdlib.h>
#include <lal/Random.h>
#include <lal/StdBurstSearch.h>
#include <lal/AVFactories.h>
NRCSID (MAIN, "$Id$");
#define CHKST if(status.statusCode != 0) {REPORTSTATUS (&status); return -1;}
#define SetStringParameter(par_, str_) par_->next = (BurstParameter *)LALCalloc(1, sizeof(BurstParameter)); \
par_ = par_->next; \
par_->char_ = (CHAR *)LALCalloc(1+strlen(channel), sizeof(CHAR)); \
strcpy(par_->char_, str_)
#define SetINT4Parameter(par_, str_) par_->next = (BurstParameter *)LALCalloc(1, sizeof(BurstParameter)); \
par_ = par_->next; \
par_->int4_ = (INT4 *)LALCalloc(1, sizeof(INT4)); \
*(par_->int4_) = str_
#define SetREAL4Parameter(par_, str_) par_->next = (BurstParameter *)LALCalloc(1, sizeof(BurstParameter)); \
par_ = par_->next; \
par_->real4_ = (REAL4 *)LALCalloc(1, sizeof(REAL4)); \
*(par_->real4_) = str_
#ifndef WORDS_BIGENDIAN
static void endian_swap(char * pdata, int dsize, int nelements);
#endif
INT4 lalDebugLevel = 0; /* set to 2 for full debug, painfully slow with tfclusters */
INT4 main(INT4 argc, CHAR *argv[]) {
static LALStatus status;
BurstParameter params, *par;
BurstOutputParameters oparams;
EventIDColumn output, stdOutput, *optr, *ooptr;
REAL4TimeVectorSeries input;
REAL4Vector *data = NULL;
RandomParams *rpar = NULL;
BurstOutputDataSegment Mdata;
COMPLEX8FrequencySeries resp;
REAL4VectorSequence vseq;
CHAR channel[10] = "H1:test";
UINT4 N = 10*16384; /* length of data */
UINT4 i;
bzero(&output,sizeof(EventIDColumn));
bzero(&stdOutput,sizeof(EventIDColumn));
/* set parameters */
par = &params;
SetStringParameter(par,channel); /* channel name */
SetREAL4Parameter(par, 0.08); /* black pixel probability */
SetINT4Parameter(par, 1); /* windowing? */
SetINT4Parameter(par, 0); /* threshold method */
SetINT4Parameter(par, 0); /* set to 1 to report tf information */
SetREAL4Parameter(par, 0.125); /* time resolution */
SetREAL4Parameter(par, 8); /* min frequency */
SetREAL4Parameter(par, 8184); /* max frequency */
SetREAL4Parameter(par, 0.5); /* alpha */
SetINT4Parameter(par, 5); /* sigma */
SetINT4Parameter(par, 0); /* delta(1,1) */
SetINT4Parameter(par, 0); /* delta(2,1) */
SetINT4Parameter(par, 0); /* delta(3,1) */
SetINT4Parameter(par, 0); /* delta(4,1) */
SetINT4Parameter(par, 0); /* delta(2,2) */
SetINT4Parameter(par, 0); /* delta(3,2) */
SetINT4Parameter(par, 2); /* delta(4,2) */
SetINT4Parameter(par, 3); /* delta(3,3) */
SetINT4Parameter(par, 4); /* delta(4,3) */
SetINT4Parameter(par, 4); /* delta(4,4) */
/* create input */
LALCreateRandomParams(&status, &rpar, 0);
CHKST
LALCreateVector(&status, &data, N);
CHKST
input.deltaT = 1.0/16384.0;
input.epoch.gpsSeconds = 700000000;
input.epoch.gpsNanoSeconds = 0;
input.data = &vseq;
vseq.length = 1;
vseq.vectorLength = N;
vseq.data = data->data;
LALNormalDeviates(&status, data, rpar);
CHKST
LALDestroyRandomParams(&status, &rpar);
CHKST
/* run ETG */
LALTFClustersETG(&status, &output, &input, &params);
CHKST
/* create flat response function */
resp.data = NULL;
resp.f0 = 0.0;
resp.deltaF = 0.1;
LALCCreateVector(&status, &(resp.data), 81920);
for(i=0;i<81920;i++) {
resp.data->data[i].re = resp.data->data[i].im = 1.0;
}
/* run std output */
Mdata.resp = &resp;
Mdata.data = &input;
oparams.data = &Mdata;
oparams.method = 1;
oparams.skip = 0;
LALBurstOutput(&status, &stdOutput, &output, &oparams);
CHKST