Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • john-veitch/bilby
  • duncanmmacleod/bilby
  • colm.talbot/bilby
  • lscsoft/bilby
  • matthew-pitkin/bilby
  • salvatore-vitale/tupak
  • charlie.hoy/bilby
  • bfarr/bilby
  • virginia.demilio/bilby
  • vivien/bilby
  • eric-howell/bilby
  • sebastian-khan/bilby
  • rhys.green/bilby
  • moritz.huebner/bilby
  • joseph.mills/bilby
  • scott.coughlin/bilby
  • matthew.carney/bilby
  • hyungwon.lee/bilby
  • monica.rizzo/bilby
  • christopher-berry/bilby
  • lindsay.demarchi/bilby
  • kaushik.rao/bilby
  • charles.kimball/bilby
  • andrew.matas/bilby
  • juan.calderonbustillo/bilby
  • patrick-meyers/bilby
  • hannah.middleton/bilby
  • eve.chase/bilby
  • grant.meadors/bilby
  • khun.phukon/bilby
  • sumeet.kulkarni/bilby
  • daniel.reardon/bilby
  • cjhaster/bilby
  • sylvia.biscoveanu/bilby
  • james-clark/bilby
  • meg.millhouse/bilby
  • joshua.willis/bilby
  • nikhil.sarin/bilby
  • paul.easter/bilby
  • youngmin/bilby
  • daniel-williams/bilby
  • shanika.galaudage/bilby
  • bruce.edelman/bilby
  • avi.vajpeyi/bilby
  • isobel.romero-shaw/bilby
  • andrew.kim/bilby
  • dominika.zieba/bilby
  • jonathan.davies/bilby
  • marc.arene/bilby
  • srishti.tiwari/bilby-tidal-heating-eccentric
  • aditya.vijaykumar/bilby
  • michael.williams/bilby
  • cecilio.garcia-quiros/bilby
  • rory-smith/bilby
  • maite.mateu-lucena/bilby
  • wushichao/bilby
  • kaylee.desoto/bilby
  • brandon.piotrzkowski/bilby
  • rossella.gamba/bilby
  • hunter.gabbard/bilby
  • deep.chatterjee/bilby
  • tathagata.ghosh/bilby
  • arunava.mukherjee/bilby
  • philip.relton/bilby
  • reed.essick/bilby
  • pawan.gupta/bilby
  • francisco.hernandez/bilby
  • rhiannon.udall/bilby
  • leo.tsukada/bilby
  • will-farr/bilby
  • vijay.varma/bilby
  • jeremy.baier/bilby
  • joshua.brandt/bilby
  • ethan.payne/bilby
  • ka-lok.lo/bilby
  • antoni.ramos-buades/bilby
  • oliviastephany.wilk/bilby
  • jack.heinzel/bilby
  • samson.leong/bilby-psi4
  • viviana.caceres/bilby
  • nadia.qutob/bilby
  • michael-coughlin/bilby
  • hemantakumar.phurailatpam/bilby
  • boris.goncharov/bilby
  • sama.al-shammari/bilby
  • siqi.zhong/bilby
  • jocelyn-read/bilby
  • marc.penuliar/bilby
  • stephanie.letourneau/bilby
  • alexandresebastien.goettel/bilby
  • alec.gunny/bilby
  • serguei.ossokine/bilby
  • pratyusava.baral/bilby
  • sophie.hourihane/bilby
  • eunsub/bilby
  • james.hart/bilby
  • pratyusava.baral/bilby-tg
  • zhaozc/bilby
  • pratyusava.baral/bilby_SoG
  • tomasz.baka/bilby
  • nicogerardo.bers/bilby
  • soumen.roy/bilby
  • isaac.mcmahon/healpix-redundancy
  • asamakai.baker/bilby-frequency-dependent-antenna-pattern-functions
  • anna.puecher/bilby
  • pratyusava.baral/bilby-x-g
  • thibeau.wouters/bilby
  • christian.adamcewicz/bilby
  • raffi.enficiaud/bilby
109 results
Show changes
Commits on Source (12)
# All notable changes will be documented in this file
## [2.1.1] 2023-04-28
Version 2.1.1 release of Bilby
Bugfix release
### Changes
- Fix the matched filter SNR phase for the multiband likelihood (!1253)
- Bugfix for Fisher matrix proposals in `bilby_mcmc` (!1251)
- Make the changes to the spline calibration backward compatible, 2.0.2 resume files can't be read with 2.1.0 (!1250)
## [2.1.0] 2023-04-12
Version 2.1.0 release of Bilby
......
......@@ -805,7 +805,7 @@ class FisherMatrixProposal(AdaptiveGaussianProposal):
weight=1,
update_interval=100,
scale_init=1e0,
fd_eps=1e-6,
fd_eps=1e-4,
adapt=False,
):
super(FisherMatrixProposal, self).__init__(
......@@ -827,7 +827,7 @@ class FisherMatrixProposal(AdaptiveGaussianProposal):
)
try:
self.iFIM = fmp.calculate_iFIM(sample.dict)
except (RuntimeError, ValueError) as e:
except (RuntimeError, ValueError, np.linalg.LinAlgError) as e:
logger.warning(f"FisherMatrixProposal failed with {e}")
if hasattr(self, "iFIM") is False:
# No past iFIM exists, return sample
......
......@@ -181,25 +181,39 @@ class CubicSpline(Recalibrate):
self.maximum_frequency = maximum_frequency
self._log_spline_points = np.linspace(
np.log10(minimum_frequency), np.log10(maximum_frequency), n_points)
self._delta_log_spline_points = self._log_spline_points[1] - self._log_spline_points[0]
# Precompute matrix converting values at nodes to spline coefficients.
# The algorithm for interpolation is described in
# https://dcc.ligo.org/LIGO-T2300140, and the matrix calculated here is
# to solve Eq. (9) in the note.
tmp1 = np.zeros(shape=(n_points, n_points))
@property
def delta_log_spline_points(self):
if not hasattr(self, "_delta_log_spline_points"):
self._delta_log_spline_points = self._log_spline_points[1] - self._log_spline_points[0]
return self._delta_log_spline_points
@property
def nodes_to_spline_coefficients(self):
if not hasattr(self, "_nodes_to_spline_coefficients"):
self._setup_spline_coefficients()
return self._nodes_to_spline_coefficients
def _setup_spline_coefficients(self):
"""
Precompute matrix converting values at nodes to spline coefficients.
The algorithm for interpolation is described in
https://dcc.ligo.org/LIGO-T2300140, and the matrix calculated here is
to solve Eq. (9) in the note.
"""
tmp1 = np.zeros(shape=(self.n_points, self.n_points))
tmp1[0, 0] = -1
tmp1[0, 1] = 2
tmp1[0, 2] = -1
tmp1[-1, -3] = -1
tmp1[-1, -2] = 2
tmp1[-1, -1] = -1
for i in range(1, n_points - 1):
for i in range(1, self.n_points - 1):
tmp1[i, i - 1] = 1 / 6
tmp1[i, i] = 2 / 3
tmp1[i, i + 1] = 1 / 6
tmp2 = np.zeros(shape=(n_points, n_points))
for i in range(1, n_points - 1):
tmp2 = np.zeros(shape=(self.n_points, self.n_points))
for i in range(1, self.n_points - 1):
tmp2[i, i - 1] = 1
tmp2[i, i] = -2
tmp2[i, i + 1] = 1
......@@ -213,6 +227,18 @@ class CubicSpline(Recalibrate):
return self.__class__.__name__ + '(prefix=\'{}\', minimum_frequency={}, maximum_frequency={}, n_points={})'\
.format(self.prefix, self.minimum_frequency, self.maximum_frequency, self.n_points)
def _evaluate_spline(self, kind, a, b, c, d, previous_nodes):
"""Evaluate Eq. (1) in https://dcc.ligo.org/LIGO-T2300140"""
parameters = np.array([self.params[f"{kind}_{ii}"] for ii in range(self.n_points)])
next_nodes = previous_nodes + 1
spline_coefficients = self.nodes_to_spline_coefficients.dot(parameters)
return (
a * parameters[previous_nodes]
+ b * parameters[next_nodes]
+ c * spline_coefficients[previous_nodes]
+ d * spline_coefficients[next_nodes]
)
def get_calibration_factor(self, frequency_array, **params):
"""Apply calibration model
......@@ -233,25 +259,17 @@ class CubicSpline(Recalibrate):
"""
log10f_per_deltalog10f = (
np.log10(frequency_array) - self.log_spline_points[0]
) / self._delta_log_spline_points
) / self.delta_log_spline_points
previous_nodes = np.clip(np.floor(log10f_per_deltalog10f).astype(int), a_min=0, a_max=self.n_points - 2)
next_nodes = previous_nodes + 1
b = log10f_per_deltalog10f - previous_nodes
a = 1 - b
c = (a**3 - a) / 6
d = (b**3 - b) / 6
self.set_calibration_parameters(**params)
amplitude_parameters = np.array([self.params['amplitude_{}'.format(ii)] for ii in range(self.n_points)])
_spline_coefficients = self._nodes_to_spline_coefficients.dot(amplitude_parameters)
delta_amplitude = a * amplitude_parameters[previous_nodes] + b * amplitude_parameters[next_nodes] + \
c * _spline_coefficients[previous_nodes] + d * _spline_coefficients[next_nodes]
phase_parameters = np.array([self.params['phase_{}'.format(ii)] for ii in range(self.n_points)])
_spline_coefficients = self._nodes_to_spline_coefficients.dot(phase_parameters)
delta_phase = a * phase_parameters[previous_nodes] + b * phase_parameters[next_nodes] + \
c * _spline_coefficients[previous_nodes] + d * _spline_coefficients[next_nodes]
delta_amplitude = self._evaluate_spline("amplitude", a, b, c, d, previous_nodes)
delta_phase = self._evaluate_spline("phase", a, b, c, d, previous_nodes)
calibration_factor = (1 + delta_amplitude) * (2 + 1j * delta_phase) / (2 - 1j * delta_phase)
return calibration_factor
......
......@@ -273,7 +273,7 @@ class InterferometerList(list):
"""
def to_pickle(self, outdir="outdir", label="ifo_list"):
utils.check_directory_exists_and_if_not_mkdir("outdir")
utils.check_directory_exists_and_if_not_mkdir(outdir)
label = label + "_" + "".join(ifo.name for ifo in self)
filename = self._filename_from_outdir_label_extension(
outdir, label, extension="pkl"
......
......@@ -736,7 +736,7 @@ class MBGravitationalWaveTransient(GravitationalWaveTransient):
strain *= np.exp(-1j * 2. * np.pi * self.banded_frequency_points * ifo_time)
strain *= calib_factor
d_inner_h = np.dot(strain, self.linear_coeffs[interferometer.name])
d_inner_h = np.conj(np.dot(strain, self.linear_coeffs[interferometer.name]))
if self.linear_interpolation:
optimal_snr_squared = np.vdot(
......
......@@ -44,7 +44,7 @@ RUN git clone https://github.com/PolyChord/PolyChordLite.git \
&& (cd PolyChordLite && python setup.py --no-mpi install)
# Install GW packages
RUN conda install -n ${{conda_env}} -c conda-forge python-lalsimulation bilby.cython
RUN conda install -n ${{conda_env}} -c conda-forge python-lalsimulation bilby.cython pyseobnr
RUN pip install ligo-gracedb gwpy ligo.skymap
# Add the ROQ data to the image
......
......@@ -46,7 +46,7 @@ RUN git clone https://github.com/PolyChord/PolyChordLite.git \
&& (cd PolyChordLite && python setup.py --no-mpi install)
# Install GW packages
RUN conda install -n ${conda_env} -c conda-forge python-lalsimulation bilby.cython
RUN conda install -n ${conda_env} -c conda-forge python-lalsimulation bilby.cython pyseobnr
RUN pip install ligo-gracedb gwpy ligo.skymap
# Add the ROQ data to the image
......
......@@ -46,7 +46,7 @@ RUN git clone https://github.com/PolyChord/PolyChordLite.git \
&& (cd PolyChordLite && python setup.py --no-mpi install)
# Install GW packages
RUN conda install -n ${conda_env} -c conda-forge python-lalsimulation bilby.cython
RUN conda install -n ${conda_env} -c conda-forge python-lalsimulation bilby.cython pyseobnr
RUN pip install ligo-gracedb gwpy ligo.skymap
# Add the ROQ data to the image
......
......@@ -46,7 +46,7 @@ RUN git clone https://github.com/PolyChord/PolyChordLite.git \
&& (cd PolyChordLite && python setup.py --no-mpi install)
# Install GW packages
RUN conda install -n ${conda_env} -c conda-forge python-lalsimulation bilby.cython
RUN conda install -n ${conda_env} -c conda-forge python-lalsimulation bilby.cython pyseobnr
RUN pip install ligo-gracedb gwpy ligo.skymap
# Add the ROQ data to the image
......