Skip to main content

Table of Contents

  1. Installation
    1. pip
    2. Manually
  2. Usage
    1. Example

Event hoRyzen is a Python library designed to simulate and visualize geodesic motion around Schwarzschild, Reisner-Nordstrom, Kerr, and Kerr-Newman black holes. It uses a slightly modified version of Pierre Christian and Chi-kwan Chan’s FANTASY geodesic integration code (see https://github.com/pierrechristian/FANTASY + Pierre Christian and Chi-kwan Chan 2021 ApJ 909 67).

Installation

pip

pip install event-horyzen

or

pip install event-horzyen[pyqt]

(If you use zsh as your shell you will need to quote the package name for optional dependencies, i.e., “event-horyzen[pyqt]”)

Depending on whether or not you’d like to use the pyqtgraph and opengl plotting modules (They are not small dependencies. The option to plot with matplotlib is included in the base package).

Manually

git clone https://github.com/UCF-SPS-Research-21/event-horyzen

If you use Poetry for package and venv management, you can use

poetry install

or

poetry install -E pyqt

If you don’t, you can pip install -r requirements.txt or conda install --file requirements.txt. There are multiple versions of requirements.txt provided, it should be evident what each is for.

Usage

The code is configured with a YAML configuration file. Please see the example at <event_horyzen/config.yml>

Example

I use Unix paths in the examples. Windows paths will work too — just make sure you escape backslashes or make use of pathlib’s functionality.

If you’d like to use the default configuration, you can just leave the argument to event_horyzen.run() empty. To copy the default config and edit it, do the following.

from pathlib import Path
from event_horyzen import event_horyzen

dest = Path("./foo/")
event_horyzen.copy_default_config(dest)

If you don’t specify a destination, it will copy the file to your current working directory. Now, assuming you’ve edited the config to your liking and its named config.yml:

from pathlib import Path
from event_horyzen import event_horyzen

conf_path = Path('./config.yml')
event_horyzen.run(conf_path)

or for multiple geodesics simulated in parallel

from pathlib import Path
from event_horyzen import event_horyzen

conf_path1 = Path('./config1.yml')
conf_path2 = Path('./config2.yml')
conf_path3 = Path('./config3.yml')

confs = [conf_path1, conf_path2, conf_path3]

event_horyzen.run(confs)

A unique directory under the output directory specified in the configuration file will be created in the format <output-dir>/<date+time>_<name-of-config-file>. So, it makes sense to give your configuration files meaningful names. The geodesic in both spherical and cartesian coordinates will be saved to this directory as results.h5. The configuration file used to generate the simulation will be copied to this directory as well to ensure reproducibility. A basic plot of the geodesic is also created and saved in the directory as both a .PNG and a pickle file so that the figure can be reloaded and interacted with. Example Kerr-Newman Plot

If you want to load the pickled Matplotlib plot, you can do the following.

import pickle as pl
from pathlib import Path

plot_path = Path("<path-to-plot>/basic-plot.pickle")

with open(plot_path, "rb") as plot:
    fig = pl.load(plot)

# Now do whatever you want with the figure!

fig.show()

For the 3D plotting,

from pathlib import Path
from event_horyzen import animated_plot as ap

results = Path("./results.h5")
viz = ap.Visualizer(results)
viz.animation()

or for multiple geodesics on the same plot

from pathlib import Path
from event_horyzen import animated_plot as ap

results1 = Path("./results1.h5")
results2 = Path("./results2.h5")
results3 = Path("./results3.h5")

results = [results1, results2, results3]

viz = ap.Visualizer(results)
viz.animation()

By default, it puts a photon sphere for a M=1 (geometrized units) schwarzschild black hole on the plot for reference. This can be turned off or modified in the call to Visualizer().

Both the simulation and the plotting can be ran directly from the command line

First, the simulation tools.

event-horyzen -h

usage: event-horyzen [-h] [datapath ...]

positional arguments:
  datapath    The path(s) to the configuration file(s). Defaults to the
              included `config.yml` if not provided.

options:
  -h, --help  show this help message and exit

Now, the plotting tools.

event-horyzen-plot -h

usage: event-horyzen-plot [-h] datapath [datapath ...]

positional arguments:
  datapath    The path(s) to the data file(s).

options:
  -h, --help  show this help message and exit

Metadata

Release files for event-horyzen 0.1.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for event-horyzen 0.1.2
File Size Uploaded Provenance Actions
event-horyzen-0.1.2.tar.gz 26.0 kB Without provenance Details for event-horyzen-0.1.2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for event-horyzen 0.1.2
File Interpreter ABI Platform Actions
event_horyzen-0.1.2-py3-none-any.whl Python 3 none any Details for event_horyzen-0.1.2-py3-none-any.whl

Total release size: 64.6 kB

Release files / event-horyzen-0.1.2.tar.gz

Download URL event-horyzen-0.1.2.tar.gz
Size 26.0 kB
Tags Source
SHA-256 checksum
How to use checksums
e9153e850da75e3b8686aca4bfcf687ac7576d07a2d1801b96a06dbc9be271c2
BLAKE2b-256 checksum
How to use checksums
6f9fd37925cc99caa3469db7533074996e923c921bb00d71c804c492cc8fac62
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.1.12 CPython/3.10.1 Linux/5.15.12-arch1-1

Release files / event_horyzen-0.1.2-py3-none-any.whl

Download URL event_horyzen-0.1.2-py3-none-any.whl
Size 38.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
8cc21322c865017b99468e4cdecbbe860d832f7fd01036e36ea11cfc02668d98
BLAKE2b-256 checksum
How to use checksums
5e209307c565209a9798289b639a26f605d379601260c6ec255952b4df8ab403
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.1.12 CPython/3.10.1 Linux/5.15.12-arch1-1

Security for event-horyzen 0.1.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page