sxs 2024.0.4__tar.gz → 2024.0.5__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.
Files changed (128) hide show
  1. {sxs-2024.0.4 → sxs-2024.0.5}/CITATION.cff +2 -2
  2. {sxs-2024.0.4 → sxs-2024.0.5}/PKG-INFO +1 -1
  3. sxs-2024.0.5/sxs/__version__.py +1 -0
  4. {sxs-2024.0.4 → sxs-2024.0.5}/sxs/horizons/__init__.py +96 -1
  5. {sxs-2024.0.4 → sxs-2024.0.5}/sxs/simulations/simulation.py +31 -5
  6. {sxs-2024.0.4 → sxs-2024.0.5}/sxs/simulations/simulations.py +44 -41
  7. sxs-2024.0.4/sxs/__version__.py +0 -1
  8. {sxs-2024.0.4 → sxs-2024.0.5}/.codecov.yml +0 -0
  9. {sxs-2024.0.4 → sxs-2024.0.5}/.github/dependabot.yml +0 -0
  10. {sxs-2024.0.4 → sxs-2024.0.5}/.github/scripts/parse_bump_rule.py +0 -0
  11. {sxs-2024.0.4 → sxs-2024.0.5}/.github/workflows/build.yml +0 -0
  12. {sxs-2024.0.4 → sxs-2024.0.5}/.github/workflows/pr_rtd_link.yml +0 -0
  13. {sxs-2024.0.4 → sxs-2024.0.5}/.gitignore +0 -0
  14. {sxs-2024.0.4 → sxs-2024.0.5}/.readthedocs.yaml +0 -0
  15. {sxs-2024.0.4 → sxs-2024.0.5}/LICENSE +0 -0
  16. {sxs-2024.0.4 → sxs-2024.0.5}/README.md +0 -0
  17. {sxs-2024.0.4 → sxs-2024.0.5}/docs/api/catalog.md +0 -0
  18. {sxs-2024.0.4 → sxs-2024.0.5}/docs/api/horizons.md +0 -0
  19. {sxs-2024.0.4 → sxs-2024.0.5}/docs/api/load.md +0 -0
  20. {sxs-2024.0.4 → sxs-2024.0.5}/docs/api/metadata.md +0 -0
  21. {sxs-2024.0.4 → sxs-2024.0.5}/docs/api/simulation.md +0 -0
  22. {sxs-2024.0.4 → sxs-2024.0.5}/docs/api/simulations.md +0 -0
  23. {sxs-2024.0.4 → sxs-2024.0.5}/docs/api/time_series.md +0 -0
  24. {sxs-2024.0.4 → sxs-2024.0.5}/docs/api/waveforms.md +0 -0
  25. {sxs-2024.0.4 → sxs-2024.0.5}/docs/html/main.html +0 -0
  26. {sxs-2024.0.4 → sxs-2024.0.5}/docs/images/favicon.ico +0 -0
  27. {sxs-2024.0.4 → sxs-2024.0.5}/docs/index.md +0 -0
  28. {sxs-2024.0.4 → sxs-2024.0.5}/docs/javascript/mathjax.js +0 -0
  29. {sxs-2024.0.4 → sxs-2024.0.5}/docs/julia.md +0 -0
  30. {sxs-2024.0.4 → sxs-2024.0.5}/docs/mathematica.md +0 -0
  31. {sxs-2024.0.4 → sxs-2024.0.5}/docs/stylesheets/extra.css +0 -0
  32. {sxs-2024.0.4 → sxs-2024.0.5}/docs/tutorials/00-Introduction.ipynb +0 -0
  33. {sxs-2024.0.4 → sxs-2024.0.5}/docs/tutorials/01-Simulations_and_Metadata.ipynb +0 -0
  34. {sxs-2024.0.4 → sxs-2024.0.5}/docs/tutorials/02-Simulation.ipynb +0 -0
  35. {sxs-2024.0.4 → sxs-2024.0.5}/docs/tutorials/03-Horizons.ipynb +0 -0
  36. {sxs-2024.0.4 → sxs-2024.0.5}/docs/tutorials/04-Waveforms.ipynb +0 -0
  37. {sxs-2024.0.4 → sxs-2024.0.5}/docs/tutorials/05-PreprocessingForFFTs.ipynb +0 -0
  38. {sxs-2024.0.4 → sxs-2024.0.5}/mkdocs.yml +0 -0
  39. {sxs-2024.0.4 → sxs-2024.0.5}/pyproject.toml +0 -0
  40. {sxs-2024.0.4 → sxs-2024.0.5}/sxs/__init__.py +0 -0
  41. {sxs-2024.0.4 → sxs-2024.0.5}/sxs/caltechdata/__init__.py +0 -0
  42. {sxs-2024.0.4 → sxs-2024.0.5}/sxs/caltechdata/catalog.py +0 -0
  43. {sxs-2024.0.4 → sxs-2024.0.5}/sxs/caltechdata/login.py +0 -0
  44. {sxs-2024.0.4 → sxs-2024.0.5}/sxs/catalog/__init__.py +0 -0
  45. {sxs-2024.0.4 → sxs-2024.0.5}/sxs/catalog/catalog.py +0 -0
  46. {sxs-2024.0.4 → sxs-2024.0.5}/sxs/catalog/create.py +0 -0
  47. {sxs-2024.0.4 → sxs-2024.0.5}/sxs/catalog/description.py +0 -0
  48. {sxs-2024.0.4 → sxs-2024.0.5}/sxs/handlers.py +0 -0
  49. {sxs-2024.0.4 → sxs-2024.0.5}/sxs/horizons/spec_horizons_h5.py +0 -0
  50. {sxs-2024.0.4 → sxs-2024.0.5}/sxs/horizons/xor_multishuffle_bzip2.py +0 -0
  51. {sxs-2024.0.4 → sxs-2024.0.5}/sxs/julia/GWFrames.py +0 -0
  52. {sxs-2024.0.4 → sxs-2024.0.5}/sxs/julia/__init__.py +0 -0
  53. {sxs-2024.0.4 → sxs-2024.0.5}/sxs/juliapkg.json +0 -0
  54. {sxs-2024.0.4 → sxs-2024.0.5}/sxs/metadata/__init__.py +0 -0
  55. {sxs-2024.0.4 → sxs-2024.0.5}/sxs/metadata/metadata.py +0 -0
  56. {sxs-2024.0.4 → sxs-2024.0.5}/sxs/simulations/__init__.py +0 -0
  57. {sxs-2024.0.4 → sxs-2024.0.5}/sxs/time_series.py +0 -0
  58. {sxs-2024.0.4 → sxs-2024.0.5}/sxs/utilities/__init__.py +0 -0
  59. {sxs-2024.0.4 → sxs-2024.0.5}/sxs/utilities/bitwise.py +0 -0
  60. {sxs-2024.0.4 → sxs-2024.0.5}/sxs/utilities/decimation/__init__.py +0 -0
  61. {sxs-2024.0.4 → sxs-2024.0.5}/sxs/utilities/decimation/greedy_spline.py +0 -0
  62. {sxs-2024.0.4 → sxs-2024.0.5}/sxs/utilities/decimation/linear_bisection.py +0 -0
  63. {sxs-2024.0.4 → sxs-2024.0.5}/sxs/utilities/decimation/peak_greed.py +0 -0
  64. {sxs-2024.0.4 → sxs-2024.0.5}/sxs/utilities/decimation/suppression.py +0 -0
  65. {sxs-2024.0.4 → sxs-2024.0.5}/sxs/utilities/dicts.py +0 -0
  66. {sxs-2024.0.4 → sxs-2024.0.5}/sxs/utilities/downloads.py +0 -0
  67. {sxs-2024.0.4 → sxs-2024.0.5}/sxs/utilities/files.py +0 -0
  68. {sxs-2024.0.4 → sxs-2024.0.5}/sxs/utilities/formats.py +0 -0
  69. {sxs-2024.0.4 → sxs-2024.0.5}/sxs/utilities/inspire.py +0 -0
  70. {sxs-2024.0.4 → sxs-2024.0.5}/sxs/utilities/lvcnr/__init__.py +0 -0
  71. {sxs-2024.0.4 → sxs-2024.0.5}/sxs/utilities/lvcnr/comparisons.py +0 -0
  72. {sxs-2024.0.4 → sxs-2024.0.5}/sxs/utilities/lvcnr/conversion.py +0 -0
  73. {sxs-2024.0.4 → sxs-2024.0.5}/sxs/utilities/lvcnr/dataset.py +0 -0
  74. {sxs-2024.0.4 → sxs-2024.0.5}/sxs/utilities/lvcnr/horizons.py +0 -0
  75. {sxs-2024.0.4 → sxs-2024.0.5}/sxs/utilities/lvcnr/metadata.py +0 -0
  76. {sxs-2024.0.4 → sxs-2024.0.5}/sxs/utilities/lvcnr/waveform_amp_phase.py +0 -0
  77. {sxs-2024.0.4 → sxs-2024.0.5}/sxs/utilities/lvcnr/waveforms.py +0 -0
  78. {sxs-2024.0.4 → sxs-2024.0.5}/sxs/utilities/monotonicity.py +0 -0
  79. {sxs-2024.0.4 → sxs-2024.0.5}/sxs/utilities/pretty_print.py +0 -0
  80. {sxs-2024.0.4 → sxs-2024.0.5}/sxs/utilities/references/__init__.py +0 -0
  81. {sxs-2024.0.4 → sxs-2024.0.5}/sxs/utilities/references/ads.py +0 -0
  82. {sxs-2024.0.4 → sxs-2024.0.5}/sxs/utilities/references/arxiv.py +0 -0
  83. {sxs-2024.0.4 → sxs-2024.0.5}/sxs/utilities/references/fairchild_report.py +0 -0
  84. {sxs-2024.0.4 → sxs-2024.0.5}/sxs/utilities/references/inspire.py +0 -0
  85. {sxs-2024.0.4 → sxs-2024.0.5}/sxs/utilities/references/journal_abbreviations.py +0 -0
  86. {sxs-2024.0.4 → sxs-2024.0.5}/sxs/utilities/references/references.py +0 -0
  87. {sxs-2024.0.4 → sxs-2024.0.5}/sxs/utilities/select.py +0 -0
  88. {sxs-2024.0.4 → sxs-2024.0.5}/sxs/utilities/smooth_functions.py +0 -0
  89. {sxs-2024.0.4 → sxs-2024.0.5}/sxs/utilities/sxs_directories.py +0 -0
  90. {sxs-2024.0.4 → sxs-2024.0.5}/sxs/utilities/sxs_identifiers.py +0 -0
  91. {sxs-2024.0.4 → sxs-2024.0.5}/sxs/utilities/url.py +0 -0
  92. {sxs-2024.0.4 → sxs-2024.0.5}/sxs/waveforms/__init__.py +0 -0
  93. {sxs-2024.0.4 → sxs-2024.0.5}/sxs/waveforms/alignment.py +0 -0
  94. {sxs-2024.0.4 → sxs-2024.0.5}/sxs/waveforms/format_handlers/__init__.py +0 -0
  95. {sxs-2024.0.4 → sxs-2024.0.5}/sxs/waveforms/format_handlers/lvc.py +0 -0
  96. {sxs-2024.0.4 → sxs-2024.0.5}/sxs/waveforms/format_handlers/nrar.py +0 -0
  97. {sxs-2024.0.4 → sxs-2024.0.5}/sxs/waveforms/format_handlers/rotating_paired_diff_multishuffle_bzip2.py +0 -0
  98. {sxs-2024.0.4 → sxs-2024.0.5}/sxs/waveforms/format_handlers/rotating_paired_xor_multishuffle_bzip2.py +0 -0
  99. {sxs-2024.0.4 → sxs-2024.0.5}/sxs/waveforms/format_handlers/spectre_cce_v1.py +0 -0
  100. {sxs-2024.0.4 → sxs-2024.0.5}/sxs/waveforms/memory.py +0 -0
  101. {sxs-2024.0.4 → sxs-2024.0.5}/sxs/waveforms/mode_utilities.py +0 -0
  102. {sxs-2024.0.4 → sxs-2024.0.5}/sxs/waveforms/transformations.py +0 -0
  103. {sxs-2024.0.4 → sxs-2024.0.5}/sxs/waveforms/waveform_grid.py +0 -0
  104. {sxs-2024.0.4 → sxs-2024.0.5}/sxs/waveforms/waveform_mixin.py +0 -0
  105. {sxs-2024.0.4 → sxs-2024.0.5}/sxs/waveforms/waveform_modes.py +0 -0
  106. {sxs-2024.0.4 → sxs-2024.0.5}/sxs/waveforms/waveform_signal.py +0 -0
  107. {sxs-2024.0.4 → sxs-2024.0.5}/sxs/zenodo/__init__.py +0 -0
  108. {sxs-2024.0.4 → sxs-2024.0.5}/sxs/zenodo/api/__init__.py +0 -0
  109. {sxs-2024.0.4 → sxs-2024.0.5}/sxs/zenodo/api/deposit.py +0 -0
  110. {sxs-2024.0.4 → sxs-2024.0.5}/sxs/zenodo/api/login.py +0 -0
  111. {sxs-2024.0.4 → sxs-2024.0.5}/sxs/zenodo/api/records.py +0 -0
  112. {sxs-2024.0.4 → sxs-2024.0.5}/sxs/zenodo/catalog.py +0 -0
  113. {sxs-2024.0.4 → sxs-2024.0.5}/sxs/zenodo/creators.py +0 -0
  114. {sxs-2024.0.4 → sxs-2024.0.5}/sxs/zenodo/simannex.py +0 -0
  115. {sxs-2024.0.4 → sxs-2024.0.5}/sxs/zenodo/surrogatemodeling.py +0 -0
  116. {sxs-2024.0.4 → sxs-2024.0.5}/tests/__init__.py +0 -0
  117. {sxs-2024.0.4 → sxs-2024.0.5}/tests/conftest.py +0 -0
  118. {sxs-2024.0.4 → sxs-2024.0.5}/tests/test_catalog.py +0 -0
  119. {sxs-2024.0.4 → sxs-2024.0.5}/tests/test_horizons.py +0 -0
  120. {sxs-2024.0.4 → sxs-2024.0.5}/tests/test_julia.py +0 -0
  121. {sxs-2024.0.4 → sxs-2024.0.5}/tests/test_loader.py +0 -0
  122. {sxs-2024.0.4 → sxs-2024.0.5}/tests/test_metadata.py +0 -0
  123. {sxs-2024.0.4 → sxs-2024.0.5}/tests/test_simulation.py +0 -0
  124. {sxs-2024.0.4 → sxs-2024.0.5}/tests/test_time_series.py +0 -0
  125. {sxs-2024.0.4 → sxs-2024.0.5}/tests/test_transformations.py +0 -0
  126. {sxs-2024.0.4 → sxs-2024.0.5}/tests/test_utilities.py +0 -0
  127. {sxs-2024.0.4 → sxs-2024.0.5}/tests/test_waveform_rotations.py +0 -0
  128. {sxs-2024.0.4 → sxs-2024.0.5}/tests/test_waveforms.py +0 -0
@@ -10,5 +10,5 @@ authors:
10
10
  title: "The sxs package"
11
11
  license: MIT
12
12
  doi: 10.5281/zenodo.4034006
13
- version: 2024.0.4
14
- date-released: 2024-08-19
13
+ version: 2024.0.5
14
+ date-released: 2024-08-21
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: sxs
3
- Version: 2024.0.4
3
+ Version: 2024.0.5
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/
@@ -0,0 +1 @@
1
+ __version__ = "2024.0.5"
@@ -379,6 +379,30 @@ class Horizons(object):
379
379
 
380
380
  nhat = n̂
381
381
 
382
+ @property
383
+ def λ⃗(self):
384
+ """Time-derivative of separation vector
385
+
386
+ This function can be spelled `λ⃗` or `lambdavec`, interchangeably.
387
+
388
+ Returns
389
+ -------
390
+ λ⃗ : ndarray
391
+ This has shape (self.A.n_times, 3), representing the components of the
392
+ vector as a function of time.
393
+
394
+ See Also
395
+ --------
396
+ n⃗, nvec, separation : (Non-normalized) separation vector between two horizons
397
+ n̂, nhat : Normalized separation vector
398
+ λ̂, lambdahat : Normalized version of this vector
399
+ ℓ̂, ellhat : Normalized angular-velocity vector
400
+
401
+ """
402
+ return self.n⃗.dot
403
+
404
+ lambdavec = λ⃗
405
+
382
406
  @property
383
407
  def λ̂(self):
384
408
  """Time-derivative of normalized separation vector
@@ -403,7 +427,7 @@ class Horizons(object):
403
427
  post-Newtonian theory and similar treatments.
404
428
 
405
429
  """
406
- λ⃗ = self.n̂.dot
430
+ λ⃗ = self.λ⃗
407
431
  return λ⃗ / np.linalg.norm(λ⃗, axis=1)[:, np.newaxis]
408
432
 
409
433
  lambdahat = λ̂
@@ -435,3 +459,74 @@ class Horizons(object):
435
459
  return TimeSeries(np.cross(self.n̂, self.λ̂), time=self.n̂.time)
436
460
 
437
461
  ellhat = ℓ̂
462
+
463
+ @property
464
+ def R(self):
465
+ """Frame Rotor taking (x̂, ŷ, ẑ) onto (n̂, λ̂, ℓ̂) at each instant
466
+
467
+ For example, if λ̂ᵢ is the value of λ̂ at time tᵢ, and Rᵢ the
468
+ corresponding output from this function, then we have
469
+
470
+ λ̂ᵢ = Rᵢ * quaternionic.y / Rᵢ
471
+
472
+ Returns
473
+ -------
474
+ R : quaternionic.array
475
+ This has shape (self.A.n_times, 4), representing the rotor
476
+ at each time. Note that this is *not* a TimeSeries
477
+ object, as is returned by several other functions in this
478
+ class. However, the corresponding times are available as
479
+ `R.time`.
480
+ """
481
+ import numpy as np
482
+ import quaternionic
483
+ reference_frame = np.array([quaternionic.x.vector, quaternionic.y.vector, quaternionic.z.vector])
484
+ target_frame = np.array([self.n̂, self.λ̂, self.ℓ̂])
485
+ R = quaternionic.array([
486
+ quaternionic.align(
487
+ target_frame[:, i, :],
488
+ reference_frame
489
+ )
490
+ for i in range(target_frame.shape[1])
491
+ ])
492
+ quaternionic.unflip_rotors(R, inplace=True)
493
+ R.time = self.A.time
494
+ return R
495
+
496
+ @property
497
+ def Ω⃗(self):
498
+ """Angular velocity vector of the binary
499
+
500
+ This function can be spelled `Ω⃗`, `ω⃗`, `OmegaVec`, or
501
+ `omegaVec`, interchangeably.
502
+
503
+ Returns
504
+ -------
505
+ Ω⃗ : TimeSeries
506
+ This represents the angular velocity as a function of time.
507
+ """
508
+ R = self.R
509
+ return TimeSeries(R.to_angular_velocity(R.time), time=R.time)
510
+
511
+ ω⃗ = Ω⃗
512
+ OmegaVec = Ω⃗
513
+ omegaVec = Ω⃗
514
+
515
+ @property
516
+ def Ω(self):
517
+ """Magnitude of the angular velocity of the binary
518
+
519
+ This function can be spelled `Ω`, `ω`, `Omega`, or `omega`,
520
+ interchangeably.
521
+
522
+ Returns
523
+ -------
524
+ Ω : TimeSeries
525
+ This represents the magnitude of the angular velocity as a
526
+ function of time.
527
+ """
528
+ return TimeSeries(np.linalg.norm(self.Ω⃗, axis=1), time=self.A.time)
529
+
530
+ ω = Ω
531
+ Omega = Ω
532
+ omega = Ω
@@ -74,6 +74,14 @@ def Simulation(location, *args, **kwargs):
74
74
  polynomials in 1/r with degree `x`, while "Outer" refers to
75
75
  data extracted at the outermost extraction radius but
76
76
  corrected for time-dilation and areal-radius effects.
77
+ download : bool
78
+ If `True`, download the information about the files from the
79
+ Zenodo/CaltechDATA record. If `False`, only use the file
80
+ information that is already available (which will raise an
81
+ error if the file information has not previously been
82
+ downloaded). If not present, use the value from the
83
+ configuration file, defaulting to `True` if it is not
84
+ configured.
77
85
 
78
86
  Returns
79
87
  -------
@@ -117,12 +125,13 @@ def Simulation(location, *args, **kwargs):
117
125
  url = f"{doi_url}{sxs_id}"
118
126
 
119
127
  # Deal with "superseded_by" field, or "deprecated" keyword in the metadata
128
+ deprecated = ("deprecated" in metadata.get("keywords", []) or metadata.get("superseded_by", False))
120
129
  if not kwargs.get("ignore_deprecation", False):
121
130
  auto_supersede = kwargs.get("auto_supersede", read_config("auto_supersede", False))
122
131
  if (
123
132
  input_version
124
133
  and not auto_supersede
125
- and ("deprecated" in metadata.get("keywords", []) or metadata.get("superseded_by", False))
134
+ and deprecated
126
135
  ):
127
136
  message = ("\n"
128
137
  + f"Simulation '{sxs_id_stem}' is deprecated and/or superseded.\n"
@@ -179,8 +188,11 @@ def Simulation(location, *args, **kwargs):
179
188
  + "to to load this waveform anyway."
180
189
  )
181
190
 
191
+ # Note the deprecation status in the kwargs, even if ignoring deprecation
192
+ kwargs["deprecated"] = deprecated
193
+
182
194
  # We want to do this *after* deprecation checking, to avoid possibly unnecessary web requests
183
- files = get_file_info(metadata, sxs_id)
195
+ files = get_file_info(metadata, sxs_id, download=kwargs.get("download", None))
184
196
 
185
197
  # If Lev is given as part of `location`, use it; otherwise, use the highest available
186
198
  lev_numbers = sorted({lev for f in files if (lev:=lev_number(f))})
@@ -281,9 +293,20 @@ class SimulationBase:
281
293
  self.lev_numbers = lev_numbers
282
294
  self.lev_number = lev_number
283
295
  self.location = location
296
+ self.deprecated = kwargs.get("deprecated", False)
284
297
 
285
298
  def __repr__(self):
286
- return f"""{type(self).__qualname__}("{self.sxs_id}")"""
299
+ chi1 = self.metadata.reference_dimensionless_spin1
300
+ chi2 = self.metadata.reference_dimensionless_spin2
301
+ construction = f"""{type(self).__qualname__}("{self.location}")\n# """
302
+ if self.deprecated:
303
+ construction += "DEPRECATED "
304
+ construction += f"{self.metadata.number_of_orbits:.3g}-orbit "
305
+ construction += f"q={self.metadata.reference_mass_ratio:.3g} "
306
+ construction += f"""chi1=[{", ".join(f"{c:.3g}" for c in chi1)}] """
307
+ construction += f"""chi2=[{", ".join(f"{c:.3g}" for c in chi2)}] """
308
+ construction += f"e={self.metadata.reference_eccentricity:.3g} simulation"
309
+ return construction
287
310
 
288
311
  def __str__(self):
289
312
  return repr(self)
@@ -317,6 +340,7 @@ class SimulationBase:
317
340
  if not hasattr(self, "_horizons"):
318
341
  self._horizons = self.load_horizons()
319
342
  return self._horizons
343
+ Horizons = horizons
320
344
 
321
345
  @property
322
346
  def strain(self):
@@ -500,16 +524,18 @@ class Simulation_v2(SimulationBase):
500
524
  h5_truepath = sxs_id_path / sxs_path_to_system_path(h5_path)
501
525
  json_truepath = sxs_id_path / sxs_path_to_system_path(json_path)
502
526
  if not json_truepath.exists():
527
+ if not read_config("download", True):
528
+ raise ValueError(f"{json_truepath} not found and download is disabled")
503
529
  download_file(json_location, sxs_directory("cache") / json_truepath)
504
530
  return load(h5_location, truepath=h5_truepath, group=group, metadata=self.metadata)
505
531
 
506
532
 
507
- def get_file_info(metadata, sxs_id):
533
+ def get_file_info(metadata, sxs_id, download=None):
508
534
  from .. import load_via_sxs_id
509
535
  if "files" in metadata:
510
536
  return metadata["files"]
511
537
  truepath = Path(sxs_path_to_system_path(sxs_id)) / "zenodo_metadata.json"
512
- record = load_via_sxs_id(sxs_id, "export/json", truepath=truepath)
538
+ record = load_via_sxs_id(sxs_id, "export/json", truepath=truepath, download=download)
513
539
  entries = record["files"]["entries"]
514
540
  return {
515
541
  str(filename): {
@@ -217,7 +217,6 @@ class Simulations(collections.OrderedDict):
217
217
  """
218
218
  import numpy as np
219
219
  import pandas as pd
220
- from datetime import datetime, timezone
221
220
 
222
221
  if hasattr(self, "_dataframe"):
223
222
  return self._dataframe
@@ -259,55 +258,36 @@ class Simulations(collections.OrderedDict):
259
258
 
260
259
  def datetime_from_string(x):
261
260
  try:
262
- dt = datetime.strptime(x, "%Y-%m-%dT%H:%M:%S%z")
261
+ dt = pd.to_datetime(x).tz_convert("UTC")
263
262
  except:
264
- dt = datetime.min.replace(tzinfo=timezone.utc)
263
+ dt = pd.to_datetime("1970-1-1").tz_localize("UTC")
265
264
  return dt
266
265
 
267
266
  sims_df = pd.concat((
268
- simulations["object_types"].astype("category"),
269
- simulations["initial_data_type"].astype("category"),
270
- simulations["initial_separation"].map(floater),
271
- simulations["initial_orbital_frequency"].map(floater),
272
- simulations["initial_adot"].map(floater),
273
- simulations["initial_ADM_energy"].map(floater),
274
- simulations["initial_ADM_linear_momentum"].map(three_vec),
275
- simulations["initial_ADM_linear_momentum"].map(norm).rename("initial_ADM_linear_momentum_mag"),
276
- simulations["initial_ADM_angular_momentum"].map(three_vec),
277
- simulations["initial_ADM_angular_momentum"].map(norm).rename("initial_ADM_angular_momentum_mag"),
278
- simulations["initial_mass1"].map(floater),
279
- simulations["initial_mass2"].map(floater),
280
- simulations["initial_mass_ratio"].map(floater),
281
- simulations["initial_dimensionless_spin1"].map(three_vec),
282
- simulations["initial_dimensionless_spin1"].map(norm).rename("initial_dimensionless_spin1_mag"),
283
- simulations["initial_dimensionless_spin2"].map(three_vec),
284
- simulations["initial_dimensionless_spin2"].map(norm).rename("initial_dimensionless_spin2_mag"),
285
- simulations["initial_position1"].map(three_vec),
286
- simulations["initial_position2"].map(three_vec),
287
267
  simulations["reference_time"].map(floater),
288
- (
289
- simulations["reference_position1"].map(three_vec)
290
- -simulations["reference_position2"].map(three_vec)
291
- ).map(norm).rename("reference_separation"),
292
- simulations["reference_orbital_frequency"].map(norm).rename("reference_orbital_frequency_mag"),
293
268
  simulations["reference_mass_ratio"].map(floater),
294
- simulations["reference_dimensionless_spin1"].map(norm).rename("reference_chi1_mag"),
295
- simulations["reference_dimensionless_spin2"].map(norm).rename("reference_chi2_mag"),
269
+ simulations["reference_dimensionless_spin1"].map(three_vec),
270
+ simulations["reference_dimensionless_spin1"].map(norm).rename("reference_dimensionless_spin1_mag"),
271
+ simulations["reference_dimensionless_spin2"].map(three_vec),
272
+ simulations["reference_dimensionless_spin2"].map(norm).rename("reference_dimensionless_spin2_mag"),
296
273
  simulations["reference_chi_eff"].map(floater),
297
274
  simulations["reference_chi1_perp"].map(floater),
298
275
  simulations["reference_chi2_perp"].map(floater),
299
276
  simulations["reference_eccentricity"].map(floater),
300
277
  simulations["reference_eccentricity"].map(floaterbound).rename("reference_eccentricity_bound"),
301
278
  simulations["reference_mean_anomaly"].map(floater),
302
- simulations["reference_mass1"].map(floater),
303
- simulations["reference_mass2"].map(floater),
304
- simulations["reference_dimensionless_spin1"].map(three_vec),
305
- simulations["reference_dimensionless_spin1"].map(norm).rename("reference_dimensionless_spin1_mag"),
306
- simulations["reference_dimensionless_spin2"].map(three_vec),
307
- simulations["reference_dimensionless_spin2"].map(norm).rename("reference_dimensionless_spin2_mag"),
308
279
  simulations["reference_orbital_frequency"].map(three_vec),
280
+ simulations["reference_orbital_frequency"].map(norm).rename("reference_orbital_frequency_mag"),
281
+ (
282
+ simulations["reference_position1"].map(three_vec)
283
+ -simulations["reference_position2"].map(three_vec)
284
+ ).map(norm).rename("reference_separation"),
309
285
  simulations["reference_position1"].map(three_vec),
310
286
  simulations["reference_position2"].map(three_vec),
287
+ simulations["reference_mass1"].map(floater),
288
+ simulations["reference_mass2"].map(floater),
289
+ simulations["reference_dimensionless_spin1"].map(norm).rename("reference_chi1_mag"),
290
+ simulations["reference_dimensionless_spin2"].map(norm).rename("reference_chi2_mag"),
311
291
  simulations["relaxation_time"].map(floater),
312
292
  #simulations["merger_time"].map(floater),
313
293
  simulations["common_horizon_time"].map(floater),
@@ -318,27 +298,50 @@ class Simulations(collections.OrderedDict):
318
298
  simulations["remnant_velocity"].map(norm).rename("remnant_velocity_mag"),
319
299
  #simulations["final_time"].map(floater),
320
300
  simulations["EOS"].fillna(simulations["eos"]),
301
+ simulations["disk_mass"].map(floater),
302
+ simulations["ejecta_mass"].map(floater),
303
+ simulations["object_types"].astype("category"),
321
304
  simulations["initial_data_type"].astype("category"),
305
+ simulations["initial_separation"].map(floater),
306
+ simulations["initial_orbital_frequency"].map(floater),
307
+ simulations["initial_adot"].map(floater),
308
+ simulations["initial_ADM_energy"].map(floater),
309
+ simulations["initial_ADM_linear_momentum"].map(three_vec),
310
+ simulations["initial_ADM_linear_momentum"].map(norm).rename("initial_ADM_linear_momentum_mag"),
311
+ simulations["initial_ADM_angular_momentum"].map(three_vec),
312
+ simulations["initial_ADM_angular_momentum"].map(norm).rename("initial_ADM_angular_momentum_mag"),
313
+ simulations["initial_mass1"].map(floater),
314
+ simulations["initial_mass2"].map(floater),
315
+ simulations["initial_mass_ratio"].map(floater),
316
+ simulations["initial_dimensionless_spin1"].map(three_vec),
317
+ simulations["initial_dimensionless_spin1"].map(norm).rename("initial_dimensionless_spin1_mag"),
318
+ simulations["initial_dimensionless_spin2"].map(three_vec),
319
+ simulations["initial_dimensionless_spin2"].map(norm).rename("initial_dimensionless_spin2_mag"),
320
+ simulations["initial_position1"].map(three_vec),
321
+ simulations["initial_position2"].map(three_vec),
322
322
  #simulations["object1"].astype("category"),
323
323
  #simulations["object2"].astype("category"),
324
- simulations["disk_mass"].map(floater),
325
- simulations["ejecta_mass"].map(floater),
326
324
  # simulations["url"],
327
325
  #simulations["simulation_name"],
328
326
  #simulations["alternative_names"],
329
327
  # simulations["metadata_path"],
330
- simulations["date_link_earliest"].map(datetime_from_string),
331
- simulations["date_postprocessing"].map(datetime_from_string),
332
- simulations["date_run_earliest"].map(datetime_from_string),
333
- simulations["date_run_latest"].map(datetime_from_string),
334
328
  # simulations["end_of_trajectory_time"].map(floater),
335
329
  # simulations["merger_time"].map(floater),
336
330
  simulations["number_of_orbits"].map(floater),
337
331
  simulations["superseded_by"],
338
332
  simulations["DOI_versions"],
339
333
  simulations["keywords"],
334
+ simulations["date_link_earliest"].map(datetime_from_string),
335
+ simulations["date_run_earliest"].map(datetime_from_string),
336
+ simulations["date_run_latest"].map(datetime_from_string),
337
+ simulations["date_postprocessing"].map(datetime_from_string),
340
338
  ), axis=1)
341
339
 
340
+ sims_df.insert(0, "deprecated", (
341
+ ~sims_df.superseded_by.isna()
342
+ | sims_df["keywords"].map(lambda ks: "deprecated" in ks)
343
+ ))
344
+
342
345
  # We have ignored the following fields present in the
343
346
  # simulations.json file (as of 2024-08-04), listed here with
344
347
  # the number of non-null entries:
@@ -1 +0,0 @@
1
- __version__ = "2024.0.4"
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