ml4gw 0.6.0__tar.gz → 0.6.1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of ml4gw might be problematic. Click here for more details.
- {ml4gw-0.6.0 → ml4gw-0.6.1}/PKG-INFO +1 -1
- {ml4gw-0.6.0 → ml4gw-0.6.1}/ml4gw/waveforms/cbc/phenom_d.py +13 -12
- {ml4gw-0.6.0 → ml4gw-0.6.1}/ml4gw/waveforms/cbc/taylorf2.py +6 -2
- {ml4gw-0.6.0 → ml4gw-0.6.1}/ml4gw/waveforms/conversion.py +17 -0
- {ml4gw-0.6.0 → ml4gw-0.6.1}/pyproject.toml +1 -1
- {ml4gw-0.6.0 → ml4gw-0.6.1}/README.md +0 -0
- {ml4gw-0.6.0 → ml4gw-0.6.1}/ml4gw/__init__.py +0 -0
- {ml4gw-0.6.0 → ml4gw-0.6.1}/ml4gw/augmentations.py +0 -0
- {ml4gw-0.6.0 → ml4gw-0.6.1}/ml4gw/constants.py +0 -0
- {ml4gw-0.6.0 → ml4gw-0.6.1}/ml4gw/dataloading/__init__.py +0 -0
- {ml4gw-0.6.0 → ml4gw-0.6.1}/ml4gw/dataloading/chunked_dataset.py +0 -0
- {ml4gw-0.6.0 → ml4gw-0.6.1}/ml4gw/dataloading/hdf5_dataset.py +0 -0
- {ml4gw-0.6.0 → ml4gw-0.6.1}/ml4gw/dataloading/in_memory_dataset.py +0 -0
- {ml4gw-0.6.0 → ml4gw-0.6.1}/ml4gw/distributions.py +0 -0
- {ml4gw-0.6.0 → ml4gw-0.6.1}/ml4gw/gw.py +0 -0
- {ml4gw-0.6.0 → ml4gw-0.6.1}/ml4gw/nn/__init__.py +0 -0
- {ml4gw-0.6.0 → ml4gw-0.6.1}/ml4gw/nn/autoencoder/__init__.py +0 -0
- {ml4gw-0.6.0 → ml4gw-0.6.1}/ml4gw/nn/autoencoder/base.py +0 -0
- {ml4gw-0.6.0 → ml4gw-0.6.1}/ml4gw/nn/autoencoder/convolutional.py +0 -0
- {ml4gw-0.6.0 → ml4gw-0.6.1}/ml4gw/nn/autoencoder/skip_connection.py +0 -0
- {ml4gw-0.6.0 → ml4gw-0.6.1}/ml4gw/nn/autoencoder/utils.py +0 -0
- {ml4gw-0.6.0 → ml4gw-0.6.1}/ml4gw/nn/norm.py +0 -0
- {ml4gw-0.6.0 → ml4gw-0.6.1}/ml4gw/nn/resnet/__init__.py +0 -0
- {ml4gw-0.6.0 → ml4gw-0.6.1}/ml4gw/nn/resnet/resnet_1d.py +0 -0
- {ml4gw-0.6.0 → ml4gw-0.6.1}/ml4gw/nn/resnet/resnet_2d.py +0 -0
- {ml4gw-0.6.0 → ml4gw-0.6.1}/ml4gw/nn/streaming/__init__.py +0 -0
- {ml4gw-0.6.0 → ml4gw-0.6.1}/ml4gw/nn/streaming/online_average.py +0 -0
- {ml4gw-0.6.0 → ml4gw-0.6.1}/ml4gw/nn/streaming/snapshotter.py +0 -0
- {ml4gw-0.6.0 → ml4gw-0.6.1}/ml4gw/spectral.py +0 -0
- {ml4gw-0.6.0 → ml4gw-0.6.1}/ml4gw/transforms/__init__.py +0 -0
- {ml4gw-0.6.0 → ml4gw-0.6.1}/ml4gw/transforms/pearson.py +0 -0
- {ml4gw-0.6.0 → ml4gw-0.6.1}/ml4gw/transforms/qtransform.py +0 -0
- {ml4gw-0.6.0 → ml4gw-0.6.1}/ml4gw/transforms/scaler.py +0 -0
- {ml4gw-0.6.0 → ml4gw-0.6.1}/ml4gw/transforms/snr_rescaler.py +0 -0
- {ml4gw-0.6.0 → ml4gw-0.6.1}/ml4gw/transforms/spectral.py +0 -0
- {ml4gw-0.6.0 → ml4gw-0.6.1}/ml4gw/transforms/spectrogram.py +0 -0
- {ml4gw-0.6.0 → ml4gw-0.6.1}/ml4gw/transforms/spline_interpolation.py +0 -0
- {ml4gw-0.6.0 → ml4gw-0.6.1}/ml4gw/transforms/transform.py +0 -0
- {ml4gw-0.6.0 → ml4gw-0.6.1}/ml4gw/transforms/waveforms.py +0 -0
- {ml4gw-0.6.0 → ml4gw-0.6.1}/ml4gw/transforms/whitening.py +0 -0
- {ml4gw-0.6.0 → ml4gw-0.6.1}/ml4gw/types.py +0 -0
- {ml4gw-0.6.0 → ml4gw-0.6.1}/ml4gw/utils/interferometer.py +0 -0
- {ml4gw-0.6.0 → ml4gw-0.6.1}/ml4gw/utils/slicing.py +0 -0
- {ml4gw-0.6.0 → ml4gw-0.6.1}/ml4gw/waveforms/__init__.py +0 -0
- {ml4gw-0.6.0 → ml4gw-0.6.1}/ml4gw/waveforms/adhoc/__init__.py +0 -0
- {ml4gw-0.6.0 → ml4gw-0.6.1}/ml4gw/waveforms/adhoc/ringdown.py +0 -0
- {ml4gw-0.6.0 → ml4gw-0.6.1}/ml4gw/waveforms/adhoc/sine_gaussian.py +0 -0
- {ml4gw-0.6.0 → ml4gw-0.6.1}/ml4gw/waveforms/cbc/__init__.py +0 -0
- {ml4gw-0.6.0 → ml4gw-0.6.1}/ml4gw/waveforms/cbc/phenom_d_data.py +0 -0
- {ml4gw-0.6.0 → ml4gw-0.6.1}/ml4gw/waveforms/cbc/phenom_p.py +0 -0
- {ml4gw-0.6.0 → ml4gw-0.6.1}/ml4gw/waveforms/generator.py +0 -0
|
@@ -590,18 +590,19 @@ class IMRPhenomD(TaylorF2):
|
|
|
590
590
|
return fRD, fDM
|
|
591
591
|
|
|
592
592
|
def fmaxCalc(self, fRD, fDM, gamma2, gamma3):
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
)
|
|
604
|
-
|
|
593
|
+
mask = gamma2 <= 1
|
|
594
|
+
# calculate result for gamma2 <= 1 case
|
|
595
|
+
sqrt_term = torch.sqrt(1 - gamma2.pow(2))
|
|
596
|
+
result_case1 = fRD + (fDM * (-1 + sqrt_term) * gamma3) / gamma2
|
|
597
|
+
|
|
598
|
+
# calculate result for gamma2 > 1 case
|
|
599
|
+
# i.e. don't add sqrt term
|
|
600
|
+
result_case2 = fRD + (-fDM * gamma3) / gamma2
|
|
601
|
+
|
|
602
|
+
# combine results using mask
|
|
603
|
+
result = torch.where(mask, result_case1, result_case2)
|
|
604
|
+
|
|
605
|
+
return torch.abs(result)
|
|
605
606
|
|
|
606
607
|
def _linear_interp_finspin(self, finspin):
|
|
607
608
|
# chi is a batch of final spins i.e. torch.Size([n])
|
|
@@ -4,6 +4,7 @@ from jaxtyping import Float
|
|
|
4
4
|
from ml4gw.constants import MPC_SEC, MTSUN_SI, PI
|
|
5
5
|
from ml4gw.constants import EulerGamma as GAMMA
|
|
6
6
|
from ml4gw.types import BatchTensor, FrequencySeries1d
|
|
7
|
+
from ml4gw.waveforms.conversion import chirp_mass_and_mass_ratio_to_components
|
|
7
8
|
|
|
8
9
|
|
|
9
10
|
class TaylorF2(torch.nn.Module):
|
|
@@ -60,8 +61,11 @@ class TaylorF2(torch.nn.Module):
|
|
|
60
61
|
or phic.shape[0] != inclination.shape[0]
|
|
61
62
|
):
|
|
62
63
|
raise RuntimeError("Tensors should have same batch size")
|
|
63
|
-
|
|
64
|
-
mass1 =
|
|
64
|
+
|
|
65
|
+
mass1, mass2 = chirp_mass_and_mass_ratio_to_components(
|
|
66
|
+
chirp_mass, mass_ratio
|
|
67
|
+
)
|
|
68
|
+
|
|
65
69
|
cfac = torch.cos(inclination)
|
|
66
70
|
pfac = 0.5 * (1.0 + cfac * cfac)
|
|
67
71
|
|
|
@@ -32,6 +32,23 @@ def XLALSimInspiralL_2PN(eta: BatchTensor):
|
|
|
32
32
|
return 1.5 + eta / 6.0
|
|
33
33
|
|
|
34
34
|
|
|
35
|
+
def chirp_mass_and_mass_ratio_to_components(
|
|
36
|
+
chirp_mass: BatchTensor, mass_ratio: BatchTensor
|
|
37
|
+
):
|
|
38
|
+
"""
|
|
39
|
+
Compute component masses from chirp mass and mass ratio.
|
|
40
|
+
Args:
|
|
41
|
+
chirp_mass: Tensor of chirp mass values
|
|
42
|
+
mass_ratio:
|
|
43
|
+
Tensor of mass ratio values, `m2 / m1`,
|
|
44
|
+
where m1 >= m2, so that mass_ratio <= 1
|
|
45
|
+
"""
|
|
46
|
+
total_mass = chirp_mass * (1 + mass_ratio) ** 1.2 / mass_ratio**0.6
|
|
47
|
+
mass_1 = total_mass / (1 + mass_ratio)
|
|
48
|
+
mass_2 = mass_1 * mass_ratio
|
|
49
|
+
return mass_1, mass_2
|
|
50
|
+
|
|
51
|
+
|
|
35
52
|
def bilby_spins_to_lalsim(
|
|
36
53
|
theta_jn: BatchTensor,
|
|
37
54
|
phi_jl: BatchTensor,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|