Skip to content

Commit

Permalink
Merge dev into main in preparation for v0.6.0 (#170)
Browse files Browse the repository at this point in the history
* Added spline interpolation code

* Integrate spline interp into qtransform

* Better case handling

* Did time interpolation more efficiently

* Make interpolation method an argument

* Correct location of qtile stacking

* Changed spline API and added data shape check

* Add spline to qtransform tests

* Separated data validation and added initial spline testing

* Added documentation

* Added error tests

* Correct tolerance

* Update Qscan

* Fix tests

* Specify output size for irfft

* add option to regularize scaler std (#166)

This is handy when scaling priors which have some parameters
fixed, i.e. delta functions

* Updates to `IMRPhenomP` api (#167)

* consolidate phenomp and phenomd apis

* use chirp mass for initializing tensor size

* fix ordering of parameters in tests

* add precessing spin conversion (#168)

* add precessing spin conversion

* add conversion file

* restructure waveforms module

* update tests

* add back generator

* add more robust fref check

* version bump to 0.6.0 (#169)

---------

Co-authored-by: William Benoit <[email protected]>
Co-authored-by: William Benoit <[email protected]>
Co-authored-by: William Benoit <[email protected]>
Co-authored-by: wbenoit26 <[email protected]>
Co-authored-by: Deep Chatterjee <[email protected]>
  • Loading branch information
6 people authored Dec 12, 2024
1 parent 0cdff78 commit fdebbb5
Show file tree
Hide file tree
Showing 24 changed files with 973 additions and 119 deletions.
29 changes: 10 additions & 19 deletions ml4gw/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,42 +4,33 @@

EulerGamma = 0.577215664901532860606512090082402431

# solar mass
MSUN = 1.988409902147041637325262574352366540e30 # kg
"""Solar mass"""

# Geometrized nominal solar mass, m
MRSUN = 1.476625038050124729627979840144936351e3
"""Geometrized nominal solar mass, m"""

# Newton's gravitational constant
G = 6.67430e-11 # m^3 / kg / s^2
"""Newton's gravitational constant"""

# Speed of light
C = 299792458.0 # m / s
"""Speed of light"""

"""Pi"""
# pi and 2pi
PI = 3.141592653589793238462643383279502884

TWO_PI = 6.283185307179586476925286766559005768

# G MSUN / C^3 in seconds
gt = G * MSUN / (C**3.0)
"""
G MSUN / C^3 in seconds
"""

# 1 solar mass in seconds. Same value as lal.MTSUN_SI
MTSUN_SI = 4.925490947641266978197229498498379006e-6
"""1 solar mass in seconds. Same value as lal.MTSUN_SI"""

# Meters per Mpc.
m_per_Mpc = 3.085677581491367278913937957796471611e22
"""
Meters per Mpc.
"""

# 1 Mpc in seconds.
MPC_SEC = m_per_Mpc / C
"""
1 Mpc in seconds.
"""

# Speed of light in vacuum (:math:`c`), in gigaparsecs per second
clightGpc = C / 3.0856778570831e22
"""
Speed of light in vacuum (:math:`c`), in gigaparsecs per second
"""
2 changes: 1 addition & 1 deletion ml4gw/spectral.py
Original file line number Diff line number Diff line change
Expand Up @@ -441,7 +441,7 @@ def normalize_by_psd(

# convert back to the time domain and normalize
# TODO: what's this normalization factor?
X = torch.fft.irfft(X_tilde, norm="forward", dim=-1)
X = torch.fft.irfft(X_tilde, n=X.shape[-1], norm="forward", dim=-1)
X = X.float() / sample_rate**0.5

# slice off corrupted data at edges of kernel
Expand Down
1 change: 1 addition & 0 deletions ml4gw/transforms/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,6 @@
from .snr_rescaler import SnrRescaler
from .spectral import SpectralDensity
from .spectrogram import MultiResolutionSpectrogram
from .spline_interpolation import SplineInterpolate
from .waveforms import WaveformProjector, WaveformSampler
from .whitening import FixedWhiten, Whiten
Loading

0 comments on commit fdebbb5

Please sign in to comment.