Git Product home page Git Product logo

bilby's Introduction

Hi πŸ‘‹, I am Aditya!

I am a postdoctoral fellow at CITA.

More information about me can be found on my personal website! Here are some quick links:

CV | Publications

bilby's People

Contributors

adivijaykumar avatar asb5468 avatar bruce-edelman avatar ceciliogq avatar colmtalbot avatar cplb avatar dbkeitel avatar duncanmmacleod avatar gregoryashton avatar hoyc1 avatar isaaclegred avatar isobelmarguarethe avatar johnveitch avatar josh-willis avatar kwwette avatar litingxiao avatar marcarene avatar mattcarney106 avatar mattpitkin avatar mj-will avatar moritzthomashuebner avatar mpuerrer avatar nsar16 avatar oliviawilk avatar plasky avatar rorysmith avatar smorisaki avatar transientlunatic avatar vivienr avatar wushichao avatar

Watchers

 avatar  avatar

bilby's Issues

Warning with the new version

The _bessel_function_interped method is deprecated and will be removed, please update the implementation of phase marginalization to use bilby.gw.utils.ln_i0

Using different bins for different detectors throws errors

If one uses different bins for different detectors, one gets errors. The current code sets common bins for all detectors, even though it calculates stuff for all detectors. This is not a problem if the minimum frequency and the maximum frequency are the same across detectors, but would be a problem otherwise.

We were getting this error:

Traceback (most recent call last):
  File "bilby_likelihood_error.py", line 134, in <module>
    print("Relative Binning Likelihood:", likelihood_relbin.log_likelihood())
  File "/home/aditya.vijaykumar/work/relbin/bilby/bilby/gw/likelihood.py", line 1534, in log_likelihood
    return self.log_likelihood_ratio() + self.noise_log_likelihood()
  File "/home/aditya.vijaykumar/work/relbin/bilby/bilby/gw/likelihood.py", line 1544, in log_likelihood_ratio
    interferometer)
  File "/home/aditya.vijaykumar/work/relbin/bilby/bilby/gw/likelihood.py", line 1657, in compute_relative_ratio
    new_polarizations = self.waveform_generator.frequency_domain_strain(parameter_dictionary)
  File "/home/aditya.vijaykumar/work/relbin/bilby/bilby/gw/waveform_generator.py", line 129, in frequency_domain_strain
    transformed_model_data_points=self.time_array)
  File "/home/aditya.vijaykumar/work/relbin/bilby/bilby/gw/waveform_generator.py", line 165, in _calculate_strain
    if self.parameters == self._cache['parameters'] and self._cache['model'] == model and \
ValueError: The truth value of an array with more than one element is ambiguous. Use a.any() or a.all()
(relbin) [aditya.vijaykumar@dodo ~]$ vim /home/aditya.vijaykumar/work/relbin/bilby/bilby/gw/waveform_generator.py

Is the likelihood calculation correct?

I did a naive test run, and it seems that the distance estimates are a bit off. This could be due to the summary data calculation here

def compute_summary_data(self):

have done some weird gymnastics there. @Kruthi24 could you check if this is consistent? What you need to check is if we really need the division by 2 in each of a0, a1, b0, b1.

Error with conversion function

We are getting the following error (screenshots attached) when we use conversion_function= bilby.gw.conversion.generate_all_bns_parameters in bilby. run_sampler. This is due to the fact that in conversion.py, likelihood.calculate_snrs is being called instead of likelihood.calculate_snrs_from_summary_data. A temporary fix for this issue has been made here #5

Screen Shot 2020-11-04 at 10 05 00 PM
Screen Shot 2020-11-04 at 10 04 45 PM (1)

Error with scipy maximization

I’m getting a runtime error (screenshot attached) while using scipy differential evolution. I read somewhere that this might have something to do with the callable function (self.log_likelihood_ratio_relative_binning) not being picklable because somehow we might be using multiprocessing. But I don’t know how a picklable function should look like in OOP.

More details: This issue is popping up when we call self.find_maximum_likelihood_waveform to update the fiducial waveform. The scipy differential_evolution function is being called within the function get_best_fit_parameters.

bilby/bilby/gw/likelihood.py

Lines 1585 to 1593 in 9ab7608

def get_best_fit_parameters(self, initial_parameter_bounds, maxiter=500,
atol=1e-10):
# Walk uphill using differential evolution from scipy.
print('computing maxL parameters...')
print('par bounds',initial_parameter_bounds)
output = differential_evolution(
self.log_likelihood_ratio_relative_binning,
bounds=initial_parameter_bounds, atol=atol,
maxiter=maxiter)

Screen Shot 2020-11-04 at 9 52 19 PM

Accuracy of likelihood doesn't increase with the number of bins

When we change the number of bins by changing epsilon, the accuracy doesn't seem to improve.
To do:

  • Make setup_bins more readable. (@adivijaykumar #16)
  • Crosscheck the likelihood comparison plots for the bilby case. (@adivijaykumar)
  • Compare the setup_bins function in bilby to the one in IAS code. (@Kruthi24)
  • Incorporate masking in get_detector_response. (@Kruthi24)
  • Check if inteferometer.frequency_array and waveform_generator.frequency_array are consistent. (@Kruthi24)
  • Check for errors inlal_binary_black_hole_relativebinning and lal_binary_neutron_star_relativebinning. (@Kruthi24)

Issues at the edges of waveform ratio

Calculating the waveform ratio between the same waveform gives some spurious stuff at the bin edges.

image

import bilby
import matplotlib.pyplot as plt
import numpy as np

minimum_frequency = 20
duration = 4
sampling_frequency = 1024.0

injection_parameters = dict(
    chirp_mass=28.0,
    mass_ratio=0.8,
    a_1=0.4,
    a_2=0.3,
    tilt_1=0.5,
    tilt_2=1.0,
    phi_12=1.7,
    phi_jl=0.3,
    luminosity_distance=2000.0,
    theta_jn=0.4,
    psi=2.659,
    phase=1.3,
    geocent_time=1126259642.413,
    ra=1.375,
    dec=-1.2108,
    fiducial=1,
)

# Fixed arguments passed into the source model
waveform_arguments = dict(
    waveform_approximant="IMRPhenomXPHM",
    reference_frequency=50.0,
    minimum_frequency=minimum_frequency,
)

# Create the waveform_generator using a LAL BinaryBlackHole source function
waveform_generator = bilby.gw.WaveformGenerator(
    duration=duration,
    sampling_frequency=sampling_frequency,
    # frequency_domain_source_model=bilby.gw.source.lal_binary_black_hole,
    frequency_domain_source_model=bilby.gw.source.lal_binary_black_hole_relativebinning,
    parameter_conversion=bilby.gw.conversion.convert_to_lal_binary_black_hole_parameters,
    waveform_arguments=waveform_arguments,
)

# Set up interferometers.  In this case we'll use two interferometers
# (LIGO-Hanford (H1), LIGO-Livingston (L1). These default to their design
# sensitivity
ifos = bilby.gw.detector.InterferometerList(["H1", "L1"])
ifos.set_strain_data_from_power_spectral_densities(
    sampling_frequency=sampling_frequency,
    duration=duration,
    start_time=injection_parameters["geocent_time"] - 2,
)
ifos.inject_signal(
    waveform_generator=waveform_generator, parameters=injection_parameters
)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.