kerrz-python 0.1.0__py3-none-any.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.
kerrz_python/VERSION
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
0.1.0
|
kerrz_python/__init__.py
ADDED
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import dataclasses
|
|
2
|
+
import ctypes
|
|
3
|
+
import enum
|
|
4
|
+
import kerrz_lib.bindings as bindings
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
class Status(enum.Enum):
|
|
8
|
+
NONE = 0
|
|
9
|
+
EVENT_HORIZON = 1
|
|
10
|
+
INTERSECTED_DISC = 2
|
|
11
|
+
AT_INFINITY = 3
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
@dataclasses.dataclass
|
|
15
|
+
class GeodesicPoint:
|
|
16
|
+
status: Status
|
|
17
|
+
t: float
|
|
18
|
+
r: float
|
|
19
|
+
theta: float
|
|
20
|
+
phi: float
|
|
21
|
+
winding: int
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
@dataclasses.dataclass
|
|
25
|
+
class TurningPoints:
|
|
26
|
+
r_0: float
|
|
27
|
+
r_1: float
|
|
28
|
+
theta_0: float
|
|
29
|
+
theta_1: float
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
class NullGeodesic:
|
|
33
|
+
|
|
34
|
+
def __init__(self, path_builder: bindings.krz_PathBuilder):
|
|
35
|
+
self._path_builder = path_builder
|
|
36
|
+
|
|
37
|
+
def at_mino_time(self, mino_time) -> GeodesicPoint:
|
|
38
|
+
result = bindings.krz_at_mino_time(ctypes.byref(self._path_builder), mino_time)
|
|
39
|
+
return GeodesicPoint(
|
|
40
|
+
status=result.status,
|
|
41
|
+
t=result.t,
|
|
42
|
+
r=result.r,
|
|
43
|
+
theta=result.theta,
|
|
44
|
+
phi=result.phi,
|
|
45
|
+
winding=int(result.winding),
|
|
46
|
+
)
|
|
47
|
+
|
|
48
|
+
def turning_points(self) -> TurningPoints:
|
|
49
|
+
p = bindings.krz_mino_time_to_turning_points(self._path_builder)
|
|
50
|
+
return TurningPoints(theta_0=p.theta_0, theta_1=p.theta_1, r_0=p.r_0, r_1=p.r_1)
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
def trace_impact_parameters(
|
|
54
|
+
alpha, beta, r=1e4, theta=1.0, a=0.998, M=1.0
|
|
55
|
+
) -> NullGeodesic:
|
|
56
|
+
metric = bindings.krz_kerrMetric(M, a)
|
|
57
|
+
ic = bindings.krz_InitialConditions()
|
|
58
|
+
x_init = bindings.krz_FourVector(t=0.0, r=r, th=theta, ph=0.0)
|
|
59
|
+
|
|
60
|
+
bindings.krz_fromImpactParameters(ctypes.byref(ic), metric, x_init, alpha, beta)
|
|
61
|
+
|
|
62
|
+
pb = bindings.krz_PathBuilder()
|
|
63
|
+
bindings.krz_PathBuilder_init(ctypes.byref(pb), metric, ic)
|
|
64
|
+
|
|
65
|
+
return NullGeodesic(pb)
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
__all__ = [Status, GeodesicPoint, TurningPoints, NullGeodesic, trace_impact_parameters]
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: kerrz_python
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Python wrapper for kerrz. Avoid installing directly, use kerrz[py] unless you know what you are doing.
|
|
5
|
+
Home-page: https://codeberg.org/astro-group/kerrz-py
|
|
6
|
+
Author: Fergus Baker
|
|
7
|
+
Author-email: fergus@cosroe.com
|
|
8
|
+
License: GPL-3.0-or-later
|
|
9
|
+
Keywords: relativity,black-holes,raytracing
|
|
10
|
+
Classifier: Natural Language :: English
|
|
11
|
+
Classifier: Operating System :: MacOS
|
|
12
|
+
Classifier: Operating System :: POSIX :: Linux
|
|
13
|
+
Classifier: Programming Language :: Python :: 3
|
|
14
|
+
Requires-Python: >=3.6
|
|
15
|
+
Description-Content-Type: text/markdown
|
|
16
|
+
Requires-Dist: kerrz_lib>=0.1.15
|
|
17
|
+
Dynamic: author
|
|
18
|
+
Dynamic: author-email
|
|
19
|
+
Dynamic: classifier
|
|
20
|
+
Dynamic: description
|
|
21
|
+
Dynamic: description-content-type
|
|
22
|
+
Dynamic: home-page
|
|
23
|
+
Dynamic: keywords
|
|
24
|
+
Dynamic: license
|
|
25
|
+
Dynamic: requires-dist
|
|
26
|
+
Dynamic: requires-python
|
|
27
|
+
Dynamic: summary
|
|
28
|
+
|
|
29
|
+
# kerrz-python: a Python wrapper for libkerrz
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
kerrz_python/VERSION,sha256=6d2FB_S_DG9CRY5BrqgzrQvT9hJycjNe7pv01YVB7Wc,6
|
|
2
|
+
kerrz_python/__init__.py,sha256=N1Ot9-bjBzV9U6zXygnJj_IuYBeZ65aLjwotrjkEoYc,1709
|
|
3
|
+
kerrz_python-0.1.0.dist-info/METADATA,sha256=dP69s3m8fWBAZhvoYiLW_KIBXlhhPbIcSwo0Dtg2sqA,892
|
|
4
|
+
kerrz_python-0.1.0.dist-info/WHEEL,sha256=aeYiig01lYGDzBgS8HxWXOg3uV61G9ijOsup-k9o1sk,91
|
|
5
|
+
kerrz_python-0.1.0.dist-info/top_level.txt,sha256=VE5FXiV_0bU2zLJXRHlPT1ogwv1BKmBTnlxTk_SKZbo,13
|
|
6
|
+
kerrz_python-0.1.0.dist-info/RECORD,,
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
kerrz_python
|