lisaanalysistools 1.0.10__cp312-cp312-macosx_10_13_x86_64.whl

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 lisaanalysistools might be problematic. Click here for more details.

Files changed (43) hide show
  1. lisaanalysistools-1.0.10.dist-info/LICENSE +201 -0
  2. lisaanalysistools-1.0.10.dist-info/METADATA +101 -0
  3. lisaanalysistools-1.0.10.dist-info/RECORD +43 -0
  4. lisaanalysistools-1.0.10.dist-info/WHEEL +5 -0
  5. lisaanalysistools-1.0.10.dist-info/top_level.txt +1 -0
  6. lisatools/__init__.py +0 -0
  7. lisatools/_version.py +4 -0
  8. lisatools/analysiscontainer.py +451 -0
  9. lisatools/cutils/__init__.py +0 -0
  10. lisatools/cutils/detector_cpu.cpython-312-darwin.so +0 -0
  11. lisatools/cutils/include/Detector.hpp +84 -0
  12. lisatools/cutils/include/__init__.py +0 -0
  13. lisatools/cutils/include/global.hpp +28 -0
  14. lisatools/cutils/src/Detector.cpp +307 -0
  15. lisatools/cutils/src/Detector.cu +307 -0
  16. lisatools/cutils/src/__init__.py +0 -0
  17. lisatools/cutils/src/pycppdetector.pyx +255 -0
  18. lisatools/datacontainer.py +309 -0
  19. lisatools/detector.py +704 -0
  20. lisatools/diagnostic.py +977 -0
  21. lisatools/sampling/__init__.py +0 -0
  22. lisatools/sampling/likelihood.py +882 -0
  23. lisatools/sampling/moves/__init__.py +0 -0
  24. lisatools/sampling/moves/skymodehop.py +110 -0
  25. lisatools/sampling/prior.py +646 -0
  26. lisatools/sampling/stopping.py +320 -0
  27. lisatools/sampling/utility.py +411 -0
  28. lisatools/sensitivity.py +899 -0
  29. lisatools/sources/__init__.py +6 -0
  30. lisatools/sources/bbh/__init__.py +1 -0
  31. lisatools/sources/bbh/waveform.py +91 -0
  32. lisatools/sources/defaultresponse.py +36 -0
  33. lisatools/sources/emri/__init__.py +1 -0
  34. lisatools/sources/emri/waveform.py +79 -0
  35. lisatools/sources/gb/__init__.py +1 -0
  36. lisatools/sources/gb/waveform.py +67 -0
  37. lisatools/sources/utils.py +456 -0
  38. lisatools/sources/waveformbase.py +41 -0
  39. lisatools/stochastic.py +291 -0
  40. lisatools/utils/__init__.py +0 -0
  41. lisatools/utils/constants.py +40 -0
  42. lisatools/utils/pointeradjust.py +106 -0
  43. lisatools/utils/utility.py +245 -0
@@ -0,0 +1,6 @@
1
+ from .utils import (
2
+ CalculationController,
3
+ BBHCalculationController,
4
+ GBCalculationController,
5
+ EMRICalculationController,
6
+ )
@@ -0,0 +1 @@
1
+ from .waveform import BBHSNRWaveform
@@ -0,0 +1,91 @@
1
+ import numpy as np
2
+ from typing import Optional, Any, Tuple
3
+ from copy import deepcopy
4
+
5
+ # imports
6
+ from fastlisaresponse import ResponseWrapper
7
+ from bbhx.waveformbuild import BBHWaveformFD
8
+ from ...utils.constants import *
9
+
10
+ from ..waveformbase import SNRWaveform
11
+
12
+
13
+ class BBHSNRWaveform(SNRWaveform):
14
+ """Wrapper class for straightforward BBH SNR calculations.
15
+
16
+ Calculates it for A and E channels in TDI2.
17
+
18
+ Args:
19
+ bbh_waveform_kwargs: ``amp_phase_kwargs`` for :class:`BBHWaveformFD`.
20
+ response_kwargs: ``response_kwargs`` for :class:`BBHWaveformFD`.
21
+
22
+ """
23
+
24
+ def __init__(
25
+ self,
26
+ bbh_waveform_kwargs: Optional[dict] = {"run_phenomd": False},
27
+ response_kwargs: Optional[dict] = {"TDItag": "AET", "tdi2": True},
28
+ ) -> None:
29
+
30
+ if "TDItag" not in response_kwargs:
31
+ response_kwargs["TDItag"] = "AET"
32
+
33
+ if "tdi2" not in response_kwargs:
34
+ response_kwargs["tdi2"] = True
35
+
36
+ # wave generating class
37
+ self.wave_gen = BBHWaveformFD(
38
+ amp_phase_kwargs=bbh_waveform_kwargs,
39
+ response_kwargs=response_kwargs,
40
+ )
41
+
42
+ @property
43
+ def f_arr(self) -> np.ndarray:
44
+ """Frequency array."""
45
+ return self._f_arr
46
+
47
+ @f_arr.setter
48
+ def f_arr(self, f_arr: np.ndarray) -> None:
49
+ """Set frequency array."""
50
+ self._f_arr = f_arr
51
+
52
+ def __call__(
53
+ self, *params: Any, return_array: Optional[bool] = False, **kwargs: Any
54
+ ) -> Tuple[np.ndarray, np.ndarray, np.ndarray] | np.ndarray:
55
+ """Generate waveforms for SNR calculations.
56
+
57
+ Args:
58
+ *params: Parameters for the ``__call__`` function
59
+ for :class:`BBHWaveformFD`.
60
+ return_array: If ``True``, return ``array([A, E, T]).
61
+ If ``False``, return (A, E, T).
62
+ **kwargs: ``kwargs`` for the ``__call__`` function
63
+ for :class:`BBHWaveformFD`.
64
+
65
+ Returns:
66
+ Output waveform.
67
+
68
+ """
69
+
70
+ # determine frequency array (sparse, log-spaced)
71
+ m1 = params[0]
72
+ m2 = params[1]
73
+
74
+ min_f = 1e-4 / (MTSUN_SI * (m1 + m2))
75
+ max_f = 0.6 / (MTSUN_SI * (m1 + m2))
76
+ self.f_arr = np.logspace(np.log10(min_f), np.log10(max_f), 1024)
77
+
78
+ # generate waveform with proper settings
79
+ AET = self.wave_gen(
80
+ *params,
81
+ direct=True,
82
+ combine=True,
83
+ freqs=self.f_arr,
84
+ **kwargs,
85
+ )[0]
86
+
87
+ # prepare output
88
+ if return_array:
89
+ return AET
90
+ else:
91
+ return (AET[0], AET[1], AET[2])
@@ -0,0 +1,36 @@
1
+ from dataclasses import dataclass
2
+
3
+ from ..detector import EqualArmlengthOrbits, Orbits
4
+
5
+
6
+ @dataclass
7
+ class DefaultResponseKwargs:
8
+ """Default response kwargs
9
+
10
+ Default response kwargs for
11
+ `fastlisaresponse.ResponseWrapper <https://mikekatz04.github.io/lisa-on-gpu/html/user/main.html#response-function-wrapper>`_.
12
+
13
+ ``t0=30000.0``
14
+ ``order=25``
15
+ ``tdi="1st generation"``
16
+ ``tdi_chan="AET"``
17
+ ``orbits=EqualArmlengthOrbits()``
18
+
19
+ """
20
+
21
+ t0 = 30000.0
22
+ order = 25
23
+ tdi = "1st generation"
24
+ tdi_chan = "AET"
25
+ orbits = EqualArmlengthOrbits()
26
+
27
+ @classmethod
28
+ def get_dict(cls) -> dict:
29
+ """Return default dictionary"""
30
+ return dict(
31
+ t0=cls.t0,
32
+ order=cls.order,
33
+ tdi=cls.tdi,
34
+ tdi_chan=cls.tdi_chan,
35
+ orbits=cls.orbits,
36
+ )
@@ -0,0 +1 @@
1
+ from .waveform import EMRITDIWaveform
@@ -0,0 +1,79 @@
1
+ from __future__ import annotations
2
+ from lisatools.detector import EqualArmlengthOrbits
3
+ import numpy as np
4
+ from typing import Optional, Any
5
+ from copy import deepcopy
6
+
7
+ from few.waveform import GenerateEMRIWaveform
8
+
9
+ # imports
10
+ from ..waveformbase import AETTDIWaveform
11
+ from fastlisaresponse import ResponseWrapper
12
+ from ...detector import EqualArmlengthOrbits
13
+
14
+ default_response_kwargs = dict(
15
+ t0=30000.0,
16
+ order=25,
17
+ tdi="1st generation",
18
+ tdi_chan="AET",
19
+ orbits=EqualArmlengthOrbits(),
20
+ )
21
+
22
+
23
+ class EMRITDIWaveform(AETTDIWaveform):
24
+ """Generate EMRI waveforms with the TDI LISA Response
25
+
26
+ Args:
27
+ T: Observation time in years.
28
+ dt: Time cadence in seconds.
29
+ emri_waveform_args: Arguments for :class:`GenerateEMRIWaveforms`.
30
+ emri_waveform_kwargs: Keyword arguments for :class:`GenerateEMRIWaveforms`.
31
+ response_kwargs: Keyword arguments for :class:`ResponseWrapper`.
32
+
33
+ """
34
+
35
+ def __init__(
36
+ self,
37
+ T: Optional[float] = 1.0,
38
+ dt: Optional[float] = 10.0,
39
+ emri_waveform_args: Optional[tuple] = ("FastSchwarzschildEccentricFlux",),
40
+ emri_waveform_kwargs: Optional[dict] = {},
41
+ response_kwargs: Optional[dict] = default_response_kwargs,
42
+ ):
43
+ # sky parameters in GenerateEMRIWaveform
44
+ index_lambda = 8
45
+ index_beta = 7
46
+
47
+ for key in default_response_kwargs:
48
+ response_kwargs[key] = response_kwargs.get(
49
+ key, default_response_kwargs[key]
50
+ )
51
+ gen_wave = GenerateEMRIWaveform(
52
+ *emri_waveform_args,
53
+ sum_kwargs=dict(pad_output=True),
54
+ **emri_waveform_kwargs,
55
+ )
56
+
57
+ response_kwargs_in = deepcopy(response_kwargs)
58
+ # parameters
59
+ self.response = ResponseWrapper(
60
+ gen_wave,
61
+ T,
62
+ dt,
63
+ index_lambda,
64
+ index_beta,
65
+ flip_hx=True, # set to True if waveform is h+ - ihx
66
+ remove_sky_coords=False,
67
+ is_ecliptic_latitude=False,
68
+ remove_garbage=True, # removes the beginning of the signal that has bad information
69
+ **response_kwargs_in,
70
+ )
71
+
72
+ @property
73
+ def dt(self) -> float:
74
+ """timestep"""
75
+ return self.response.dt
76
+
77
+ def __call__(self, *args: Any, **kwargs: Any) -> Any:
78
+ __doc__ = ResponseWrapper.__call__.__doc__
79
+ return self.response(*args, **kwargs)
@@ -0,0 +1 @@
1
+ from .waveform import GBAETWaveform
@@ -0,0 +1,67 @@
1
+ import numpy as np
2
+ from typing import Optional, Any, Tuple
3
+ from copy import deepcopy
4
+
5
+ from few.waveform import GenerateEMRIWaveform
6
+
7
+ # imports
8
+ from fastlisaresponse import ResponseWrapper
9
+ from lisatools.detector import EqualArmlengthOrbits
10
+ from ..waveformbase import AETTDIWaveform
11
+
12
+ from gbgpu.gbgpu import GBGPU
13
+
14
+
15
+ class GBAETWaveform(AETTDIWaveform):
16
+ """Stock AET waveform for Galactic Binaries.
17
+
18
+ Args:
19
+ *args: Arguments for :class:`GBGPU`.
20
+ **kwargs: Arguments for :class:`GBGPU`.
21
+
22
+ """
23
+
24
+ def __init__(self, *args: Any, **kwargs: Any) -> None:
25
+ # wave generating class
26
+ self.wave_gen = GBGPU(*args, **kwargs)
27
+
28
+ @property
29
+ def f_arr(self) -> np.ndarray:
30
+ """Frequency array."""
31
+ return self._f_arr
32
+
33
+ @f_arr.setter
34
+ def f_arr(self, f_arr: np.ndarray) -> None:
35
+ """Set the frequency array."""
36
+ self._f_arr = f_arr
37
+
38
+ def __call__(
39
+ self, *params: Any, return_array: Optional[bool] = False, **kwargs: Any
40
+ ) -> Tuple[np.ndarray, np.ndarray, np.ndarray] | np.ndarray:
41
+ """Generate waveform.
42
+
43
+ Args:
44
+ *params: Parameters going into :meth:`GBGPU.run_wave`.
45
+ return_array: If ``True``, return ``array([A, E, T]).
46
+ If ``False``, return (A, E, T).
47
+ **kwargs: Keyword arguments going into :meth:`GBGPU.run_wave`.
48
+
49
+ Returns:
50
+ Output waveform.
51
+
52
+ """
53
+ self.wave_gen.run_wave(
54
+ *params,
55
+ **kwargs,
56
+ )
57
+
58
+ # prepare outputs
59
+ self.f_arr = self.wave_gen.freqs[0]
60
+ A = self.wave_gen.A[0]
61
+ E = self.wave_gen.E[0]
62
+ T = self.wave_gen.X[0]
63
+
64
+ if return_array:
65
+ return np.array([A, E, T])
66
+ else:
67
+ return (A, E, T)