lisaanalysistools 1.0.1__cp312-cp312-macosx_10_9_x86_64.whl → 1.0.3__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.

@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: lisaanalysistools
3
- Version: 1.0.1
3
+ Version: 1.0.3
4
4
  Home-page: https://github.com/mikekatz04/lisa-on-gpu
5
5
  Author: Michael Katz
6
6
  Author-email: mikekatz04@gmail.com
@@ -59,7 +59,7 @@ Please read [CONTRIBUTING.md](CONTRIBUTING.md) for details on our code of conduc
59
59
 
60
60
  We use [SemVer](http://semver.org/) for versioning. For the versions available, see the [tags on this repository](https://github.com/BlackHolePerturbationToolkit/FastEMRIWaveforms/tags).
61
61
 
62
- Current Version: 1.0.1
62
+ Current Version: 1.0.3
63
63
 
64
64
  ## Authors/Developers
65
65
 
@@ -1,13 +1,13 @@
1
1
  lisatools/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
2
- lisatools/_version.py,sha256=1jFk9o0EEGpBLxDSAAHpzrzFxfly0qjljEoqarE0STI,123
3
- lisatools/analysiscontainer.py,sha256=KG1Iww3iYHyeoKYgfASqQ2Lu2VilXuW9zDW1Jkw5ARc,15329
2
+ lisatools/_version.py,sha256=jdUA4C9ymxkLy21lzpy24-UicUen9JG4Nd2NN9PTeuc,123
3
+ lisatools/analysiscontainer.py,sha256=7IV5Ddd9sP5uLenEDmitmrSG7GhUzVojs41XAgJSwVg,15333
4
4
  lisatools/datacontainer.py,sha256=MErM0cWZdxVtbaA8HTU79bXmxv2XcYDcqPiHyPbPZE0,9224
5
- lisatools/detector.py,sha256=YGia0eoeftXDxIJXDsC8MsfRm_Z1xwUG2r-qZ6lNvOs,12163
5
+ lisatools/detector.py,sha256=Ht5v-Iq_DJlCWMt9iSbZwmEwTGwd3pdeOaw4lBtmiBQ,13852
6
6
  lisatools/diagnostic.py,sha256=oPMovelkyTYUXQWzLvtZB-nia-oxYhlNIci4P2r0Bhg,34177
7
7
  lisatools/glitch.py,sha256=qMNSqdmGqdm6kVtZP9qncP_40DyPj9ushbXh88g9wlU,5154
8
8
  lisatools/sensitivity.py,sha256=4ELRfrB5CY7Fkg6LYuuseTdbqnx59My0i7cGvK2VxKg,27236
9
9
  lisatools/stochastic.py,sha256=XYZpsWiVB8Yz9V5-_hAKjzOfqe8e5ln0amtWypjqCCg,9440
10
- lisatools/cutils/detector.cpython-312-darwin.so,sha256=THx-1ysBWhHf54vU10ZyBpQN-38ON7F7IE74FTwvatQ,121664
10
+ lisatools/cutils/detector.cpython-312-darwin.so,sha256=FguczB3QPZfL3CCSMEuIx3VP0jj240_Dh30anER84m8,121664
11
11
  lisatools/sampling/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
12
12
  lisatools/sampling/likelihood.py,sha256=G2kAQ43qlhAzIFWvYsrSmHXd7WKJAzcCN2o07vRE8vc,29585
13
13
  lisatools/sampling/prior.py,sha256=V9sWorxDamgsSFPZpK3t1651yPp6znRVXe0zto0wFpc,18461
@@ -30,8 +30,8 @@ lisatools/utils/constants.py,sha256=r1kVwkpbZS13JTOxj2iRxT5sMgTYX30y-S0JdVmD5Oo,
30
30
  lisatools/utils/multigpudataholder.py,sha256=6HwkOceqga1Q7eK4TjStGXy4oKgx37hTkdcAwiiZ8_Y,33765
31
31
  lisatools/utils/pointeradjust.py,sha256=2sT-7qeYWr1pd_sHk9leVHUTSJ7jJgYIRoWQOtYqguE,2995
32
32
  lisatools/utils/utility.py,sha256=TgZ4vLVGih4ZU2caMRlK06m8nMoEVvwrS3Q7dH83u1g,6742
33
- lisaanalysistools-1.0.1.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
34
- lisaanalysistools-1.0.1.dist-info/METADATA,sha256=vc9LlEpkF1ewaHP-pMHaWCHHzdqKTfo8W3IL4taqrd8,2753
35
- lisaanalysistools-1.0.1.dist-info/WHEEL,sha256=KYtn_mzb_QwZSHwPlosUO3fDl70znfUFngLlrLVHeBY,111
36
- lisaanalysistools-1.0.1.dist-info/top_level.txt,sha256=oCQGY7qy66i_b9MCsK2fTRdbV1pcC9GsGgIDjN47Tyc,14
37
- lisaanalysistools-1.0.1.dist-info/RECORD,,
33
+ lisaanalysistools-1.0.3.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
34
+ lisaanalysistools-1.0.3.dist-info/METADATA,sha256=jHsBjQZRdfnN72tM9B83NDwk5xtmKGs3epn7bzL6jZk,2753
35
+ lisaanalysistools-1.0.3.dist-info/WHEEL,sha256=KYtn_mzb_QwZSHwPlosUO3fDl70znfUFngLlrLVHeBY,111
36
+ lisaanalysistools-1.0.3.dist-info/top_level.txt,sha256=oCQGY7qy66i_b9MCsK2fTRdbV1pcC9GsGgIDjN47Tyc,14
37
+ lisaanalysistools-1.0.3.dist-info/RECORD,,
lisatools/_version.py CHANGED
@@ -1,4 +1,4 @@
1
- __version__ = '1.0.1'
1
+ __version__ = '1.0.3'
2
2
  __copyright__ = "Michael L. Katz 2024"
3
3
  __name__ = "lisaanalysistools"
4
4
  __author__ = "Michael L. Katz"
@@ -268,7 +268,7 @@ class AnalysisContainer:
268
268
  return noise_likelihood_term(self.sens_mat)
269
269
  elif source_only:
270
270
  return residual_source_likelihood_term(
271
- self.data_res_arr, self.sens_mat, **kwargs
271
+ self.data_res_arr, psd=self.sens_mat, **kwargs
272
272
  )
273
273
  else:
274
274
  return residual_full_source_and_noise_likelihood(
lisatools/detector.py CHANGED
@@ -22,7 +22,6 @@ class Orbits(ABC):
22
22
  Args:
23
23
  filename: File name. File should be in the style of LISAOrbits
24
24
 
25
-
26
25
  """
27
26
 
28
27
  def __init__(self, filename: str) -> None:
@@ -51,6 +50,7 @@ class Orbits(ABC):
51
50
  return [int(str(link_i)[1]) for link_i in self.LINKS]
52
51
 
53
52
  def _setup(self) -> None:
53
+ """Read in orbital data from file and store."""
54
54
  with self.open() as f:
55
55
  for key in f.attrs.keys():
56
56
  setattr(self, key + "_base", f.attrs[key])
@@ -63,22 +63,33 @@ class Orbits(ABC):
63
63
  @filename.setter
64
64
  def filename(self, filename: str) -> None:
65
65
  """Set file name."""
66
+
66
67
  assert isinstance(filename, str)
68
+
69
+ # get path
67
70
  path_to_this_file = __file__.split("detector.py")[0]
71
+
72
+ # make sure orbit_files directory exists in the right place
68
73
  if not os.path.exists(path_to_this_file + "orbit_files/"):
69
74
  os.mkdir(path_to_this_file + "orbit_files/")
70
75
  path_to_this_file = path_to_this_file + "orbit_files/"
76
+
71
77
  if not os.path.exists(path_to_this_file + filename):
72
- github_file = f"https://github.com/mikekatz04/LISAanalysistools/raw/main/orbit_files/{filename}"
78
+ # download files from github if they are not there
79
+ github_file = f"https://github.com/mikekatz04/LISAanalysistools/raw/main/lisatools/orbit_files/{filename}"
73
80
  r = requests.get(github_file)
81
+
82
+ # if not success
74
83
  if r.status_code != 200:
75
84
  raise ValueError(
76
- f"Cannot find {filename} within default files located at github.com/mikekatz04/LISAanalysistools/orbit_files/."
85
+ f"Cannot find {filename} within default files located at github.com/mikekatz04/LISAanalysistools/lisatools/orbit_files/."
77
86
  )
78
87
 
88
+ # write the contents to a local file
79
89
  with open(path_to_this_file + filename, "wb") as f:
80
90
  f.write(r.content)
81
91
 
92
+ # store
82
93
  self._filename = path_to_this_file + filename
83
94
 
84
95
  def open(self) -> h5py.File:
@@ -96,7 +107,7 @@ class Orbits(ABC):
96
107
 
97
108
  @property
98
109
  def t_base(self) -> np.ndarray:
99
- """Light travel times along links from file."""
110
+ """Time array from file."""
100
111
  with self.open() as f:
101
112
  t_base = np.arange(self.size_base) * self.dt_base
102
113
  return t_base
@@ -117,14 +128,14 @@ class Orbits(ABC):
117
128
 
118
129
  @property
119
130
  def x_base(self) -> np.ndarray:
120
- """Light travel times along links from file."""
131
+ """Spacecraft position from file."""
121
132
  with self.open() as f:
122
133
  x = f["tcb"]["x"][:]
123
134
  return x
124
135
 
125
136
  @property
126
137
  def v_base(self) -> np.ndarray:
127
- """Light travel times along links from file."""
138
+ """Spacecraft velocities from file."""
128
139
  with self.open() as f:
129
140
  v = f["tcb"]["v"][:]
130
141
  return v
@@ -154,35 +165,35 @@ class Orbits(ABC):
154
165
 
155
166
  @property
156
167
  def n(self) -> np.ndarray:
157
- """Light travel time."""
168
+ """Normal vectors along links."""
158
169
  self._check_configured()
159
170
  return self._n
160
171
 
161
172
  @n.setter
162
173
  def n(self, n: np.ndarray) -> np.ndarray:
163
- """Set light travel time."""
174
+ """Set Normal vectors along links."""
164
175
  return self._n
165
176
 
166
177
  @property
167
178
  def x(self) -> np.ndarray:
168
- """Light travel time."""
179
+ """Spacecraft positions."""
169
180
  self._check_configured()
170
181
  return self._x
171
182
 
172
183
  @x.setter
173
184
  def x(self, x: np.ndarray) -> np.ndarray:
174
- """Set light travel time."""
185
+ """Set Spacecraft positions."""
175
186
  return self._x
176
187
 
177
188
  @property
178
189
  def v(self) -> np.ndarray:
179
- """Light travel time."""
190
+ """Spacecraft velocities."""
180
191
  self._check_configured()
181
192
  return self._v
182
193
 
183
194
  @v.setter
184
195
  def v(self, v: np.ndarray) -> np.ndarray:
185
- """Set light travel time."""
196
+ """Set Spacecraft velocities."""
186
197
  return self._v
187
198
 
188
199
  def configure(
@@ -290,6 +301,7 @@ class Orbits(ABC):
290
301
 
291
302
  @property
292
303
  def pycppdetector_args(self) -> tuple:
304
+ """args for the c++ class."""
293
305
  return self._pycppdetector_args
294
306
 
295
307
  @pycppdetector_args.setter
@@ -311,30 +323,81 @@ class Orbits(ABC):
311
323
  def get_light_travel_times(
312
324
  self, t: float | np.ndarray, link: int
313
325
  ) -> float | np.ndarray:
326
+ """Compute light travel time as a function of time.
327
+
328
+ Computes with the c++ backend.
329
+
330
+ Args:
331
+ t: Time array in seconds.
332
+ link: which link. Must be ``in self.LINKS``.
333
+
334
+ Returns:
335
+ Light travel times.
336
+
337
+ """
314
338
  return self.pycppdetector.get_light_travel_time(t, link)
315
339
 
316
340
  def get_normal_unit_vec(self, t: float | np.ndarray, link: int) -> np.ndarray:
341
+ """Compute link normal vector as a function of time.
342
+
343
+ Computes with the c++ backend.
344
+
345
+ Args:
346
+ t: Time array in seconds.
347
+ link: which link. Must be ``in self.LINKS``.
348
+
349
+ Returns:
350
+ Link normal vectors.
351
+
352
+ """
317
353
  return self.pycppdetector.get_normal_unit_vec(t, link)
318
354
 
319
355
  def get_pos(self, t: float | np.ndarray, sc: int) -> np.ndarray:
356
+ """Compute spacecraft position as a function of time.
357
+
358
+ Computes with the c++ backend.
359
+
360
+ Args:
361
+ t: Time array in seconds.
362
+ sc: which spacecraft. Must be ``in self.SC``.
363
+
364
+ Returns:
365
+ Spacecraft positions.
366
+
367
+ """
320
368
  return self.pycppdetector.get_pos(t, sc)
321
369
 
322
370
  @property
323
371
  def ptr(self) -> int:
324
- """pointer to c-class"""
372
+ """pointer to c++ class"""
325
373
  return self.pycppdetector.ptr
326
374
 
327
375
 
328
376
  class EqualArmlengthOrbits(Orbits):
329
- """Equal Armlength Orbits"""
377
+ """Equal Armlength Orbits
378
+
379
+ Orbit file: equalarmlength-orbits.h5
380
+
381
+ """
330
382
 
331
383
  def __init__(self):
332
- # TODO: fix this up
333
384
  super().__init__("equalarmlength-orbits.h5")
334
385
 
335
386
 
387
+ class ESAOrbits(Orbits):
388
+ """ESA Orbits
389
+
390
+ Orbit file: esa-trailing-orbits.h5
391
+
392
+ """
393
+
394
+ def __init__(self):
395
+ # TODO: fix this up
396
+ super().__init__("esa-trailing-orbits.h5")
397
+
398
+
336
399
  class DefaultOrbits(EqualArmlengthOrbits):
337
- """Set default orbit class to Equal Arm Length orbits for now."""
400
+ """Set default orbit class to Equal Armlength orbits for now."""
338
401
 
339
402
  pass
340
403
 
@@ -343,11 +406,10 @@ class DefaultOrbits(EqualArmlengthOrbits):
343
406
  class LISAModelSettings:
344
407
  """Required LISA model settings:
345
408
 
346
- TODO: rename these
347
-
348
409
  Args:
349
410
  Soms_d: OMS displacement noise.
350
411
  Sa_a: Acceleration noise.
412
+ orbits: Orbital information.
351
413
  name: Name of model.
352
414
 
353
415
  """
@@ -359,7 +421,16 @@ class LISAModelSettings:
359
421
 
360
422
 
361
423
  class LISAModel(LISAModelSettings, ABC):
362
- """Model for the LISA Constellation"""
424
+ """Model for the LISA Constellation
425
+
426
+ This includes sensitivity information computed in
427
+ :module:`lisatools.sensitivity` and orbital information
428
+ contained in an :class:`Orbits` class object.
429
+
430
+ This class is used to house high-level methods useful
431
+ to various needed computations.
432
+
433
+ """
363
434
 
364
435
  def __str__(self) -> str:
365
436
  out = "LISA Constellation Configurations Settings:\n"
@@ -368,6 +439,7 @@ class LISAModel(LISAModelSettings, ABC):
368
439
  return out
369
440
 
370
441
 
442
+ # defaults
371
443
  scirdv1 = LISAModel((15.0e-12) ** 2, (3.0e-15) ** 2, DefaultOrbits(), "scirdv1")
372
444
  proposal = LISAModel((10.0e-12) ** 2, (3.0e-15) ** 2, DefaultOrbits(), "proposal")
373
445
  mrdv1 = LISAModel((10.0e-12) ** 2, (2.4e-15) ** 2, DefaultOrbits(), "mrdv1")