lisaanalysistools 1.0.0__cp312-cp312-macosx_10_9_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 (37) hide show
  1. lisaanalysistools-1.0.0.dist-info/LICENSE +201 -0
  2. lisaanalysistools-1.0.0.dist-info/METADATA +80 -0
  3. lisaanalysistools-1.0.0.dist-info/RECORD +37 -0
  4. lisaanalysistools-1.0.0.dist-info/WHEEL +5 -0
  5. lisaanalysistools-1.0.0.dist-info/top_level.txt +2 -0
  6. lisatools/__init__.py +0 -0
  7. lisatools/_version.py +4 -0
  8. lisatools/analysiscontainer.py +438 -0
  9. lisatools/cutils/detector.cpython-312-darwin.so +0 -0
  10. lisatools/datacontainer.py +292 -0
  11. lisatools/detector.py +410 -0
  12. lisatools/diagnostic.py +976 -0
  13. lisatools/glitch.py +193 -0
  14. lisatools/sampling/__init__.py +0 -0
  15. lisatools/sampling/likelihood.py +882 -0
  16. lisatools/sampling/moves/__init__.py +0 -0
  17. lisatools/sampling/moves/gbgroupstretch.py +53 -0
  18. lisatools/sampling/moves/gbmultipletryrj.py +1287 -0
  19. lisatools/sampling/moves/gbspecialgroupstretch.py +671 -0
  20. lisatools/sampling/moves/gbspecialstretch.py +1836 -0
  21. lisatools/sampling/moves/mbhspecialmove.py +286 -0
  22. lisatools/sampling/moves/placeholder.py +16 -0
  23. lisatools/sampling/moves/skymodehop.py +110 -0
  24. lisatools/sampling/moves/specialforegroundmove.py +564 -0
  25. lisatools/sampling/prior.py +508 -0
  26. lisatools/sampling/stopping.py +320 -0
  27. lisatools/sampling/utility.py +324 -0
  28. lisatools/sensitivity.py +888 -0
  29. lisatools/sources/__init__.py +0 -0
  30. lisatools/sources/emri/__init__.py +1 -0
  31. lisatools/sources/emri/tdiwaveform.py +72 -0
  32. lisatools/stochastic.py +291 -0
  33. lisatools/utils/__init__.py +0 -0
  34. lisatools/utils/constants.py +40 -0
  35. lisatools/utils/multigpudataholder.py +730 -0
  36. lisatools/utils/pointeradjust.py +106 -0
  37. lisatools/utils/utility.py +240 -0
lisatools/glitch.py ADDED
@@ -0,0 +1,193 @@
1
+ from lisaconstants import *
2
+ import numpy as np
3
+
4
+ co = C_SI
5
+
6
+
7
+ def HeavisideTheta(x, xp=None):
8
+ if xp is None:
9
+ xp = np
10
+
11
+ squeeze = True if x.ndim == 1 else False
12
+
13
+ x = xp.atleast_1d(x)
14
+
15
+ out = 1.0 * (x >= 0.0)
16
+
17
+ if squeeze:
18
+ out = out.squeeze()
19
+
20
+ return out
21
+
22
+
23
+ def DiracDelta(x, xp=None):
24
+ if xp is None:
25
+ xp = np
26
+ squeeze = True if x.ndim == 1 else False
27
+
28
+ x = xp.atleast_1d(x)
29
+
30
+ # 1e-10 to guard against numerical error
31
+ out = 1.0 * (xp.abs(x) < 1e-10)
32
+
33
+ if squeeze:
34
+ out = out.squeeze()
35
+
36
+ return out
37
+
38
+
39
+ tau_2_default = 5585.708541201614
40
+ Deltav_default = 1.1079114425597559 * 10 ** (-9)
41
+
42
+ tau_2_default = 1.9394221536001746
43
+ Deltav_default = 2.22616837 * 10 ** (-11)
44
+ t0 = 600
45
+
46
+
47
+ def tdi_glitch_XYZ1(
48
+ t_in, T=8.3, tau_2=tau_2_default, Deltav=Deltav_default, t0=600, mtm=1.982, xp=None
49
+ ):
50
+ # def tdi_glitch_XYZ1(t_in, T=8.3, tau_1=480.0, tau_2=100.0, Deltav=1e-12, t0=600.0, mtm=1.982, xp=None):
51
+
52
+ if xp is None:
53
+ xp = np
54
+
55
+ tau_2 = xp.atleast_1d(tau_2)
56
+ t0 = xp.atleast_1d(t0)
57
+ Deltav = xp.atleast_1d(Deltav)
58
+
59
+ assert tau_2.shape == t0.shape == Deltav.shape
60
+
61
+ out = xp.zeros((3, len(t0), len(t_in)))
62
+
63
+ run = ~(
64
+ xp.isinf(xp.exp((-t_in[None, :] + t0[:, None])))
65
+ | xp.isnan(xp.exp((-t_in[None, :] + t0[:, None])))
66
+ )
67
+
68
+ tdiX1link12 = (
69
+ mtm
70
+ * Deltav[:, None]
71
+ * (
72
+ t_in[None, :]
73
+ - t0[:, None]
74
+ - 2 * tau_2[:, None]
75
+ + xp.exp((-t_in[None, :] + t0[:, None]) / tau_2[:, None])
76
+ * (t_in[None, :] - t0[:, None] + 2 * tau_2[:, None])
77
+ )
78
+ * DiracDelta(t_in[None, :] - t0[:, None])
79
+ + mtm
80
+ * Deltav[:, None]
81
+ * (
82
+ 1
83
+ + (
84
+ xp.exp((-t_in[None, :] + t0[:, None]) / tau_2[:, None])
85
+ * (-t_in[None, :] + t0[:, None] - tau_2[:, None])
86
+ )
87
+ / tau_2[:, None]
88
+ )
89
+ * HeavisideTheta(t_in[None, :] - t0[:, None])
90
+ ) / co - (
91
+ mtm
92
+ * Deltav[:, None]
93
+ * (
94
+ t_in[None, :]
95
+ + 4 * T
96
+ - t0[:, None]
97
+ - 2 * tau_2[:, None]
98
+ + xp.exp((-t_in[None, :] - 4 * T + t0[:, None]) / tau_2[:, None])
99
+ * (t_in[None, :] + 4 * T - t0[:, None] + 2 * tau_2[:, None])
100
+ )
101
+ * DiracDelta(t_in[None, :] + 4 * T - t0[:, None])
102
+ + mtm
103
+ * Deltav[:, None]
104
+ * (
105
+ 1
106
+ - (
107
+ xp.exp((-t_in[None, :] - 4 * T + t0[:, None]) / tau_2[:, None])
108
+ * (t_in[None, :] + 4 * T - t0[:, None] + tau_2[:, None])
109
+ )
110
+ / tau_2[:, None]
111
+ )
112
+ * HeavisideTheta(t_in[None, :] + 4 * T - t0[:, None])
113
+ ) / co
114
+
115
+ tdiY1link12 = (
116
+ -2
117
+ * (
118
+ mtm
119
+ * Deltav[:, None]
120
+ * (
121
+ t_in[None, :]
122
+ + T
123
+ - t0[:, None]
124
+ - 2 * tau_2[:, None]
125
+ + (t_in[None, :] + T - t0[:, None] + 2 * tau_2[:, None])
126
+ / xp.exp((t_in[None, :] + T - t0[:, None]) / tau_2[:, None])
127
+ )
128
+ * DiracDelta(t_in[None, :] + T - t0[:, None])
129
+ + mtm
130
+ * Deltav[:, None]
131
+ * (
132
+ 1
133
+ - (t_in[None, :] + T - t0[:, None] + tau_2[:, None])
134
+ / (
135
+ xp.exp((t_in[None, :] + T - t0[:, None]) / tau_2[:, None])
136
+ * tau_2[:, None]
137
+ )
138
+ )
139
+ * HeavisideTheta(t_in[None, :] + T - t0[:, None])
140
+ )
141
+ ) / co + (
142
+ 2
143
+ * (
144
+ mtm
145
+ * Deltav[:, None]
146
+ * (
147
+ t_in[None, :]
148
+ + 3 * T
149
+ - t0[:, None]
150
+ - 2 * tau_2[:, None]
151
+ + xp.exp((-t_in[None, :] - 3 * T + t0[:, None]) / tau_2[:, None])
152
+ * (t_in[None, :] + 3 * T - t0[:, None] + 2 * tau_2[:, None])
153
+ )
154
+ * DiracDelta(t_in[None, :] + 3 * T - t0[:, None])
155
+ + mtm
156
+ * Deltav[:, None]
157
+ * (
158
+ 1
159
+ - (
160
+ xp.exp((-t_in[None, :] - 3 * T + t0[:, None]) / tau_2[:, None])
161
+ * (t_in[None, :] + 3 * T - t0[:, None] + tau_2[:, None])
162
+ )
163
+ / tau_2[:, None]
164
+ )
165
+ * HeavisideTheta(t_in[None, :] + 3 * T - t0[:, None])
166
+ )
167
+ ) / co
168
+
169
+ tdiZ1link12 = xp.zeros_like(tdiX1link12)
170
+
171
+ tdiX1link12[~run] = 0.0
172
+ tdiY1link12[~run] = 0.0
173
+ tdiZ1link12[~run] = 0.0
174
+
175
+ out[0, run] = tdiX1link12[run]
176
+ out[1, run] = tdiY1link12[run]
177
+ out[2, run] = tdiZ1link12[run]
178
+
179
+ return out
180
+
181
+
182
+ if __name__ == "__main__":
183
+ dt = 1 / 0.3
184
+ t = np.arange(2e3) * dt
185
+ check = tdi_glitch_XYZ1(
186
+ t
187
+ ) # , T=8.3, tau_1=480.0, tau_2=100.0, Deltav=1e-12, t0=600.0, mtm=1.982)
188
+ import matplotlib.pyplot as plt
189
+
190
+ plt.loglog(np.fft.rfftfreq(len(check[0]), dt), np.abs(np.fft.rfft(check[0])))
191
+ plt.loglog(np.fft.rfftfreq(len(check[0]), dt), np.abs(np.fft.rfft(check[1])))
192
+ plt.savefig("plot1.png")
193
+ breakpoint()
File without changes