Python scripts that allow you to visualize nearby stars with habitable planets. It also lets you query the information on the command-line (CLI).
I built this tool for a sci-fi writing project. I wanted to find & visualize all discovered habitable planets within 18 light years of Earth (as of 2021). My story only took place within 18 light years of Earth, so I only took the time to catalog stars within that range.
I have not tested this outside of Apple Silicon. YMMV.
Here's a quick guide on how to use this tool.
First, you'll need to clone the HYG Star Database. I included it as a submodule.
git submodule update --initI used pipenv to manage installation (link to pipenv docs). If you don't have it installed, please do so.
python3 -m pip install pipenv --userThen run pipenv install within the project to create the virtualenv & install dependencies. It will also install the correct version of Python (if necessary). The neat part is that it will be completely isolated from other Python installations & virtualenvs, so no worries about clutter!
cd /path/to/project
python3 -m pipenv installNOTE: If you have not initialized the project, please see Installation.
Enter the pipenv shell.
cd /path/to/project
python3 -m pipenv shellNow you can access the CLI. Note that you no longer need to use python3 alias (which was a requirement for Mac users). The correct version should be aliased to python.
> python star_catalog/catalog.py --help
usage: catalog.py [-h] [--show] [--console] ly
return list of closest stars
positional arguments:
ly Distance from Earth in light years
optional arguments:
-h, --help show this help message and exit
--show Show stars in 3D
--console Open interactive sessionDistance from Earth in light years. Data is only accurate/complete up to ~18 ly.
Display the stars in a 3D graph.
Open up an interactive IPython session to play around with the data.
All stars should be visible as blue dots. The sun (Sol) will be in the center of the point cloud.
Highlight a specific star by expanding it in the left view and clicking "Enabled". This will turn all other stars black and the star in question will turn red. In this case, I highlighted the sun (Sol).
I'd love to fill this data beyond 18 light years. I'd also love to build a web app version that anyone can access.

