sxs 2025.0.21__tar.gz → 2025.0.23__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.
- {sxs-2025.0.21 → sxs-2025.0.23}/CITATION.cff +2 -2
- {sxs-2025.0.21 → sxs-2025.0.23}/PKG-INFO +9 -3
- {sxs-2025.0.21 → sxs-2025.0.23}/README.md +8 -2
- sxs-2025.0.23/sxs/__version__.py +1 -0
- {sxs-2025.0.21 → sxs-2025.0.23}/sxs/handlers.py +3 -2
- {sxs-2025.0.21 → sxs-2025.0.23}/sxs/waveforms/__init__.py +2 -0
- sxs-2025.0.23/sxs/waveforms/format_handlers/lvcnr.py +111 -0
- {sxs-2025.0.21 → sxs-2025.0.23}/sxs/waveforms/memory.py +42 -6
- {sxs-2025.0.21 → sxs-2025.0.23}/sxs/waveforms/waveform_modes.py +24 -0
- sxs-2025.0.21/sxs/__version__.py +0 -1
- {sxs-2025.0.21 → sxs-2025.0.23}/.codecov.yml +0 -0
- {sxs-2025.0.21 → sxs-2025.0.23}/.github/ISSUE_TEMPLATE/catalog-data-issue-template.md +0 -0
- {sxs-2025.0.21 → sxs-2025.0.23}/.github/dependabot.yml +0 -0
- {sxs-2025.0.21 → sxs-2025.0.23}/.github/scripts/parse_bump_rule.py +0 -0
- {sxs-2025.0.21 → sxs-2025.0.23}/.github/workflows/build.yml +0 -0
- {sxs-2025.0.21 → sxs-2025.0.23}/.github/workflows/pr_rtd_link.yml +0 -0
- {sxs-2025.0.21 → sxs-2025.0.23}/.gitignore +0 -0
- {sxs-2025.0.21 → sxs-2025.0.23}/.readthedocs.yaml +0 -0
- {sxs-2025.0.21 → sxs-2025.0.23}/LICENSE +0 -0
- {sxs-2025.0.21 → sxs-2025.0.23}/docs/api/catalog.md +0 -0
- {sxs-2025.0.21 → sxs-2025.0.23}/docs/api/cite.md +0 -0
- {sxs-2025.0.21 → sxs-2025.0.23}/docs/api/horizons.md +0 -0
- {sxs-2025.0.21 → sxs-2025.0.23}/docs/api/load.md +0 -0
- {sxs-2025.0.21 → sxs-2025.0.23}/docs/api/metadata.md +0 -0
- {sxs-2025.0.21 → sxs-2025.0.23}/docs/api/simulation.md +0 -0
- {sxs-2025.0.21 → sxs-2025.0.23}/docs/api/simulations.md +0 -0
- {sxs-2025.0.21 → sxs-2025.0.23}/docs/api/time_series.md +0 -0
- {sxs-2025.0.21 → sxs-2025.0.23}/docs/api/waveforms.md +0 -0
- {sxs-2025.0.21 → sxs-2025.0.23}/docs/html/main.html +0 -0
- {sxs-2025.0.21 → sxs-2025.0.23}/docs/images/favicon.ico +0 -0
- {sxs-2025.0.21 → sxs-2025.0.23}/docs/index.md +0 -0
- {sxs-2025.0.21 → sxs-2025.0.23}/docs/javascript/mathjax.js +0 -0
- {sxs-2025.0.21 → sxs-2025.0.23}/docs/julia.md +0 -0
- {sxs-2025.0.21 → sxs-2025.0.23}/docs/mathematica.md +0 -0
- {sxs-2025.0.21 → sxs-2025.0.23}/docs/stylesheets/extra.css +0 -0
- {sxs-2025.0.21 → sxs-2025.0.23}/docs/tutorials/00-Introduction.ipynb +0 -0
- {sxs-2025.0.21 → sxs-2025.0.23}/docs/tutorials/01-Catalog_Dataframe.ipynb +0 -0
- {sxs-2025.0.21 → sxs-2025.0.23}/docs/tutorials/02-Simulation.ipynb +0 -0
- {sxs-2025.0.21 → sxs-2025.0.23}/docs/tutorials/03-Horizons.ipynb +0 -0
- {sxs-2025.0.21 → sxs-2025.0.23}/docs/tutorials/04-Waveforms.ipynb +0 -0
- {sxs-2025.0.21 → sxs-2025.0.23}/docs/tutorials/05-PreprocessingForFFTs.ipynb +0 -0
- {sxs-2025.0.21 → sxs-2025.0.23}/mkdocs.yml +0 -0
- {sxs-2025.0.21 → sxs-2025.0.23}/mkdocs_preprocess.py +0 -0
- {sxs-2025.0.21 → sxs-2025.0.23}/pyproject.toml +0 -0
- {sxs-2025.0.21 → sxs-2025.0.23}/sxs/__init__.py +0 -0
- {sxs-2025.0.21 → sxs-2025.0.23}/sxs/catalog/__init__.py +0 -0
- {sxs-2025.0.21 → sxs-2025.0.23}/sxs/catalog/catalog.py +0 -0
- {sxs-2025.0.21 → sxs-2025.0.23}/sxs/catalog/create.py +0 -0
- {sxs-2025.0.21 → sxs-2025.0.23}/sxs/catalog/description.py +0 -0
- {sxs-2025.0.21 → sxs-2025.0.23}/sxs/citation.py +0 -0
- {sxs-2025.0.21 → sxs-2025.0.23}/sxs/horizons/__init__.py +0 -0
- {sxs-2025.0.21 → sxs-2025.0.23}/sxs/horizons/spec_horizons_h5.py +0 -0
- {sxs-2025.0.21 → sxs-2025.0.23}/sxs/horizons/xor_multishuffle_bzip2.py +0 -0
- {sxs-2025.0.21 → sxs-2025.0.23}/sxs/julia/GWFrames.py +0 -0
- {sxs-2025.0.21 → sxs-2025.0.23}/sxs/julia/__init__.py +0 -0
- {sxs-2025.0.21 → sxs-2025.0.23}/sxs/juliapkg.json +0 -0
- {sxs-2025.0.21 → sxs-2025.0.23}/sxs/metadata/__init__.py +0 -0
- {sxs-2025.0.21 → sxs-2025.0.23}/sxs/metadata/metadata.py +0 -0
- {sxs-2025.0.21 → sxs-2025.0.23}/sxs/metadata/metric.py +0 -0
- {sxs-2025.0.21 → sxs-2025.0.23}/sxs/simulations/__init__.py +0 -0
- {sxs-2025.0.21 → sxs-2025.0.23}/sxs/simulations/analyze.py +0 -0
- {sxs-2025.0.21 → sxs-2025.0.23}/sxs/simulations/local.py +0 -0
- {sxs-2025.0.21 → sxs-2025.0.23}/sxs/simulations/simulation.py +0 -0
- {sxs-2025.0.21 → sxs-2025.0.23}/sxs/simulations/simulations.py +0 -0
- {sxs-2025.0.21 → sxs-2025.0.23}/sxs/time_series.py +0 -0
- {sxs-2025.0.21 → sxs-2025.0.23}/sxs/utilities/__init__.py +0 -0
- {sxs-2025.0.21 → sxs-2025.0.23}/sxs/utilities/bitwise.py +0 -0
- {sxs-2025.0.21 → sxs-2025.0.23}/sxs/utilities/decimation/__init__.py +0 -0
- {sxs-2025.0.21 → sxs-2025.0.23}/sxs/utilities/decimation/greedy_spline.py +0 -0
- {sxs-2025.0.21 → sxs-2025.0.23}/sxs/utilities/decimation/linear_bisection.py +0 -0
- {sxs-2025.0.21 → sxs-2025.0.23}/sxs/utilities/decimation/peak_greed.py +0 -0
- {sxs-2025.0.21 → sxs-2025.0.23}/sxs/utilities/decimation/suppression.py +0 -0
- {sxs-2025.0.21 → sxs-2025.0.23}/sxs/utilities/dicts.py +0 -0
- {sxs-2025.0.21 → sxs-2025.0.23}/sxs/utilities/downloads.py +0 -0
- {sxs-2025.0.21 → sxs-2025.0.23}/sxs/utilities/files.py +0 -0
- {sxs-2025.0.21 → sxs-2025.0.23}/sxs/utilities/formats.py +0 -0
- {sxs-2025.0.21 → sxs-2025.0.23}/sxs/utilities/inspire.py +0 -0
- {sxs-2025.0.21 → sxs-2025.0.23}/sxs/utilities/lvcnr/__init__.py +0 -0
- {sxs-2025.0.21 → sxs-2025.0.23}/sxs/utilities/lvcnr/comparisons.py +0 -0
- {sxs-2025.0.21 → sxs-2025.0.23}/sxs/utilities/lvcnr/conversion.py +0 -0
- {sxs-2025.0.21 → sxs-2025.0.23}/sxs/utilities/lvcnr/dataset.py +0 -0
- {sxs-2025.0.21 → sxs-2025.0.23}/sxs/utilities/lvcnr/horizons.py +0 -0
- {sxs-2025.0.21 → sxs-2025.0.23}/sxs/utilities/lvcnr/metadata.py +0 -0
- {sxs-2025.0.21 → sxs-2025.0.23}/sxs/utilities/lvcnr/waveform_amp_phase.py +0 -0
- {sxs-2025.0.21 → sxs-2025.0.23}/sxs/utilities/lvcnr/waveforms.py +0 -0
- {sxs-2025.0.21 → sxs-2025.0.23}/sxs/utilities/monotonicity.py +0 -0
- {sxs-2025.0.21 → sxs-2025.0.23}/sxs/utilities/pretty_print.py +0 -0
- {sxs-2025.0.21 → sxs-2025.0.23}/sxs/utilities/references/__init__.py +0 -0
- {sxs-2025.0.21 → sxs-2025.0.23}/sxs/utilities/references/ads.py +0 -0
- {sxs-2025.0.21 → sxs-2025.0.23}/sxs/utilities/references/arxiv.py +0 -0
- {sxs-2025.0.21 → sxs-2025.0.23}/sxs/utilities/references/fairchild_report.py +0 -0
- {sxs-2025.0.21 → sxs-2025.0.23}/sxs/utilities/references/inspire.py +0 -0
- {sxs-2025.0.21 → sxs-2025.0.23}/sxs/utilities/references/journal_abbreviations.py +0 -0
- {sxs-2025.0.21 → sxs-2025.0.23}/sxs/utilities/references/references.py +0 -0
- {sxs-2025.0.21 → sxs-2025.0.23}/sxs/utilities/select.py +0 -0
- {sxs-2025.0.21 → sxs-2025.0.23}/sxs/utilities/smooth_functions.py +0 -0
- {sxs-2025.0.21 → sxs-2025.0.23}/sxs/utilities/string_converters.py +0 -0
- {sxs-2025.0.21 → sxs-2025.0.23}/sxs/utilities/sxs_directories.py +0 -0
- {sxs-2025.0.21 → sxs-2025.0.23}/sxs/utilities/sxs_identifiers.py +0 -0
- {sxs-2025.0.21 → sxs-2025.0.23}/sxs/utilities/url.py +0 -0
- {sxs-2025.0.21 → sxs-2025.0.23}/sxs/waveforms/alignment.py +0 -0
- {sxs-2025.0.21 → sxs-2025.0.23}/sxs/waveforms/format_handlers/__init__.py +0 -0
- {sxs-2025.0.21 → sxs-2025.0.23}/sxs/waveforms/format_handlers/grathena.py +0 -0
- {sxs-2025.0.21 → sxs-2025.0.23}/sxs/waveforms/format_handlers/lvc.py +0 -0
- {sxs-2025.0.21 → sxs-2025.0.23}/sxs/waveforms/format_handlers/nrar.py +0 -0
- {sxs-2025.0.21 → sxs-2025.0.23}/sxs/waveforms/format_handlers/rotating_paired_diff_multishuffle_bzip2.py +0 -0
- {sxs-2025.0.21 → sxs-2025.0.23}/sxs/waveforms/format_handlers/rotating_paired_xor_multishuffle_bzip2.py +0 -0
- {sxs-2025.0.21 → sxs-2025.0.23}/sxs/waveforms/format_handlers/spectre_cce_v1.py +0 -0
- {sxs-2025.0.21 → sxs-2025.0.23}/sxs/waveforms/mode_utilities.py +0 -0
- {sxs-2025.0.21 → sxs-2025.0.23}/sxs/waveforms/norms.py +0 -0
- {sxs-2025.0.21 → sxs-2025.0.23}/sxs/waveforms/transformations.py +0 -0
- {sxs-2025.0.21 → sxs-2025.0.23}/sxs/waveforms/waveform_grid.py +0 -0
- {sxs-2025.0.21 → sxs-2025.0.23}/sxs/waveforms/waveform_mixin.py +0 -0
- {sxs-2025.0.21 → sxs-2025.0.23}/sxs/waveforms/waveform_mts.py +0 -0
- {sxs-2025.0.21 → sxs-2025.0.23}/sxs/waveforms/waveform_signal.py +0 -0
- {sxs-2025.0.21 → sxs-2025.0.23}/sxs/zenodo/__init__.py +0 -0
- {sxs-2025.0.21 → sxs-2025.0.23}/sxs/zenodo/api/__init__.py +0 -0
- {sxs-2025.0.21 → sxs-2025.0.23}/sxs/zenodo/api/deposit.py +0 -0
- {sxs-2025.0.21 → sxs-2025.0.23}/sxs/zenodo/api/login.py +0 -0
- {sxs-2025.0.21 → sxs-2025.0.23}/sxs/zenodo/api/records.py +0 -0
- {sxs-2025.0.21 → sxs-2025.0.23}/sxs/zenodo/catalog.py +0 -0
- {sxs-2025.0.21 → sxs-2025.0.23}/sxs/zenodo/creators.py +0 -0
- {sxs-2025.0.21 → sxs-2025.0.23}/sxs/zenodo/simannex.py +0 -0
- {sxs-2025.0.21 → sxs-2025.0.23}/sxs/zenodo/surrogatemodeling.py +0 -0
- {sxs-2025.0.21 → sxs-2025.0.23}/tests/__init__.py +0 -0
- {sxs-2025.0.21 → sxs-2025.0.23}/tests/conftest.py +0 -0
- {sxs-2025.0.21 → sxs-2025.0.23}/tests/test_alignment.py +0 -0
- {sxs-2025.0.21 → sxs-2025.0.23}/tests/test_catalog.py +0 -0
- {sxs-2025.0.21 → sxs-2025.0.23}/tests/test_horizons.py +0 -0
- {sxs-2025.0.21 → sxs-2025.0.23}/tests/test_julia.py +0 -0
- {sxs-2025.0.21 → sxs-2025.0.23}/tests/test_loader.py +0 -0
- {sxs-2025.0.21 → sxs-2025.0.23}/tests/test_metadata.py +0 -0
- {sxs-2025.0.21 → sxs-2025.0.23}/tests/test_simulation.py +0 -0
- {sxs-2025.0.21 → sxs-2025.0.23}/tests/test_time_series.py +0 -0
- {sxs-2025.0.21 → sxs-2025.0.23}/tests/test_transformations.py +0 -0
- {sxs-2025.0.21 → sxs-2025.0.23}/tests/test_utilities.py +0 -0
- {sxs-2025.0.21 → sxs-2025.0.23}/tests/test_waveform_rotations.py +0 -0
- {sxs-2025.0.21 → sxs-2025.0.23}/tests/test_waveforms.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: sxs
|
|
3
|
-
Version: 2025.0.
|
|
3
|
+
Version: 2025.0.23
|
|
4
4
|
Summary: Interface to data produced by the Simulating eXtreme Spacetimes collaboration
|
|
5
5
|
Project-URL: Homepage, https://github.com/sxs-collaboration/sxs
|
|
6
6
|
Project-URL: Documentation, https://sxs.readthedocs.io/
|
|
@@ -66,8 +66,14 @@ Description-Content-Type: text/markdown
|
|
|
66
66
|
> As described in our [latest paper](https://arxiv.org/abs/2505.13378), our
|
|
67
67
|
> waveforms now include memory effects. Specifically, when using any
|
|
68
68
|
> simulation with version 3 or greater, you should expect to see memory effects,
|
|
69
|
-
>
|
|
70
|
-
>
|
|
69
|
+
> resulting in ringdowns that do not approach 0 at late times.
|
|
70
|
+
> These effects are most prominent in the $(\ell, 0)$ modes for $\ell \\% 2 = 0$,
|
|
71
|
+
> but they can also appear in other modes if the system is asymmetric.
|
|
72
|
+
> If desired, these effects can be approximately removed by running, e.g.,
|
|
73
|
+
> ```
|
|
74
|
+
> sim = sxs.load("SXS:BBH:0123")
|
|
75
|
+
> h_without_memory = sim.h.remove_memory(sim.metadata.relaxation_time)
|
|
76
|
+
> ```
|
|
71
77
|
|
|
72
78
|
|
|
73
79
|
The `sxs` python package provides a high-level interface for using data
|
|
@@ -12,8 +12,14 @@
|
|
|
12
12
|
> As described in our [latest paper](https://arxiv.org/abs/2505.13378), our
|
|
13
13
|
> waveforms now include memory effects. Specifically, when using any
|
|
14
14
|
> simulation with version 3 or greater, you should expect to see memory effects,
|
|
15
|
-
>
|
|
16
|
-
>
|
|
15
|
+
> resulting in ringdowns that do not approach 0 at late times.
|
|
16
|
+
> These effects are most prominent in the $(\ell, 0)$ modes for $\ell \\% 2 = 0$,
|
|
17
|
+
> but they can also appear in other modes if the system is asymmetric.
|
|
18
|
+
> If desired, these effects can be approximately removed by running, e.g.,
|
|
19
|
+
> ```
|
|
20
|
+
> sim = sxs.load("SXS:BBH:0123")
|
|
21
|
+
> h_without_memory = sim.h.remove_memory(sim.metadata.relaxation_time)
|
|
22
|
+
> ```
|
|
17
23
|
|
|
18
24
|
|
|
19
25
|
The `sxs` python package provides a high-level interface for using data
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__version__ = "2025.0.23"
|
|
@@ -385,9 +385,10 @@ def load_via_sxs_id(
|
|
|
385
385
|
import requests
|
|
386
386
|
from .utilities import sxs_path_to_system_path
|
|
387
387
|
url = f"{doi_url}{sxsid}"
|
|
388
|
-
|
|
388
|
+
headers = {"User-Agent": "curl/8.18.0"}
|
|
389
|
+
response = requests.head(url, allow_redirects=True, timeout=timeout, headers=headers)
|
|
389
390
|
if response.status_code != 200:
|
|
390
|
-
raise ValueError(f"Could not load via DOI {url=}")
|
|
391
|
+
raise ValueError(f"Could not load via DOI {url=}, status_code = {response.status_code}, Response = {response.reason}")
|
|
391
392
|
final_url = f"{response.url}/{location}"
|
|
392
393
|
truepath = truepath or Path(sxs_path_to_system_path(sxsid)) / location
|
|
393
394
|
return load(final_url, download, cache, progress, truepath, **kwargs)
|
|
@@ -16,6 +16,7 @@ from .format_handlers import (
|
|
|
16
16
|
rotating_paired_xor_multishuffle_bzip2,
|
|
17
17
|
spectre_cce_v1,
|
|
18
18
|
grathena,
|
|
19
|
+
lvcnr,
|
|
19
20
|
)
|
|
20
21
|
from .format_handlers.lvc import to_lvc_conventions
|
|
21
22
|
from . import memory, transformations, alignment, norms
|
|
@@ -25,6 +26,7 @@ formats = {
|
|
|
25
26
|
None: nrar,
|
|
26
27
|
"": nrar,
|
|
27
28
|
"nrar": nrar,
|
|
29
|
+
"lvcnr": lvcnr,
|
|
28
30
|
"rotating_paired_xor_multishuffle_bzip2": rotating_paired_xor_multishuffle_bzip2,
|
|
29
31
|
"rpxm": rotating_paired_xor_multishuffle_bzip2,
|
|
30
32
|
"rpxmb": rotating_paired_xor_multishuffle_bzip2,
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
import re
|
|
2
|
+
import numpy as np
|
|
3
|
+
import h5py
|
|
4
|
+
from scipy.interpolate import InterpolatedUnivariateSpline as Spline
|
|
5
|
+
import spherical as sf
|
|
6
|
+
from ... import waveforms
|
|
7
|
+
|
|
8
|
+
def load(file_name, data_type="h"):
|
|
9
|
+
"""Load a waveform from an HDF5 file in the LVCNR format.
|
|
10
|
+
|
|
11
|
+
This function reads data from HDF5 files in the LVCNR format. It
|
|
12
|
+
extracts amplitude and phase information for spherical harmonic
|
|
13
|
+
modes and reconstructs the complex-valued data. This function can
|
|
14
|
+
be extended to further data types.
|
|
15
|
+
|
|
16
|
+
Parameters
|
|
17
|
+
----------
|
|
18
|
+
file_name : str
|
|
19
|
+
Path to the HDF5 file to be loaded.
|
|
20
|
+
|
|
21
|
+
data_type : str, optional
|
|
22
|
+
The type of data to be loaded. Default is "h" for strain.
|
|
23
|
+
|
|
24
|
+
Returns
|
|
25
|
+
-------
|
|
26
|
+
waveforms.WaveformModes
|
|
27
|
+
The loaded waveform data in WaveformModes format with spin
|
|
28
|
+
weight -2 and data type "h" (strain). The waveform includes
|
|
29
|
+
mode decomposition information with ell_min and ell_max
|
|
30
|
+
determined from the file contents. The data type can be
|
|
31
|
+
overridden if necessary, to accommodate other types of data
|
|
32
|
+
stored in LVCNR format.
|
|
33
|
+
"""
|
|
34
|
+
|
|
35
|
+
phase_re = re.compile("phase_l(?P<ell>.*)_m(?P<m>.*)")
|
|
36
|
+
|
|
37
|
+
with h5py.File(file_name, "r") as f:
|
|
38
|
+
|
|
39
|
+
# Find the NRTimes array. RIT and MAYA have different
|
|
40
|
+
# capitalizations.
|
|
41
|
+
nrtimes_matches = [
|
|
42
|
+
key for key in f if key.lower() == "nrtimes"
|
|
43
|
+
]
|
|
44
|
+
if not (len(nrtimes_matches) == 1 and
|
|
45
|
+
isinstance(f[nrtimes_matches[0]], h5py.Dataset)):
|
|
46
|
+
raise KeyError(
|
|
47
|
+
f"File {file_name} must contain exactly 1 Dataset "
|
|
48
|
+
"named NRTimes (case insensitive)"
|
|
49
|
+
)
|
|
50
|
+
|
|
51
|
+
t = f[nrtimes_matches[0]]
|
|
52
|
+
|
|
53
|
+
# Extract l and m values from the dataset keys
|
|
54
|
+
ell_m = np.array(
|
|
55
|
+
[
|
|
56
|
+
[int(match["ell"]), int(match["m"])]
|
|
57
|
+
for key in f
|
|
58
|
+
for match in [phase_re.match(key)]
|
|
59
|
+
if match
|
|
60
|
+
]
|
|
61
|
+
)
|
|
62
|
+
ell_min = np.min(ell_m[:, 0])
|
|
63
|
+
ell_max = np.max(ell_m[:, 0])
|
|
64
|
+
data = np.empty(
|
|
65
|
+
(t.size, sf.LM_total_size(ell_min, ell_max)),
|
|
66
|
+
dtype=complex
|
|
67
|
+
)
|
|
68
|
+
|
|
69
|
+
# Compose the data array using amplitude and phase datasets
|
|
70
|
+
for ell in range(ell_min, ell_max + 1):
|
|
71
|
+
for m in range(-ell, ell + 1):
|
|
72
|
+
amp = Spline(
|
|
73
|
+
f[f"amp_l{ell}_m{m}/X"][:],
|
|
74
|
+
f[f"amp_l{ell}_m{m}/Y"][:],
|
|
75
|
+
k=int(f[f"amp_l{ell}_m{m}/deg"][()])
|
|
76
|
+
)(t)
|
|
77
|
+
phase = Spline(
|
|
78
|
+
f[f"phase_l{ell}_m{m}/X"][:],
|
|
79
|
+
f[f"phase_l{ell}_m{m}/Y"][:],
|
|
80
|
+
k=int(f[f"phase_l{ell}_m{m}/deg"][()])
|
|
81
|
+
)(t)
|
|
82
|
+
idx = sf.LM_index(ell, m, ell_min)
|
|
83
|
+
data[:, idx] = amp * np.exp(1j * phase)
|
|
84
|
+
|
|
85
|
+
if "auxiliary-info" in f and \
|
|
86
|
+
"history.txt" in f["auxiliary-info"]:
|
|
87
|
+
history_txt = f["auxiliary-info/history.txt"][()].decode()
|
|
88
|
+
history = (
|
|
89
|
+
"### " + history_txt.replace("\n", "\n### ")
|
|
90
|
+
).split("\n")
|
|
91
|
+
else:
|
|
92
|
+
history = [""]
|
|
93
|
+
|
|
94
|
+
kwargs = dict(
|
|
95
|
+
time=t,
|
|
96
|
+
time_axis=0,
|
|
97
|
+
modes_axis=1,
|
|
98
|
+
spin_weight=-2,
|
|
99
|
+
data_type=data_type,
|
|
100
|
+
frame_type="inertial",
|
|
101
|
+
history=history,
|
|
102
|
+
version_hist=[],
|
|
103
|
+
r_is_scaled_out=True,
|
|
104
|
+
m_is_scaled_out=True,
|
|
105
|
+
ell_min=ell_min,
|
|
106
|
+
ell_max=ell_max,
|
|
107
|
+
)
|
|
108
|
+
|
|
109
|
+
w = waveforms.WaveformModes(data, **kwargs)
|
|
110
|
+
|
|
111
|
+
return w
|
|
@@ -2,14 +2,15 @@
|
|
|
2
2
|
|
|
3
3
|
This code is based on the paper "Adding Gravitational Memory to Waveform
|
|
4
4
|
Catalogs using BMS Balance Laws" by Mitman et al. The main result of that
|
|
5
|
-
paper is encapsulated in the `add_memory` function.
|
|
6
|
-
this
|
|
5
|
+
paper is encapsulated in the `add_memory` function. All waveforms in
|
|
6
|
+
versions > 1 contain memory, added via this function. If desired,
|
|
7
|
+
memory can be removed via the function 'remove_memory', e.g.,
|
|
7
8
|
|
|
8
9
|
```python
|
|
9
|
-
|
|
10
|
-
|
|
10
|
+
sim = sxs.load("SXS:BBH:0123")
|
|
11
|
+
h = sim.h
|
|
12
|
+
h_without_memory = sxs.waveforms.memory.remove_memory(h, integration_start_time=sim.metadata.relaxation_time)
|
|
11
13
|
```
|
|
12
|
-
|
|
13
14
|
"""
|
|
14
15
|
|
|
15
16
|
import numpy as np
|
|
@@ -209,7 +210,7 @@ def J_J(h):
|
|
|
209
210
|
|
|
210
211
|
|
|
211
212
|
def add_memory(h, integration_start_time=None, psi4=None):
|
|
212
|
-
"""Add electric component of null memory to strain and optionally psi4
|
|
213
|
+
"""Add electric component of null memory to strain and optionally psi4.
|
|
213
214
|
|
|
214
215
|
This adds the contribution from the energy flux to the strain, and
|
|
215
216
|
optionally adds minus the 2nd derivative of this contribution to psi4.
|
|
@@ -242,3 +243,38 @@ def add_memory(h, integration_start_time=None, psi4=None):
|
|
|
242
243
|
psi4_with_memory = WaveformModes(waveform_mts.MTS(psi4) - waveform_mts.MTS(h_memory_correction).ddot)
|
|
243
244
|
psi4_with_memory.register_modification(add_memory, integration_start_time=integration_start_time)
|
|
244
245
|
return (h_with_memory, psi4_with_memory)
|
|
246
|
+
|
|
247
|
+
def remove_memory(h, integration_start_time=None, psi4=None):
|
|
248
|
+
"""Remove electric component of null memory to strain and optionally psi4.
|
|
249
|
+
|
|
250
|
+
This removes the contribution from the energy flux to the strain, and
|
|
251
|
+
optionally removes minus the 2nd derivative of this contribution to psi4.
|
|
252
|
+
|
|
253
|
+
Parameters
|
|
254
|
+
----------
|
|
255
|
+
h : WaveformModes
|
|
256
|
+
WaveformModes object corresponding to the strain
|
|
257
|
+
integration_start_time : float, optional
|
|
258
|
+
Time at which the energy flux integral should begin. The default is
|
|
259
|
+
`h.t[0]`.
|
|
260
|
+
psi4 : WaveformModes, optional
|
|
261
|
+
WaveformModes object corresponding to psi4
|
|
262
|
+
|
|
263
|
+
Returns
|
|
264
|
+
-------
|
|
265
|
+
h_without_memory : WaveformModes
|
|
266
|
+
WaveformModes object corresponding to the strain with electric memory
|
|
267
|
+
psi4_without_memory : WaveformModes, optional
|
|
268
|
+
WaveformModes object corresponding to `psi4` with electric memory. If
|
|
269
|
+
`psi4` is `None`, then this is absent.
|
|
270
|
+
|
|
271
|
+
"""
|
|
272
|
+
h_memory_correction = J_E(h, integration_start_time=integration_start_time)
|
|
273
|
+
h_without_memory = WaveformModes(waveform_mts.MTS(h) - h_memory_correction)
|
|
274
|
+
h_without_memory.register_modification(remove_memory, integration_start_time=integration_start_time)
|
|
275
|
+
if psi4 is None:
|
|
276
|
+
return h_without_memory
|
|
277
|
+
else:
|
|
278
|
+
psi4_without_memory = WaveformModes(waveform_mts.MTS(psi4) + waveform_mts.MTS(h_memory_correction).ddot)
|
|
279
|
+
psi4_without_memory.register_modification(remove_memory, integration_start_time=integration_start_time)
|
|
280
|
+
return (h_without_memory, psi4_without_memory)
|
|
@@ -1358,8 +1358,32 @@ class WaveformModes(WaveformMixin, TimeSeries):
|
|
|
1358
1358
|
h_tilde = h_tilde[h_tilde.t.size//2:]
|
|
1359
1359
|
|
|
1360
1360
|
return h_tilde
|
|
1361
|
+
|
|
1362
|
+
def remove_memory(self, integration_start_time):
|
|
1363
|
+
"""Remove memory from a waveform.
|
|
1364
|
+
|
|
1365
|
+
This uses sxs.waveforms.memory.remove_memory to remove
|
|
1366
|
+
memory from the waveform. Note that to return the
|
|
1367
|
+
waveform to a state as close as possible to before the
|
|
1368
|
+
memory correction was applied, one should use the
|
|
1369
|
+
simulation's relaxation time as the `integration_start_time`.
|
|
1370
|
+
Even with this, however, the waveform will still be slightly
|
|
1371
|
+
altered as this process is not invertible.
|
|
1372
|
+
|
|
1373
|
+
Parameters
|
|
1374
|
+
----------
|
|
1375
|
+
integration_start_time : float
|
|
1376
|
+
The time at which to start the integration for the
|
|
1377
|
+
memory calculation. If this is not the relaxation time,
|
|
1378
|
+
then the memory removal may be worse.
|
|
1379
|
+
"""
|
|
1380
|
+
from .memory import remove_memory as raw_remove_memory
|
|
1361
1381
|
|
|
1382
|
+
h_without_memory = raw_remove_memory(self, integration_start_time=integration_start_time)
|
|
1362
1383
|
|
|
1384
|
+
return h_without_memory
|
|
1385
|
+
|
|
1386
|
+
|
|
1363
1387
|
class WaveformModesDict(MutableMapping, WaveformModes):
|
|
1364
1388
|
"""A dictionary-like class for storing waveform modes
|
|
1365
1389
|
|
sxs-2025.0.21/sxs/__version__.py
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
__version__ = "2025.0.21"
|
|
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
|
|
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
|
|
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
|