Commit 5474aab2 authored by Adam Mercer's avatar Adam Mercer

migrate SEOBNRv4p branch

parent 837952ed
image: docker:latest
variables:
DOCKER_DRIVER: overlay
# GIT_DEPTH: 1
COMMIT: $CI_REGISTRY_IMAGE:$CI_COMMIT_SHA
BRANCH: $CI_REGISTRY_IMAGE:$CI_COMMIT_REF_NAME
TAG: $CI_REGISTRY_IMAGE:$CI_COMMIT_TAG
LAL_DIR: $CI_PROJECT_DIR/opt/lalsuite
stages:
- level0
- level1
- level2
- level3
- level4
- nightly
- container
- tag
before_script:
- ulimit -S -c 0
- export VERBOSE="true"
- export PATH=/usr/lib/ccache:$PATH
- export CCACHE_DIR=${PWD}/ccache
- export PKG_CONFIG_PATH=${LAL_DIR}/lib/pkgconfig
- mkdir -p opt/lalsuite
cache:
key: $CI_JOB_NAME
paths:
- ccache
level0:lal:
image: ligo/lalsuite-dev:jessie
stage: level0
script:
- cd lal
- ./00boot
- ./configure --enable-swig --enable-doxygen --prefix=${LAL_DIR}
- make dist
- tar xf lal-*.tar.xz
- cd lal-*
- ./configure --enable-swig --enable-doxygen --prefix=${LAL_DIR}
- make -j4 V=1
- make -j4 V=1 check
- make -j4 install
- make -j4 install-html
artifacts:
expire_in: 3h
paths:
- opt/lalsuite
only:
- pushes
level1:lalframe:
image: ligo/lalsuite-dev:jessie
stage: level1
script:
- cd lalframe
- ./00boot
- ./configure --enable-swig --enable-doxygen --prefix=${LAL_DIR}
- make dist
- tar xf lalframe-*.tar.xz
- cd lalframe-*
- ./configure --enable-swig --enable-doxygen --prefix=${LAL_DIR}
- make -j4 V=1
- make -j4 V=1 check
- make -j4 install
- make -j4 install-html
artifacts:
expire_in: 3h
paths:
- opt/lalsuite
dependencies:
- level0:lal
only:
- pushes
level1:lalmetaio:
image: ligo/lalsuite-dev:jessie
stage: level1
script:
- cd lalmetaio
- ./00boot
- ./configure --enable-swig --enable-doxygen --prefix=${LAL_DIR}
- make dist
- tar xf lalmetaio-*.tar.xz
- cd lalmetaio-*
- ./configure --enable-swig --enable-doxygen --prefix=${LAL_DIR}
- make -j4 V=1
- make -j4 V=1 check
- make -j4 install
- make -j4 install-html
artifacts:
expire_in: 3h
paths:
- opt/lalsuite
dependencies:
- level0:lal
only:
- pushes
level1:lalsimulation:
image: ligo/lalsuite-dev:jessie
stage: level1
script:
- cd lalsimulation
- ./00boot
- ./configure --enable-swig --enable-doxygen --prefix=${LAL_DIR}
- make dist
- tar xf lalsimulation-*.tar.xz
- cd lalsimulation-*
- ./configure --enable-swig --enable-doxygen --prefix=${LAL_DIR}
- make -j4 V=1
- make -j4 V=1 check
- make -j4 install
- make -j4 install-html
artifacts:
expire_in: 3h
paths:
- opt/lalsuite
dependencies:
- level0:lal
only:
- pushes
level1:lalxml:
image: ligo/lalsuite-dev:jessie
stage: level1
script:
- cd lalxml
- ./00boot
- ./configure --enable-swig --enable-doxygen --prefix=${LAL_DIR}
- make dist
- tar xf lalxml-*.tar.xz
- cd lalxml-*
- ./configure --enable-swig --enable-doxygen --prefix=${LAL_DIR}
- make -j4 V=1
- make -j4 V=1 check
- make -j4 install
- make -j4 install-html
artifacts:
expire_in: 3h
paths:
- opt/lalsuite
dependencies:
- level0:lal
only:
- pushes
level2:lalburst:
image: ligo/lalsuite-dev:jessie
stage: level2
script:
- cd lalburst
- ./00boot
- ./configure --enable-swig --enable-doxygen --prefix=${LAL_DIR}
- make dist
- tar xf lalburst-*.tar.xz
- cd lalburst-*
- ./configure --enable-swig --enable-doxygen --prefix=${LAL_DIR}
- make -j4 V=1
- make -j4 V=1 check
- make -j4 install
- make -j4 install-html
artifacts:
expire_in: 3h
paths:
- opt/lalsuite
dependencies:
- level1:lalmetaio
- level1:lalsimulation
only:
- pushes
level2:lalinspiral:
image: ligo/lalsuite-dev:jessie
stage: level2
script:
- cd lalinspiral
- ./00boot
- ./configure --enable-swig --enable-doxygen --prefix=${LAL_DIR}
- make dist
- tar xf lalinspiral-*.tar.xz
- cd lalinspiral-*
- ./configure --enable-swig --enable-doxygen --prefix=${LAL_DIR}
- make -j4 V=1
- make -j4 V=1 check
- make -j4 install
- make -j4 install-html
artifacts:
expire_in: 3h
paths:
- opt/lalsuite
dependencies:
- level1:lalframe
- level1:lalmetaio
- level1:lalsimulation
only:
- pushes
level2:lalpulsar:
image: ligo/lalsuite-dev:jessie
stage: level2
script:
- cd lalpulsar
- ./00boot
- ./configure --enable-swig --enable-doxygen --prefix=${LAL_DIR}
- make dist
- tar xf lalpulsar-*.tar.xz
- cd lalpulsar-*
- ./configure --enable-swig --enable-doxygen --prefix=${LAL_DIR}
- make -j4 V=1
- make -j4 V=1 check
- make -j4 install
- make -j4 install-html
artifacts:
expire_in: 3h
paths:
- opt/lalsuite
dependencies:
- level1:lalxml
only:
- pushes
level2:lalstochastic:
image: ligo/lalsuite-dev:jessie
stage: level2
script:
- cd lalstochastic
- ./00boot
- ./configure --enable-swig --enable-doxygen --prefix=${LAL_DIR}
- make dist
- tar xf lalstochastic-*.tar.xz
- cd lalstochastic-*
- ./configure --enable-swig --enable-doxygen --prefix=${LAL_DIR}
- make -j4 V=1
- make -j4 V=1 check
- make -j4 install
- make -j4 install-html
artifacts:
expire_in: 3h
paths:
- opt/lalsuite
dependencies:
- level1:lalmetaio
only:
- pushes
level3:laldetchar:
image: ligo/lalsuite-dev:jessie
stage: level3
script:
- cd laldetchar
- ./00boot
- ./configure --enable-swig --enable-doxygen --prefix=${LAL_DIR}
- make dist
- tar xf laldetchar-*.tar.xz
- cd laldetchar-*
- ./configure --enable-swig --enable-doxygen --prefix=${LAL_DIR}
- make -j4 V=1
- make -j4 V=1 check
- make -j4 install
- make -j4 install-html
artifacts:
expire_in: 3h
paths:
- opt/lalsuite
dependencies:
- level2:lalburst
only:
- pushes
level3:lalinference:
image: ligo/lalsuite-dev:jessie
stage: level3
script:
- cd lalinference
- ./00boot
- ./configure --enable-swig --enable-doxygen --prefix=${LAL_DIR}
- make dist
- tar xf lalinference-*.tar.xz
- cd lalinference-*
- ./configure --enable-swig --enable-doxygen --prefix=${LAL_DIR}
- make -j4 V=1
- make -j4 V=1 check
- make -j4 install
- make -j4 install-html
artifacts:
expire_in: 3h
paths:
- opt/lalsuite
dependencies:
- level2:lalburst
- level2:lalinspiral
- level2:lalpulsar
only:
- pushes
level4:lalapps:
image: ligo/lalsuite-dev:jessie
stage: level4
script:
- cd lalapps
- ./00boot
- ./configure --enable-swig --enable-doxygen --prefix=${LAL_DIR}
- make dist
- tar xf lalapps-*.tar.xz
- cd lalapps-*
- ./configure --enable-swig --enable-doxygen --prefix=${LAL_DIR}
- make -j4 V=1
- make -j4 V=1 check
- make -j4 install
- make -j4 install-html
artifacts:
expire_in: 3h
paths:
- opt/lalsuite
dependencies:
- level2:lalstochastic
- level3:laldetchar
- level3:lalinference
only:
- pushes
nightly:top-level:el7:
image: ligo/lalsuite-dev:el7
stage: nightly
script:
- ./00boot
- ./configure --enable-swig --enable-doxygen
- make -j4 distcheck
only:
- schedules
- web
nightly:top-level:jessie:
image: ligo/lalsuite-dev:jessie
stage: nightly
script:
- ./00boot
- ./configure --enable-swig --enable-doxygen
- make -j4 distcheck
only:
- schedules
- web
nightly:top-level:stretch:
image: ligo/lalsuite-dev:stretch
stage: nightly
script:
- ./00boot
- ./configure --enable-swig --enable-doxygen
- make -j4 distcheck
only:
- schedules
- web
nightly:top-level:trusty:
image: skymoo/ligo-lalsuite-dev:trusty
stage: nightly
script:
- ./00boot
- ./configure --disable-swig --enable-doxygen
- make -j4 distcheck
only:
- schedules
- web
nightly:top-level:xenial:
image: skymoo/ligo-lalsuite-dev:xenial
stage: nightly
script:
- ./00boot
- ./configure --disable-swig --enable-doxygen
- make -j4 distcheck
only:
- schedules
- web
nightly:top-level:buster:
image: skymoo/ligo-lalsuite-dev:buster
stage: nightly
script:
- ./00boot
- ./configure --enable-swig-python --enable-doxygen
- make -j4 distcheck
only:
- schedules
- web
allow_failure: true
nightly:mpi:jessie:
image: ligo/lalsuite-dev:jessie
stage: nightly
script:
- ./00boot
- ./configure --enable-swig --enable-doxygen --enable-mpi
- make -j4 distcheck
only:
- schedules
- web
nightly:openmp:jessie:
image: ligo/lalsuite-dev:jessie
stage: nightly
script:
- ./00boot
- ./configure --enable-swig --enable-doxygen --enable-openmp
- make -j4 distcheck
only:
- schedules
- web
nightly:python3:stretch:
image: ligo/lalsuite-dev:stretch
stage: nightly
script:
- ./00boot
- PYTHON=python3 ./configure --enable-swig --enable-doxygen
- make -j4 distcheck
only:
- schedules
- web
pages:
image: ligo/lalsuite-dev:stretch
stage: nightly
script:
- ./00boot
- ./configure --enable-doxygen --prefix=${LAL_DIR}
- make -j4 install-html
- cp -r ${LAL_DIR}/share/doc public/
artifacts:
paths:
- public
only:
- master@adam-mercer/lalsuite-git-lfs
- schedules
- web
except:
- pushes
dockerize:
stage: container
before_script: []
script:
- docker login -u gitlab-ci-token -p $CI_JOB_TOKEN $CI_REGISTRY
- docker build --pull -t $COMMIT -t $BRANCH .
- docker push $COMMIT
dependencies:
- level4:lalapps
only:
- pushes
tagged:
stage: tag
only:
- tags
before_script: []
script:
- docker tag $COMMIT $TAG
- docker push $TAG
FROM ligo/lalsuite-runtime:jessie
COPY /opt/lalsuite /opt/lalsuite
ENV LD_LIBRARY_PATH="/opt/lalsuite/lib" \
OCTAVE_PATH="/opt/lalsuite/lib/x86_64-linux-gnu/octave/3.8.2/site/oct/x86_64-pc-linux-gnu" \
PATH="/opt/lalsuite/bin:${PATH}" \
PKG_CONFIG_PATH="/opt/lalsuite/lib/pkgconfig" \
PYTHONPATH="/opt/lalsuite/lib/python2.7/site-packages" \
# LALSuite
This is the main LALSuite development repository, past development is
captured in the repository below:
https://git.ligo.org/lscsoft/lalsuite-archive
This new repository utilizes [git-lfs](https://wiki.ligo.org/DASWG/GitLFS#Install_the_git_LFS_client) for the managament of large files and as such `git-lfs` needs to be installed and configured to correctly clone this repository. After installing `git-lfs` it can be configured using:
```
$ git lfs install
```
This only needs to be done once for each machine you access the repository. It can then be cloned using:
```
$ git clone git@git.ligo.org:lscsoft/lalsuite.git
```
...@@ -113,7 +113,7 @@ int main(int argc, char *argv[]) ...@@ -113,7 +113,7 @@ int main(int argc, char *argv[])
fp = stdin; fp = stdin;
else else
fp = fopen(fname, "r"); fp = fopen(fname, "r");
if (!fp) if (!output)
FAILURE("could not open file %s\n", fname); FAILURE("could not open file %s\n", fname);
readdata(&ndim, &dimlen, &data, &channames, &chanunits, fp); readdata(&ndim, &dimlen, &data, &channames, &chanunits, fp);
......
...@@ -22,6 +22,7 @@ Create a P-P plot to compare a posterior sample chain with a sky map. ...@@ -22,6 +22,7 @@ Create a P-P plot to compare a posterior sample chain with a sky map.
# Command line interface. # Command line interface.
from argparse import FileType from argparse import FileType
from lalinference.bayestar import command from lalinference.bayestar import command
parser = command.ArgumentParser()
parser = command.ArgumentParser(parents=[command.figure_parser]) parser = command.ArgumentParser(parents=[command.figure_parser])
parser.add_argument( parser.add_argument(
'skymap', metavar='SKYMAP.fits[.gz]', type=FileType('rb'), 'skymap', metavar='SKYMAP.fits[.gz]', type=FileType('rb'),
......
...@@ -54,11 +54,6 @@ import distutils.version ...@@ -54,11 +54,6 @@ import distutils.version
mpl_version = distutils.version.LooseVersion(matplotlib.__version__) mpl_version = distutils.version.LooseVersion(matplotlib.__version__)
def get_version():
from .. import InferenceVCSInfo as vcs_info
return vcs_info.name + ' ' + vcs_info.version
@contextlib.contextmanager @contextlib.contextmanager
def TemporaryDirectory(suffix='', prefix='tmp', dir=None, delete=True): def TemporaryDirectory(suffix='', prefix='tmp', dir=None, delete=True):
try: try:
...@@ -174,16 +169,7 @@ class MatplotlibFigureType(argparse.FileType): ...@@ -174,16 +169,7 @@ class MatplotlibFigureType(argparse.FileType):
def __save(self): def __save(self):
from matplotlib import pyplot as plt from matplotlib import pyplot as plt
_, ext = os.path.splitext(self.string) return plt.savefig(self.string)
ext = ext.lower()
program, _ = os.path.splitext(os.path.basename(sys.argv[0]))
cmdline = ' '.join([program] + sys.argv[1:])
metadata = {'Title': cmdline}
if ext == '.png':
metadata['Software'] = get_version()
elif ext in {'.pdf', '.ps', '.eps'}:
metadata['Creator'] = get_version()
return plt.savefig(self.string, metadata=metadata)
def __call__(self, string): def __call__(self, string):
from matplotlib import pyplot as plt from matplotlib import pyplot as plt
...@@ -298,7 +284,8 @@ del group ...@@ -298,7 +284,8 @@ del group
# Defer loading SWIG bindings until version string is needed. # Defer loading SWIG bindings until version string is needed.
class VersionAction(argparse._VersionAction): class VersionAction(argparse._VersionAction):
def __call__(self, parser, namespace, values, option_string=None): def __call__(self, parser, namespace, values, option_string=None):
self.version = get_version() from .. import InferenceVCSInfo
self.version = 'LALInference ' + InferenceVCSInfo.version
super(VersionAction, self).__call__( super(VersionAction, self).__call__(
parser, namespace, values, option_string) parser, namespace, values, option_string)
......
...@@ -109,9 +109,6 @@ class ChooseWaveformParams: ...@@ -109,9 +109,6 @@ class ChooseWaveformParams:
for k, p in ChooseWaveformParams._LAL_DICT_PARAMS.iteritems(): for k, p in ChooseWaveformParams._LAL_DICT_PARAMS.iteritems():
typfunc = ChooseWaveformParams._LAL_DICT_PTYPE[k] typfunc = ChooseWaveformParams._LAL_DICT_PTYPE[k]
typfunc(extra_params, k, getattr(self, p)) typfunc(extra_params, k, getattr(self, p))
# Properly add tidal parammeters
lalsim.SimInspiralWaveformParamsInsertTidalLambda1(extra_params, self.lambda1)
lalsim.SimInspiralWaveformParamsInsertTidalLambda2(extra_params, self.lambda2)
return extra_params return extra_params
def copy(self): def copy(self):
......
...@@ -42,9 +42,9 @@ from glue.ligolw.utils import process ...@@ -42,9 +42,9 @@ from glue.ligolw.utils import process
import lalsimulation import lalsimulation
from lalinference.rapid_pe import amrlib, lalsimutils, common_cl from lalinference.rapid_pe import amrlib, lalsimutils, common_cl
def get_cr_from_grid(cells, weight, cr_thr=0.9, min_n=None, max_n=None): def get_cr_from_grid(cells, weight, cr_thr=0.9):
""" """
Given a set of cells and the weight of that cell, calculate a N% CR including cells which contribute to that probability mass. If n is set, cr_thr is ignored and instead this many points are taken. Given a set of cells and the weight of that cell, calculate a N% CR including cells which contribute to that probability mass.
""" """
if cr_thr == 0.0: if cr_thr == 0.0:
return numpy.empty((0,)) return numpy.empty((0,))
...@@ -57,13 +57,8 @@ def get_cr_from_grid(cells, weight, cr_thr=0.9, min_n=None, max_n=None): ...@@ -57,13 +57,8 @@ def get_cr_from_grid(cells, weight, cr_thr=0.9, min_n=None, max_n=None):
cell_sort[:,0] = cell_sort[:,0].cumsum() cell_sort[:,0] = cell_sort[:,0].cumsum()
cell_sort[:,0] /= cell_sort[-1,0] cell_sort[:,0] /= cell_sort[-1,0]
# find the CR probability
idx = cell_sort[:,0].searchsorted(1-cr_thr) idx = cell_sort[:,0].searchsorted(1-cr_thr)
n_select = cell_sort.shape[0] - idx
if min_n is not None:
n_select = max(n_select, min_n)
if max_n is not None:
n_select = min(n_select, max_n)
idx = cell_sort.shape[0] - n_select
return cell_sort[idx:,1:] return cell_sort[idx:,1:]
...@@ -90,7 +85,7 @@ def find_olap_index(tree, intr_prms, exact=True, **kwargs): ...@@ -90,7 +85,7 @@ def find_olap_index(tree, intr_prms, exact=True, **kwargs):
pt = numpy.array([kwargs[k] for k in intr_prms]) pt = numpy.array([kwargs[k] for k in intr_prms])
# FIXME: Replace with standard function # FIXME: Replace with standard function
dist, m_idx = tree.query(numpy.atleast_2d(pt), k=1) dist, m_idx = tree.query(pt, k=1)
dist, m_idx = dist[0][0], int(m_idx[0][0]) dist, m_idx = dist[0][0], int(m_idx[0][0])
# FIXME: There's still some tolerance from floating point conversions # FIXME: There's still some tolerance from floating point conversions
...@@ -109,11 +104,6 @@ def write_to_xml(cells, intr_prms, pin_prms={}, fvals=None, fname=None, verbose= ...@@ -109,11 +104,6 @@ def write_to_xml(cells, intr_prms, pin_prms={}, fvals=None, fname=None, verbose=
process.append_process_params(xmldoc, procrow, process.process_params_from_dict(opts.__dict__)) process.append_process_params(xmldoc, procrow, process.process_params_from_dict(opts.__dict__))
rows = ["simulation_id", "process_id", "numrel_data"] rows = ["simulation_id", "process_id", "numrel_data"]
# Override eff_lambda to with psi0, its shoehorn column
if "eff_lambda" in intr_prms:
intr_prms[intr_prms.index("eff_lambda")] = "psi0"
if "deff_lambda" in intr_prms:
intr_prms[intr_prms.index("deff_lambda")] = "psi3"
rows += list(intr_prms) rows += list(intr_prms)
rows += list(pin_prms) rows += list(pin_prms)
if fvals is not None: if fvals is not None:
...@@ -152,7 +142,7 @@ def get_evidence_grid(points, res_pts, intr_prms, exact=False): ...@@ -152,7 +142,7 @@ def get_evidence_grid(points, res_pts, intr_prms, exact=False):
grid_idx = [] grid_idx = []
# Reorder the grid points to match their weight indices # Reorder the grid points to match their weight indices
for res in res_pts: for res in res_pts:
dist, idx = grid_tree.query(numpy.atleast_2d(res), k=1) dist, idx = grid_tree.query(res, k=1)
# Stupid floating point inexactitude... # Stupid floating point inexactitude...
#print res, selected[idx[0][0]] #print res, selected[idx[0][0]]
#assert numpy.allclose(res, selected[idx[0][0]]) #assert numpy.allclose(res, selected[idx[0][0]])
...@@ -192,16 +182,12 @@ grid_section.add_argument("--setup", help="Set up the initial grid based on temp ...@@ -192,16 +182,12 @@ grid_section.add_argument("--setup", help="Set up the initial grid based on temp
grid_section.add_argument("-t", "--tmplt-bank", help="XML file with template bank.") grid_section.add_argument("-t", "--tmplt-bank", help="XML file with template bank.")
grid_section.add_argument("-O", "--use-overlap", help="Use overlap information to define 'closeness'.") grid_section.add_argument("-O", "--use-overlap", help="Use overlap information to define 'closeness'.")
grid_section.add_argument("-T", "--overlap-threshold", type=float, help="Threshold on overlap value.") grid_section.add_argument("-T", "--overlap-threshold", type=float, help="Threshold on overlap value.")
grid_section.add_argument("-s", "--points-per-side", type=int, default=10, help="Number of points per side, default is 10.")
grid_section.add_argument("-I", "--initial-region", action="append", help="Override the initial region with a custom specification. Specify multiple times like, -I mass1=1.0,2.0 -I mass2=1.0,1.5")
grid_section.add_argument("-D", "--deactivate", action="store_true", help="Deactivate cells initially which have no template within them.") grid_section.add_argument("-D", "--deactivate", action="store_true", help="Deactivate cells initially which have no template within them.")
grid_section.add_argument("-P", "--prerefine", help="Refine this initial grid based on overlap values.") grid_section.add_argument("-P", "--prerefine", help="Refine this initial grid based on overlap values.")
refine_section = argp.add_argument_group("refine options", "Options for refining a pre-existing grid.") refine_section = argp.add_argument_group("refine options", "Options for refining a pre-existing grid.")
refine_section.add_argument("--refine", help="Refine a prexisting grid. Pass this option the grid points from previous levels (or the --setup) option.") refine_section.add_argument("--refine", help="Refine a prexisting grid. Pass this option the grid points from previous levels (or the --setup) option.")
refine_section.add_argument("-r", "--result-file", help="XML file containing newest result to refine.") refine_section.add_argument("-r", "--result-file", help="XML file containing newest result to refine.")
refine_section.add_argument("-M", "--max-n-points", help="Refine *at most* this many points, can override confidence region thresholds.")
refine_section.add_argument("-m", "--min-n-points", help="Refine *at least* this many points, can override confidence region thresholds.")
opts = argp.parse_args() opts = argp.parse_args()
...@@ -340,21 +326,15 @@ if opts.refine or opts.prerefine: ...@@ -340,21 +326,15 @@ if opts.refine or opts.prerefine:
init_region, region_labels = amrlib.load_init_region(opts.refine or opts.prerefine, get_labels=True) init_region, region_labels = amrlib.load_init_region(opts.refine or opts.prerefine, get_labels=True)
else: else:
####### BEGIN INITIAL GRID CODE ######### ####### BEGIN INITIAL GRID CODE #########
if opts.initial_region is None: init_region, idx = determine_region(pt, pts, ovrlp, opts.overlap_threshold, expand_prms)
init_region, idx = determine_region(pt, pts, ovrlp, opts.overlap_threshold, expand_prms) region_labels = intr_prms
region_labels = intr_prms # FIXME: To be reimplemented in a different way
# FIXME: To be reimplemented in a different way #if opts.expand_param is not None:
#if opts.expand_param is not None: #expand_param(init_region, opts.expand_param)
#expand_param(init_region, opts.expand_param)
else:
# Override initial region -- use with care
_, init_region = common_cl.parse_param(opts.initial_region)
region_labels = init_region.keys()
init_region = amrlib.Cell(numpy.vstack(init_region[k] for k in region_labels))
# TODO: Alternatively, check density of points in the region to determine # TODO: Alternatively, check density of points in the region to determine
# the points to a side # the points to a side