Commit f3eed81c authored by Sudarshan Ghonge's avatar Sudarshan Ghonge
Browse files

wqRevert "Update repo to only keep pipe-related files"

This reverts commit d0d6364f.
parent d0d6364f
Pipeline #305190 passed with stages
in 18 minutes and 47 seconds
# BayesWaveUtils
Python utilities for bayeswave plot generation and web page creation
Install with:
```
python setup.py install (--prefix=PREFIX)
```
# BayesWavePipe
Utilities for HTCondor workflow generation for the BayesWave gravitational wave
data analysis algorithm
An example configuration file example.ini is included with this package. You
can set up a demo analysis with e.g.,
```
bayeswave_pipe example.ini \
--trigger-time 1187008882.4457 \
--work-dir example \
--sim-data
```
TIP: it is recommended that you copy the config file elsewhere. Cluttering up
the source repository is bad.
#
# CMake packaging for BayesWave
# Copyright 2019 James Alexander Clark <james.clark@ligo.org>
# Based on CMake packaging for libframe & Frv by Duncan MacLeod <duncan.macleod@ligo.org>
#
# -- package info -----------
cmake_minimum_required(VERSION 3.12.0 FATAL_ERROR)
project(
bayeswave
LANGUAGES C
VERSION 1.0.6
DESCRIPTION "LIGO/VIRGO burst analysis algorithm"
HOMEPAGE_URL "https://git.ligo.org/lscsoft/bayeswave"
)
include(GNUInstallDirs)
include(CheckFunctionExists)
find_package(PkgConfig)
find_package(Git)
# -- build components -------
# C library | enable/disable with -DENABLE_C={yes,no} (default yes)
add_subdirectory(src)
#add_subdirectory(doc)
# -- packaging components ---
set(SPEC_IN "${CMAKE_CURRENT_SOURCE_DIR}/bayeswave.spec.in")
set(SPEC "${CMAKE_CURRENT_SOURCE_DIR}/bayeswave.spec")
configure_file(${SPEC_IN} ${SPEC} @ONLY)
# -- build tarball ----------
#
# to build a source tarball:
#
# mkdir dist
# pushd dist
# cmake ..
# cmake --build . --target package_source
#
set(CPACK_PACKAGE_MAJOR ${${PROJECT_NAME}_MAJOR_VERSION})
set(CPACK_PACKAGE_MINOR ${${PROJECT_NAME}_MINOR_VERSION})
set(CPACK_PACKAGE_PATCH ${${PROJECT_NAME}_PATCH_VERSION})
set(CPACK_PACKAGE_VERSION "${CPACK_PACKAGE_MAJOR}.${CPACK_PACKAGE_MINOR}.${CPACK_PACKAGE_PATCH}")
set(CPACK_SOURCE_GENERATOR TXZ)
set(CPACK_SOURCE_PACKAGE_FILE_NAME ${PROJECT_NAME}-${${PROJECT_NAME}_VERSION})
set(CPACK_SOURCE_IGNORE_FILES
"/.*~$/"
".*~$"
"\\\\.svn/"
"\\\\.git"
"build/"
"CMakeFiles/"
"CMakeCache.txt"
"_CPack_Packages/"
"\\\\.cmake"
"Makefile"
"\\\\.deps/"
"autom4te.cache/"
"\\\\.tar\\\\.xz"
)
include(CPack)
ARG BUILD_IMAGE
FROM $BUILD_IMAGE
ARG BUILD_DATE
ARG CI_COMMIT_SHA
# http://label-schema.org/rc1/
LABEL org.label-schema.schema-version="1.0"
LABEL org.label-schema.name="bayeswave-runtime"
LABEL org.label-schema.description="BayesWave: distinguish gravitational wave signals from noise and instrumental glitches"
LABEL org.label-schema.url="https://docs.ligo.org/lscsoft/bayeswave/"
LABEL org.label-schema.vcs-url="https://git.ligo.org/lscsoft/bayeswave"
LABEL org.label-schema.build-date="${BUILD_DATE}"
LABEL org.label-schema.vcs-ref="${CI_COMMIT_SHA}"
# Copy all the source into /tmp which we will empty later
COPY . /tmp
RUN cd /tmp && \
mkdir -p build && \
pushd build && \
cmake .. \
-DCMAKE_INSTALL_PREFIX= \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_EXPORT_COMPILE_COMMANDS=true && \
cmake --build . -- VERBOSE=1 && \
cmake --build . --target install && \
popd && \
pip install --no-cache /tmp/BayesWaveUtils && \
rm -rf /tmp/*
## Directories we may want to bind
RUN mkdir -p /cvmfs /hdfs /hadoop /etc/condor /test
COPY docker-entrypoint.sh /docker-entrypoint.sh
ENTRYPOINT ["/docker-entrypoint.sh"]
# BayesWaveUtils
Python utilities for bayeswave plot generation and web page creation
# BayesWave
Install with:
```
python setup.py install (--prefix=PREFIX)
```
**A Bayesian algorithm designed to robustly distinguish gravitational wave signals
from noise and instrumental glitches without relying on any prior assumptions of waveform morphology.**
# BayesWavePipe
**BayesWave produces posterior probability distributions directly on gravitational wave
signals and instrumental glitches, allowing robust, morphology-independent waveform reconstruction.**
Utilities for HTCondor workflow generation for the BayesWave gravitational wave
data analysis algorithm
See [arXiv:1410.3835](https://arxiv.org/abs/1410.3835) for an introduction to the BayesWave
algorithm.
An example configuration file example.ini is included with this package. You
can set up a demo analysis with e.g.,
*LSC/Virgo members*: See the [BayesWave wiki](https://wiki.ligo.org/Bursts/BayesWave) for further info
## Citations
### Citing the scientific publications that describe the algorithms
We request that
publications and other work arising from use of this code cite the following:
```
bayeswave_pipe example.ini \
--trigger-time 1187008882.4457 \
--work-dir example \
--sim-data
@ARTICLE{2015CQGra..32m5012C,
author = {{Cornish}, Neil J. and {Littenberg}, Tyson B.},
title = "{Bayeswave: Bayesian inference for gravitational wave bursts and
instrument glitches}",
journal = {Classical and Quantum Gravity},
keywords = {General Relativity and Quantum Cosmology, Astrophysics - High Energy
Astrophysical Phenomena, Astrophysics - Instrumentation and
Methods for Astrophysics},
year = 2015,
month = Jul,
volume = {32},
eid = {135012},
pages = {135012},
doi = {10.1088/0264-9381/32/13/135012},
archivePrefix = {arXiv},
eprint = {1410.3835},
primaryClass = {gr-qc},
adsurl = {https://ui.adsabs.harvard.edu/#abs/2015CQGra..32m5012C},
adsnote = {Provided by the SAO/NASA Astrophysics Data System}
}
@article{PhysRevD.91.084034,
title = {Bayesian inference for spectral estimation of gravitational wave detector noise},
author = {Littenberg, Tyson B. and Cornish, Neil J.},
journal = {Phys. Rev. D},
volume = {91},
issue = {8},
pages = {084034},
numpages = {13},
year = {2015},
month = {Apr},
publisher = {American Physical Society},
doi = {10.1103/PhysRevD.91.084034},
url = {https://link.aps.org/doi/10.1103/PhysRevD.91.084034}
}
@article{Cornish:2020dwh,
author = "Cornish, Neil J. and Littenberg, Tyson B. and B\'ecsy, Bence and Chatziioannou, Katerina and Clark, James A. and Ghonge, Sudarshan and Millhouse, Margaret",
title = "{BayesWave analysis pipeline in the era of gravitational wave observations}",
eprint = "2011.09494",
archivePrefix = "arXiv",
primaryClass = "gr-qc",
doi = "10.1103/PhysRevD.103.044006",
journal = "Phys. Rev. D",
volume = "103",
number = "4",
pages = "044006",
year = "2021"
}
```
TIP: it is recommended that you copy the config file elsewhere. Cluttering up
the source repository is bad.
### Citing the BayesWave Software
We also request that software developed from this code respository refers the URL of this project and indicates the code version (via e.g., tag and/or git hash) used for development.
## Contact
At this time, while the software is free to use, we cannot guarentee any
particular level of direct support. Interested individuals should direct questions to question@ligo.org
and we will strive to provide what assistance we can.
*LSC/Virgo members*: bayeswave@sympa.ligo.org, burst@ligo.org
## Installation and operation
* [Minimal quick-start guide](https://git.ligo.org/lscsoft/bayeswave/blob/master/doc/quickstart.md)
* [Full Installation instructions](https://git.ligo.org/lscsoft/bayeswave/blob/master/doc/install.md)
* [Running Analyses](https://git.ligo.org/lscsoft/bayeswave/blob/master/doc/running.md)
## Available Branches
There are two main branches (with corresponding singularity containers) in common use:
* Master: the main branch with latest features, active development and little guarentee of 100% functionality.
* Stable: functionally unchanged from O2. Should be considered the *reviewed, production-level* code.
Older SVN branches and tags are also available. Functionality is not
guarenteed, they have not been updated to work with the latest infrastructure
and are preserved purely for posterity.
## Contributing
Procedures for developing and contributing to this repository match those for
[lalsuite](https://git.ligo.org/lscsoft/lalsuite). The contribution guide for
lalsuite can be found
[here](https://git.ligo.org/lscsoft/lalsuite/blob/master/CONTRIBUTING.md)
Documentation is most conveniently provided via markdown (.md) files in the
repository itself. The page you are now reading is the `README.md` at the root
of the master branch. All other documentation should live in `doc`.
**TLDR**
* We use the fork/merge development model
* Development projects should take place on feature branches (*NOT* adhoc
sub-directories!)
This eliminates conflicts, ensures the master branch is always useable (no one
breaks the build etc) and means different features/branches are easily
found, used and contributed to.
So:
1. create your own fork of this repository
1. create a branch to develop some feature on the fork
1. make and commit changes
1. push that branch upstream
1. when development is complete, merge that branch's changes back into master
Full details of how to do this can be found in the [lalsuite contribution
guide](https://git.ligo.org/lscsoft/lalsuite/blob/master/CONTRIBUTING.md)
This is, first and foremost, a *source* repository. To reduce bloat and
simplify development, data products and analysis-specific scripts/configuration
files should really be hosted in separate repositories or archives which
document those analyses.
## Repository Structure
This repository has been cloned from the original svn repository at [
https://svn.ligo.caltech.edu/svn/bayeswave](
https://svn.ligo.caltech.edu/svn/bayeswave). Commit history, branches and tags
have been preserved and non-source directories have been excised from the
history. Some details of the svn->git transition can be found
[here](https://wiki.ligo.org/Bursts/BayesWave/BayesWaveGit).
The git master branch looks like:
* `src`: The main source directory. Includes all C code, header files and build tools
* `test`: Test scripts to check successful compilation and linking.
* `utils`: Python and bash utility scripts.
* `postprocess`: Python and bash post-processing (e.g., plots, webpages) scripts
* `BayesWavePipe`: A standalone python module for HTCondor workflow generation
Note that different branches in the original svn do not share a uniform
structure; if you cannot find the directory or file you're looking for, check
you're on the correct branch.
Name: @PROJECT_NAME@
Version: @PROJECT_VERSION@
Release: 1%{?dist}
Summary: @PROJECT_DESCRIPTION@
License: GPLv2
Source: http://software.ligo.org/lscsoft/source/%{name}-%{version}.tar.xz
URL: https://git.ligo.org/lscsoft/bayeswave
Packager: Duncan Macleod <duncan.macleod@ligo.org>
Prefix: %{_prefix}
# -- build requires ---------
BuildRequires: gcc, gcc-c++, glibc
BuildRequires: cmake3 >= 3.12.0
BuildRequires: make
BuildRequires: help2man
BuildRequires: gsl-devel
BuildRequires: fftw-devel
BuildRequires: lal-devel
BuildRequires: lalframe-devel
BuildRequires: lalsimulation-devel
BuildRequires: lalinference-devel
Requires: fftw
Requires: gsl
Requires: lal
Requires: lalframe
Requires: lalsimulation
Requires: lalinference
# -- package definitions ----
%description
A Bayesian algorithm designed to robustly distinguish gravitational wave
signals from noise and instrumental glitches without relying on any prior
assumptions of waveform morphology.
BayesWave produces posterior probability distributions directly on
gravitational wave signals and instrumental glitches, allowing robust,
morphology-independent waveform reconstruction.
%package devel
Summary: Files and documentation needed for compiling bayeswave programs
Requires: %{name} = %{version}
Requires: fftw-devel
Requires: gsl-devel
Requires: lal-devel
Requires: lalframe-devel
Requires: lalsimulation-devel
Requires: lalinference-devel
%description devel
A Bayesian algorithm designed to robustly distinguish gravitational wave
signals from noise and instrumental glitches without relying on any prior
assumptions of waveform morphology.
This package contains the files needed for building bayeswave programs
# -- build stages -----------
%prep
%setup -n %{name}-%{version}
%build
%cmake3 \
-DCMAKE_BUILD_TYPE=Release .
%make_build
%install
%make_install
# man pages
mkdir -vp %{buildroot}%{_mandir}/man1
export LD_LIBRARY_PATH="%{buildroot}%{_libdir}:${LD_LIBRARY_PATH}"
help2man --source %{name} --version-string %{version} \
--section 1 --no-info --no-discard-stderr \
--output %{buildroot}%{_mandir}/man1/BayesWave.1 %{buildroot}%{_bindir}/BayesWave
help2man --source %{name} --version-string %{version} \
--section 1 --no-info --no-discard-stderr \
--output %{buildroot}%{_mandir}/man1/BayesWaveCleanFrame.1 %{buildroot}%{_bindir}/BayesWaveCleanFrame
help2man --source %{name} --version-string %{version} \
--section 1 --no-info --no-discard-stderr \
--output %{buildroot}%{_mandir}/man1/BayesWavePost.1 %{buildroot}%{_bindir}/BayesWavePost
help2man --source %{name} --version-string %{version} \
--section 1 --no-info --no-discard-stderr \
--output %{buildroot}%{_mandir}/man1/BayesWaveToLALPSD.1 %{buildroot}%{_bindir}/BayesWaveToLALPSD
%check
export LD_LIBRARY_PATH="%{buildroot}%{_libdir}:${LD_LIBRARY_PATH}"
export PKG_CONFIG_PATH="%{buildroot}%{_libdir}/pkgconfig:${PKG_CONFIG_PATH}"
# run each executable with no args (equivalent of --help)
%{buildroot}%{_bindir}/BayesWave
%{buildroot}%{_bindir}/BayesWaveCleanFrame
%{buildroot}%{_bindir}/BayesWavePost
%{buildroot}%{_bindir}/BayesWaveToLALPSD
# run pkg-config to check metadata
pkg-config --modversion @PROJECT_NAME@
%clean
rm -rf %{buildroot}
# -- files ------------------
%files
%{_bindir}/*
%{_libdir}/*.so.*
%{_mandir}/man1/*
%files devel
%{_libdir}/*.so
%{_libdir}/pkgconfig/*
%{_includedir}/*
# -- changelog --------------
# dates should be formatted using: 'date +"%a %b %d %Y"'
%changelog
* Thu Jun 6 2019 Duncan Macleod <duncan.macleod@ligo.org> 1.3.0-1
- Rework packaging for cmake
#!/bin/bash
set -e
INSTALL_PREFIX=$1
# Get cmake
if hash cmake 2>/dev/null; then
CMAKE=cmake
# Check version >2
CMAKE_VERSION=$(${CMAKE} --version | head -1 | awk '{print $3}')
CMAKE_VERSION=( ${CMAKE_VERSION//./ } )
CMAKE_MAJOR_VERSION=${CMAKE_VERSION[0]}
if [ ${CMAKE_MAJOR_VERSION} -lt 3 ]; then
echo "cmake executable is version ${CMAKE_VERSION}, checking for cmake3 executable..."
if hash cmake3 2> /dev/null; then
CMAKE=cmake3
else
echo "cmake3 not found"
exit 1
fi
fi
elif hash cmake3 2>/dev/null; then
CMAKE=cmake3
else
echo "No cmake detected. BayesWave requires cmake version 3."
exit 1
fi
${CMAKE} --version
rm -rf build
mkdir -p build
pushd build
${CMAKE} .. \
-DCMAKE_INSTALL_PREFIX=$INSTALL_PREFIX \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_EXPORT_COMPILE_COMMANDS=true
${CMAKE} --build . -- VERBOSE=1
${CMAKE} --build . --target install
popd
#!/bin/bash
source /venv/bin/activate
exec "$@"
#!/bin/bash -xe
# ----------------------------------------- #
# BAYESWAVE #
# ----------------------------------------- #
# source this file to access bayeswave
export BAYESWAVE_PREFIX=INSTALL_DIR
# Identify python version
pymajor=$(python -c 'import sys; print(sys.version_info[0])')
pyminor=$(python -c 'import sys; print(sys.version_info[1])')
# BayesWave
export PATH=${BAYESWAVE_PREFIX}/bin:${PATH}
export LD_LIBRARY_PATH=${BAYESWAVE_PREFIX}/lib:${LD_LIBRARY_PATH}
export LD_LIBRARY_PATH=${BAYESWAVE_PREFIX}/lib64:${LD_LIBRARY_PATH}
export PYTHONPATH=${BAYESWAVE_PREFIX}/lib/python${pymajor}.${pyminor}/site-packages:${PYTHONPATH}
......@@ -29,10 +29,24 @@ do
done
echo "Installing to ${install_dir}"
#
# Configure and make main executables
#
# START=${PWD}
# cd src
# autoreconf --verbose --force --install --make
# ./configure --prefix ${install_dir} CFLAGS="-Wno-format-truncation -g -O3"
# make install
# cd ${START}
./build.sh ${install_dir}
#
# Install python codes
#
pushd BayesWaveUtils
python setup.py install --prefix ${install_dir}
popd
#
# Environment script
#
......@@ -42,7 +56,7 @@ sed "s|INSTALL_DIR|${install_dir}|g" etc/bayeswave-user-env.sh > ${install_dir}/
echo ""
echo "*****************************************************************************"
echo " DONE: bayesWave_pipe built and installed to: "
echo " DONE: BayesWave built and installed to: "
echo " ${install_dir}"
echo " To use: "
echo " source ${install_dir}/etc/bayeswave-user-env.sh"
......
This diff is collapsed.
/*
* Copyright (C) 2018 Neil J. Cornish, Tyson B. Littenberg
*
* 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 <string.h>
#include <stdlib.h>
#include <math.h>
#include <unistd.h>
#include <getopt.h>
#include <gsl/gsl_sort.h>
#include <gsl/gsl_rng.h>
#include <gsl/gsl_randist.h>
#include <gsl/gsl_spline.h>
#include <gsl/gsl_statistics.h>
#define lAwidth 2.3 // 2.3 is one decade
#define ZETA 1.0
#define kappa_BL 0.8
#define FSTEP 10.0 // the stencil separation in Hz for the spline model. Going below 2 Hz is dangerous - will fight with line model
typedef struct
{
int n;
int size;
int *larray;
double *Q;
double *A;
double *f;
}lorentzianParams;
typedef struct
{
int tmax;
int ncut;
int nmin;
int sgmts;
double df;
double fny;
double Tobs;
double fmin;
double fmax;
double flow;
double fgrid;
double fstep;
double fhigh;
double cadence;
}dataParams;
typedef struct
{
int n;
double *points;
double *data;
}splineParams;
typedef struct
{
double SAmin;
double SAmax;
double LQmin;
double LQmax;
double LAmin;
double LAmax;
//double *invsigma; //variances for each frequency bin
double *sigma; //variances for each frequency bin
double *upper; //variances for each frequency bin
double *lower; //variances for each frequency bin
double *mean; //means for each frequency bin
}BayesLinePriors;
struct BayesLineParams
{
dataParams *data;
splineParams *spline;
splineParams *spline_x;
lorentzianParams *lines_x;
BayesLinePriors *priors;
double *Snf;
double *Sna;
double *fa;
double *freq;
double *power;
double *spow;
</