kerrz-python 0.1.0__tar.gz
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-0.1.0/PKG-INFO +29 -0
- kerrz_python-0.1.0/README.md +1 -0
- kerrz_python-0.1.0/kerrz_python/VERSION +1 -0
- kerrz_python-0.1.0/kerrz_python/__init__.py +68 -0
- kerrz_python-0.1.0/kerrz_python.egg-info/PKG-INFO +29 -0
- kerrz_python-0.1.0/kerrz_python.egg-info/SOURCES.txt +10 -0
- kerrz_python-0.1.0/kerrz_python.egg-info/dependency_links.txt +1 -0
- kerrz_python-0.1.0/kerrz_python.egg-info/requires.txt +1 -0
- kerrz_python-0.1.0/kerrz_python.egg-info/top_level.txt +1 -0
- kerrz_python-0.1.0/pyproject.toml +6 -0
- kerrz_python-0.1.0/setup.cfg +4 -0
- kerrz_python-0.1.0/setup.py +35 -0
|
@@ -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 @@
|
|
|
1
|
+
# kerrz-python: a Python wrapper for libkerrz
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
0.1.0
|
|
@@ -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,10 @@
|
|
|
1
|
+
README.md
|
|
2
|
+
pyproject.toml
|
|
3
|
+
setup.py
|
|
4
|
+
kerrz_python/VERSION
|
|
5
|
+
kerrz_python/__init__.py
|
|
6
|
+
kerrz_python.egg-info/PKG-INFO
|
|
7
|
+
kerrz_python.egg-info/SOURCES.txt
|
|
8
|
+
kerrz_python.egg-info/dependency_links.txt
|
|
9
|
+
kerrz_python.egg-info/requires.txt
|
|
10
|
+
kerrz_python.egg-info/top_level.txt
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
kerrz_lib>=0.1.15
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
kerrz_python
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import sys
|
|
2
|
+
import os
|
|
3
|
+
import pathlib
|
|
4
|
+
from setuptools import setup
|
|
5
|
+
|
|
6
|
+
package_name = "kerrz_python"
|
|
7
|
+
version = (pathlib.Path(package_name) / "VERSION").read_text().strip()
|
|
8
|
+
readme = pathlib.Path("README.md").read_text()
|
|
9
|
+
|
|
10
|
+
setup(
|
|
11
|
+
author="Fergus Baker",
|
|
12
|
+
author_email="fergus@cosroe.com",
|
|
13
|
+
description="Python wrapper for kerrz. Avoid installing directly, use kerrz[py] unless you know what you are doing.",
|
|
14
|
+
keywords=["relativity", "black-holes", "raytracing"],
|
|
15
|
+
long_description=readme,
|
|
16
|
+
long_description_content_type="text/markdown",
|
|
17
|
+
python_requires=">=3.6",
|
|
18
|
+
install_requires=["kerrz_lib>=0.1.15"],
|
|
19
|
+
license="GPL-3.0-or-later",
|
|
20
|
+
name=package_name,
|
|
21
|
+
version=version,
|
|
22
|
+
packages=[package_name],
|
|
23
|
+
package_dir={
|
|
24
|
+
package_name: package_name,
|
|
25
|
+
},
|
|
26
|
+
url=f"https://codeberg.org/astro-group/kerrz-py",
|
|
27
|
+
classifiers=[
|
|
28
|
+
"Natural Language :: English",
|
|
29
|
+
"Operating System :: MacOS",
|
|
30
|
+
"Operating System :: POSIX :: Linux",
|
|
31
|
+
"Programming Language :: Python :: 3",
|
|
32
|
+
],
|
|
33
|
+
include_package_data=True,
|
|
34
|
+
package_data={package_name: ["VERSION"]},
|
|
35
|
+
)
|