Git Product home page Git Product logo

bbhx's People

Contributors

astroparrotking avatar mikekatz04 avatar rjrosati avatar titodalcanton avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

bbhx's Issues

Is the output of LISA response function normalized?

I have read the example notebook and got confused with the unit of detector response. For example, y label in Out [4].

As shown in that figure, the unit of strain data is $\mathrm{Hz}^{-1/2}$. This means that the amplitude is normalized as $|\tilde{h}(f)|\sqrt{f}$. But, I do not think this normalization is adpoted here. Then, I agree the quantity represented by y-axis is $|\tilde{h}|$.

However, the LISA response is represented by fractional frequency shift and its unit is 1. Then, the unit of its Fourier transform should be $\mathrm{Hz}^{-1}$ since it is calculated within an integral in time domain. Therefore, I suspect there is a typo in the label.

Maybe I have some misunderstandings. I would thank your explanations greatly if you can let me know.

Allowing generation in TDI2

We are looking at analysing some TDI2 data, and realised that we can't make the waveforms in that definition.

We've identified this function as the one which will need editing.

I am happy to do this, but wanted to check whether there is anything you'd prefer me to try and avoid doing before I start, that would be great!

issues with generating low-mass BBH

@mikekatz04 Hello, Michael! Do you know why BBHx can't generate low-mass BBH?
Here I post a simple example:

import numpy as np
import matplotlib.pyplot as plt
from bbhx.waveformbuild import BBHWaveformFD
from bbhx.utils.constants import *


np.random.seed(111222)

wave_gen = BBHWaveformFD(amp_phase_kwargs=dict(run_phenomd=False))

# set parameters
f_ref = 0.0  # let phenom codes set f_ref -> fmax = max(f^2A(f))
phi_ref = 0.0 # phase at f_ref
# m1 = 38.9
# m2 = 31.6
m1 = 36
m2 = 29
a1 = 0.0
a2 = 0.0
dist = 18e3  * PC_SI * 1e6 * (410/3000) # 410 Mpc
inc = 0.0
beta = 1.5  # ecliptic latitude
lam = 1.1  # ecliptic longitude
psi = 0.0  # polarization angle
t_ref = 1.0 * YRSID_SI  # t_ref  (in the SSB reference frame)

# frequencies to interpolate to
freq_new = np.logspace(-4, 0, 10000)
modes = [(2,2)]

wave = wave_gen(m1, m2, a1, a2,
                dist, phi_ref, f_ref, inc, lam,
                beta, psi, t_ref, freqs=freq_new,
                modes=modes, direct=False, fill=True, squeeze=True, length=1024)[0]

for i, let in enumerate(["A", "E", "T"]):
    plt.loglog(freq_new, np.abs(wave[i]), label=let)
plt.xlim(0.2,)
plt.legend()
plt.xlabel("Frequency (Hz)")
plt.ylabel(r"$\tilde{h}(f)$ (Hz$^{-1/2}$)")
plt.show()

BBHx can generate TDI waveform for m1 = 38.9, m2 = 31.6, but not for m1 = 36, m2 = 29, it will show:

No CuPy
No CuPy or GPU PhenomHM module.
No CuPy or GPU response available.
No CuPy or GPU interpolation available.
Segmentation fault (core dumped)

Questions on Python requirements and install instructions

PyCBC runs a variety of CI tests on various Python versions, currently starting from 3.9, and some of these tests require BBHx. BBHx's recent requirement of Python 3.12 means that most of those tests now fail. I inspected BBHx's master branch after the introduction of the 3.12 requirement, and I was wondering if Python 3.12 is actually necessary. In fact, with a minimal modification, I managed to install BBHx in a Python 3.9 virtualenv, though I have not tested it [1].

Part of that modification included the realization that I had to run scripts/prebuild.py prior to running pip install .. This seems to be a recent change, not documented (yet?). I am not sure what the idea behind that extra step is, so I simply added an invocation of scripts/prebuild.py to setup.py.

I also dropped a coupe unnecessary imports, removed a stray Jupyter checkpoint that had been accidentally committed into the repository, and added a basic .gitignore file to prevent unwanted files from accidentally ending up in the repository.

The changes are in https://github.com/titodalcanton/BBHx/tree/py39-and-cleanup. If this all sounds ok, I can open a pull request.

[1] I did try running bbhx/tests/test_bbhx.py, but got ModuleNotFoundError: No module named 'lisatools.sensitivity', which I think is unrelated to the change I made.

Mutable default arguments

Hi @mikekatz04. Whilst trying to debug an issue in a downstream code, I realised that some of the keyword arguments in BBHx have mutable defaults, for example: https://github.com/mikekatz04/BBHx/blob/master/bbhx/waveformbuild.py#L285.

It turned out this wasn't the cause of the issue. However, in the process I made the relevant changes in my fork (https://github.com/mj-will/BBHx/tree/mutable-default-kwargs).

I'd be happy to open a PR with these changes if you think that would be helpful.

Error in installing dependencies

While installing BBHx package I faced the following issue:

(BBHx-lisa) abhishek@ BBHx % python setup.py install
running install
/Users/abhishek/opt/miniconda3/envs/BBHx-lisa/lib/python3.11/site-packages/setuptools/_distutils/cmd.py:66: SetuptoolsDeprecationWarning: setup.py install is deprecated.
!!

        ********************************************************************************
        Please avoid running ``setup.py`` directly.
        Instead, use pypa/build, pypa/installer, pypa/build or
        other standards-based tools.

        See https://blog.ganssle.io/articles/2021/10/setup-py-deprecated.html for details.
        ********************************************************************************

!!
  self.initialize_options()
/Users/abhishek/opt/miniconda3/envs/BBHx-lisa/lib/python3.11/site-packages/setuptools/_distutils/cmd.py:66: EasyInstallDeprecationWarning: easy_install command is deprecated.
!!

        ********************************************************************************
        Please avoid running ``setup.py`` and ``easy_install``.
        Instead, use pypa/build, pypa/installer, pypa/build or
        other standards-based tools.

        See https://github.com/pypa/setuptools/issues/917 for details.
        ********************************************************************************

!!
  self.initialize_options()
running bdist_egg
running egg_info
writing bbhx.egg-info/PKG-INFO
writing dependency_links to bbhx.egg-info/dependency_links.txt
writing top-level names to bbhx.egg-info/top_level.txt
reading manifest file 'bbhx.egg-info/SOURCES.txt'
adding license file 'LICENSE'
writing manifest file 'bbhx.egg-info/SOURCES.txt'
installing library code to build/bdist.macosx-11.1-arm64/egg
running install_lib
running build_py
copying bbhx/_version.py -> build/lib.macosx-11.1-arm64-cpython-311/bbhx
copying bbhx/utils/constants.py -> build/lib.macosx-11.1-arm64-cpython-311/bbhx/utils
running build_ext
cythoning src/phenomhm_cpu.pyx to src/phenomhm_cpu.cpp
/Users/abhishek/opt/miniconda3/envs/BBHx-lisa/lib/python3.11/site-packages/Cython/Compiler/Main.py:369: FutureWarning: Cython directive 'language_level' not set, using 2 for now (Py2). This will change in a later release! File: /Users/abhishek/envs/repos/BBHx/src/phenomhm_cpu.pyx
  tree = Parsing.p_module(s, pxd, full_module_name)
cythoning src/response_cpu.pyx to src/response_cpu.cpp
/Users/abhishek/opt/miniconda3/envs/BBHx-lisa/lib/python3.11/site-packages/Cython/Compiler/Main.py:369: FutureWarning: Cython directive 'language_level' not set, using 2 for now (Py2). This will change in a later release! File: /Users/abhishek/envs/repos/BBHx/src/response_cpu.pyx
  tree = Parsing.p_module(s, pxd, full_module_name)
cythoning src/interpolate_cpu.pyx to src/interpolate_cpu.cpp
/Users/abhishek/opt/miniconda3/envs/BBHx-lisa/lib/python3.11/site-packages/Cython/Compiler/Main.py:369: FutureWarning: Cython directive 'language_level' not set, using 2 for now (Py2). This will change in a later release! File: /Users/abhishek/envs/repos/BBHx/src/interpolate_cpu.pyx
  tree = Parsing.p_module(s, pxd, full_module_name)
cythoning src/waveformbuild_cpu.pyx to src/waveformbuild_cpu.cpp
/Users/abhishek/opt/miniconda3/envs/BBHx-lisa/lib/python3.11/site-packages/Cython/Compiler/Main.py:369: FutureWarning: Cython directive 'language_level' not set, using 2 for now (Py2). This will change in a later release! File: /Users/abhishek/envs/repos/BBHx/src/waveformbuild_cpu.pyx
  tree = Parsing.p_module(s, pxd, full_module_name)
cythoning src/likelihood_cpu.pyx to src/likelihood_cpu.cpp
/Users/abhishek/opt/miniconda3/envs/BBHx-lisa/lib/python3.11/site-packages/Cython/Compiler/Main.py:369: FutureWarning: Cython directive 'language_level' not set, using 2 for now (Py2). This will change in a later release! File: /Users/abhishek/envs/repos/BBHx/src/likelihood_cpu.pyx
  tree = Parsing.p_module(s, pxd, full_module_name)
building 'pyPhenomHM_cpu' extension
x86_64-apple-darwin13.4.0-clang -DNDEBUG -fwrapv -O2 -Wall -fPIC -O2 -isystem /Users/abhishek/opt/miniconda3/envs/BBHx-lisa/include -arch arm64 -fPIC -O2 -isystem /Users/abhishek/opt/miniconda3/envs/BBHx-lisa/include -arch arm64 -march=core2 -mtune=haswell -mssse3 -ftree-vectorize -fPIC -fPIE -fstack-protector-strong -O2 -pipe -isystem /Users/abhishek/opt/miniconda3/envs/BBHx-lisa/include -D_FORTIFY_SOURCE=2 -isystem /Users/abhishek/opt/miniconda3/envs/BBHx-lisa/include -I/Users/abhishek/opt/miniconda3/envs/BBHx-lisa/lib/python3.11/site-packages/numpy/core/include -Iinclude -I/Users/abhishek/opt/miniconda3/envs/BBHx-lisa/include/python3.11 -c src/PhenomHM.cpp -o build/temp.macosx-11.1-arm64-cpython-311/src/PhenomHM.o -std=c++11 -fopenmp
clang-16: error: unsupported argument 'core2' to option '-march='
error: command '/Users/abhishek/opt/miniconda3/envs/BBHx-lisa/bin/x86_64-apple-darwin13.4.0-clang' failed with exit code 1

I created a new conda environment BBHx-lisa and installed the following libraries, lapack=3.6.1 numpy scipy Cython jupyter ipython matplotlib pycbc and clang_osx-64 clangxx_osx-64 (I am using macOSX) following the instructions given in the readme.md. All the installations went successfully. After cloning the repository and running python setup.py install, I faced above error. Could you please help me in resolving this error and successfully install BBHx? Thank you in advance.

Not pip installable yet

This commit 01c54a5 moves some copy scripts into scripts/prebuild.py but they are somehow not run during the building despite the declaration in MANIFEST.in. As such, the installer complains

 ValueError: 'src/phenomhm_cpu.pyx' doesn't match any files

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.