lisaanalysistools 1.1.20__cp39-cp39-macosx_15_0_arm64.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.
Files changed (48) hide show
  1. lisaanalysistools/git_version.py +7 -0
  2. lisaanalysistools-1.1.20.dist-info/METADATA +281 -0
  3. lisaanalysistools-1.1.20.dist-info/RECORD +48 -0
  4. lisaanalysistools-1.1.20.dist-info/WHEEL +5 -0
  5. lisaanalysistools-1.1.20.dist-info/licenses/LICENSE +201 -0
  6. lisatools/.dylibs/libgcc_s.1.1.dylib +0 -0
  7. lisatools/.dylibs/libstdc++.6.dylib +0 -0
  8. lisatools/__init__.py +90 -0
  9. lisatools/_version.py +34 -0
  10. lisatools/analysiscontainer.py +474 -0
  11. lisatools/cutils/Detector.cu +307 -0
  12. lisatools/cutils/Detector.hpp +84 -0
  13. lisatools/cutils/__init__.py +129 -0
  14. lisatools/cutils/global.hpp +28 -0
  15. lisatools/cutils/pycppdetector.pyx +256 -0
  16. lisatools/datacontainer.py +312 -0
  17. lisatools/detector.py +867 -0
  18. lisatools/diagnostic.py +990 -0
  19. lisatools/git_version.py.in +7 -0
  20. lisatools/orbit_files/equalarmlength-orbits-best-fit-to-esa.h5 +0 -0
  21. lisatools/orbit_files/equalarmlength-orbits.h5 +0 -0
  22. lisatools/orbit_files/esa-trailing-orbits.h5 +0 -0
  23. lisatools/sampling/__init__.py +0 -0
  24. lisatools/sampling/likelihood.py +882 -0
  25. lisatools/sampling/moves/__init__.py +0 -0
  26. lisatools/sampling/moves/skymodehop.py +110 -0
  27. lisatools/sampling/prior.py +646 -0
  28. lisatools/sampling/stopping.py +320 -0
  29. lisatools/sampling/utility.py +411 -0
  30. lisatools/sensitivity.py +1554 -0
  31. lisatools/sources/__init__.py +6 -0
  32. lisatools/sources/bbh/__init__.py +1 -0
  33. lisatools/sources/bbh/waveform.py +106 -0
  34. lisatools/sources/defaultresponse.py +37 -0
  35. lisatools/sources/emri/__init__.py +1 -0
  36. lisatools/sources/emri/waveform.py +79 -0
  37. lisatools/sources/gb/__init__.py +1 -0
  38. lisatools/sources/gb/waveform.py +69 -0
  39. lisatools/sources/utils.py +459 -0
  40. lisatools/sources/waveformbase.py +41 -0
  41. lisatools/stochastic.py +327 -0
  42. lisatools/utils/__init__.py +0 -0
  43. lisatools/utils/constants.py +54 -0
  44. lisatools/utils/exceptions.py +95 -0
  45. lisatools/utils/parallelbase.py +11 -0
  46. lisatools/utils/utility.py +122 -0
  47. lisatools_backend_cpu/git_version.py +7 -0
  48. lisatools_backend_cpu/pycppdetector.cpython-39-darwin.so +0 -0
File without changes
@@ -0,0 +1,110 @@
1
+ # -*- coding: utf-8 -*-
2
+
3
+ import numpy as np
4
+
5
+ from eryn.moves import MHMove
6
+
7
+ __all__ = ["GaussianMove"]
8
+
9
+
10
+ class SkyMove(MHMove):
11
+ """A Metropolis step with a Gaussian proposal function.
12
+
13
+ Args:
14
+
15
+
16
+ Raises:
17
+ ValueError: If the proposal dimensions are invalid or if any of any of
18
+ the other arguments are inconsistent.
19
+
20
+ """
21
+
22
+ def __init__(self, ind_map=None, which="both", **kwargs):
23
+
24
+ if ind_map is None:
25
+ ind_map = dict(cosinc=6, lam=7, sinbeta=8, psi=9)
26
+
27
+ elif isinstance(ind_map, dict) is False:
28
+ raise ValueError("If providing the ind_map kwarg, it must be a dict.")
29
+
30
+ if which not in ["both", "lat", "long"]:
31
+ raise ValueError("which kwarg must be 'both', 'lat', or 'long'.")
32
+
33
+ self.ind_map = ind_map
34
+ self.which = which
35
+ exec(f"self.transform = self.{which}_transform")
36
+ super(SkyMove, self).__init__(**kwargs)
37
+
38
+ def lat_transform(self, coords, random):
39
+ """
40
+ assumes sin beta
41
+ assumes 2d array with all coords
42
+ coords[]
43
+ """
44
+ temp = coords.copy()
45
+
46
+ temp[:, self.ind_map["sinbeta"]] *= -1
47
+ temp[:, self.ind_map["cosinc"]] *= -1
48
+ temp[:, self.ind_map["psi"]] = np.pi - temp[:, self.ind_map["psi"]]
49
+
50
+ return temp
51
+
52
+ def long_transform(self, coords, random):
53
+ """
54
+ assumes sin beta
55
+ assumes 2d array with all coords
56
+ coords[]
57
+ """
58
+ temp = coords.copy()
59
+
60
+ move_amount = random.randint(0, 4, size=coords.shape[0]) * np.pi / 2.0
61
+
62
+ temp[:, self.ind_map["psi"]] += move_amount
63
+ temp[:, self.ind_map["lam"]] += move_amount
64
+
65
+ temp[:, self.ind_map["psi"]] %= np.pi
66
+ temp[:, self.ind_map["lam"]] %= 2 * np.pi
67
+
68
+ return temp
69
+
70
+ def both_transform(self, coords, random):
71
+
72
+ # if doing both does not assume it will cross plane, selects from 8 modes
73
+ inds_lat_change = random.randint(0, 2, size=coords.shape[0]).astype(bool)
74
+ coords[inds_lat_change] = self.lat_transform(coords[inds_lat_change], random)
75
+ coords = self.long_transform(coords, random)
76
+ return coords
77
+
78
+ def get_proposal(self, branches_coords, random, branches_inds=None, **kwargs):
79
+ """Get proposal from Gaussian distribution
80
+
81
+ Args:
82
+ branches_coords (dict): Keys are ``branch_names`` and values are
83
+ np.ndarray[nwalkers, nleaves_max, ndim] representing
84
+ coordinates for walkers.
85
+ branches_inds (dict): Keys are ``branch_names`` and values are
86
+ np.ndarray[nwalkers, nleaves_max] representing which
87
+ leaves are currently being used.
88
+ random (object): Current random state object.
89
+
90
+ """
91
+
92
+ q = {}
93
+ for name, coords in zip(
94
+ branches_coords.keys(), branches_coords.values()
95
+ ):
96
+
97
+ if branches_inds is None:
98
+ inds = np.ones(coords.shape[:-1], dtype=bool)
99
+
100
+ else:
101
+ inds = branches_inds[name]
102
+
103
+ ntemps, nwalkers, _, _ = coords.shape
104
+ inds_here = np.where(inds == True)
105
+
106
+ q[name] = coords.copy()
107
+ new_coords = self.transform(coords[inds_here], random)
108
+ q[name][inds_here] = new_coords.copy()
109
+
110
+ return q, np.zeros((ntemps, nwalkers))