6
$\begingroup$

I'd like to create a realistic starscape for an extant planet, ideally with seasonal tilt change like on Earth. While I realize I can just make it up (and will probably do so if I can't figure out how to do it for real), I'd really enjoy a re-creation based on known star data. Is there a way for me to do this with a reasonable amount of effort, and what would be an efficient way to do so?

Note: I have checked existing resources (including googling 'constellation simulator'), and none of these address my issue, as I want a simulation of what the real-world stars would look like from a specific real-world planet (let's say Kepler 442B for the moment). All of these resources either assume that either I am making up a universe from scratch, or that my desired viewpoint is from some point on Earth.

$\endgroup$
1
  • 1
    $\begingroup$ (a) Check out our Worldbuilding Resources page. (b) Look at Google's constellation simulator list. If neither of those work out for you, edit your question to explain why they didn't work out for you. Thanks! $\endgroup$
    – JBH
    Commented Jul 16, 2020 at 17:10

2 Answers 2

7
$\begingroup$

Celestia is the program that first comes to mind — it's a free, open-source 3D planetarium engine allowing you to travel around the local stellar neighborhood and view the sky from other locations. Search for your intended vantage point with the enter key, hit "G" to go there, and note down where the bright stars are.

If your intended vantage point doesn't exist in the program, it's not too hard to write up an .stc file with your star's celestial coordinates and distance from Earth. Adding an exoplanet with an axial tilt takes some more effort, but I believe it can be done — then just head down there to your preferred latitude and longitude on the surface to see what might be visible on a given date.

$\endgroup$
2
  • $\begingroup$ It is an amazing piece of (free!) software, but I'm not seeing any way to look at the sky as if you were on one of the planets it depicts. Am I missing something? $\endgroup$
    – Carduus
    Commented Jul 17, 2020 at 11:44
  • 1
    $\begingroup$ @Carduus You can use the "Goto Object..." function in the navigation menu to put yourself at a certain longitude and latitude at an altitude just above the surface, then hit "Y" to stay on that point as the planet rotates. You'll probably need to pan the camera up so you aren't looking at the ground. $\endgroup$
    – parasoup
    Commented Jul 17, 2020 at 19:17
4
$\begingroup$

Celestia is awesome, as parasoup noted, and it might be your best option. That said, you could do this yourself (and . . . I did - see below) by simply performing the right coordinate conversions. Stars are typically listed in databases by their equatorial coordinates, right ascension $\alpha$ and declination $\delta$, and their distance from Earth $d$ - a spherical coordinate system. If you know the location of the exoplanet you're interested in seeing the sky from, it's a simple enough matter to recalculate those positions by simply shifting your point of reference from Earth to that planet.

Let's say that our exoplanet lies at equatorial coordinates $(\alpha_p,\delta_p,d_p$) as viewed from Earth. Consider any star with coordinates ($\alpha,\delta,d$). Its location in Cartesian coordinates is then $$x=d\cos\delta\cos\alpha$$ $$y=d\cos\delta\sin\alpha$$ $$z=d\sin\delta$$ Similarly, the location of the exoplanet is $$x_p=d_p\cos\delta_p\cos\alpha_p$$ $$y_p=d_p\cos\delta_p\sin\alpha_p$$ $$z_p=d_p\sin\delta_p$$ Now we simply shift the star at $(x,y,z)$ accordingly to the Cartesian coordinate system with its origin at the exoplanet, $(x_p,y_p,z_p)$: $$x'=x-x_p$$ $$y'=y-y_p$$ $$z'=z-z_p$$ Finally, we convert back to spherical coordinates as seen from the planet, to get a new $(\alpha',\delta',d')$: $$d'=\sqrt{(x'^2+y'^2+z'^2}$$ $$\alpha'=\arctan\left(\frac{y'}{x'}\right)$$ $$\delta'=\arcsin\left(\frac{z'}{d'}\right)$$ If you do this for all of the bright stars in the sky, and carefully pick how you'll display them all, you can generate a view quite easily.

My implementation

I saw an opportunity to throw something fun together, so I wrote a Python script that performs the above conversions on almost 120,000 nearby stars, given a desired exoplanet's coordinates.

Currently, stars are displayed as white circles on a black background, with size proportional to their apparent magnitude as viewed from the planet. It projects everything onto a rectangle, so it's not great at the celestial poles or if you're viewing large swaths of sky. However, it's simple enough and works well for something I threw together in a couple of hours.

#!/usr/bin/env python

import numpy as np
import matplotlib.pyplot as plt

#Coordinates of planet
shift_ra = 0
shift_dec = 0
shift_dist = 0

ralist = []
declist = []

idlist = []
new_ralist = []
new_declist = []
new_distlist = []
new_maglist = []

#Data from the Hipparcos, Yale Bright Star and Gliese catalogs
data = open('hygdata_v3.csv', 'r').readlines()

for i in range(1, len(data)):
    #Basic proprties of stars
    line = data[i].split(',')
    id = line[0]
    hip = line[1]
    ra = float(line[7])
    dec = float(line[8])
    dist = float(line[9])
    absmag = float(line[14])
        
    #Convert to radians
    ra = (2*np.pi/24) * ra
    dec = (2*np.pi/360)* dec
    
    #Spherical to Cartesian
    x = dist*np.cos(dec)*np.cos(ra)
    y = dist*np.cos(dec)*np.sin(ra)
    z = dist*np.sin(dec)
       
    #Coordinates of target exoplanet       
    x_shift = shift_dist*np.cos(shift_dec)*np.cos(shift_ra)
    y_shift = shift_dist*np.cos(shift_dec)*np.sin(shift_ra)
    z_shift = shift_dist*np.sin(shift_dec)
     
    #Shifts coordinates based on exoplanet     
    new_x = x - x_shift
    new_y = y - y_shift
    new_z = z - z_shift
    
    #Cartesian to spherical   
    new_dist = np.sqrt((x - x_shift)**2 + (y - y_shift)**2 + (z - z_shift)**2)
    new_ra = np.arctan(new_y/new_x)
    new_dec = np.arcsin(new_z/new_dist)
    
    #Some fiddly bits to display nicely
    new_ra = 2 * (360/(2*np.pi)) * new_ra + 180
    new_dec = (360/(2*np.pi)) * new_dec

    new_ra = new_ra - 270
    if new_ra < 0:
        new_ra = new_ra + 360
    
    if new_dist != 0:
        #Size of star is related to apparent magnitude    
        appmag = absmag + 5*(np.log10(new_dist) - 1)
        lum = 50 * 10**(-appmag/1.5)

        idlist.append(id)
        new_ralist.append(new_ra)
        new_declist.append(new_dec)
        new_distlist.append(new_dist)
        new_maglist.append(lum)

fig = plt.figure(1)
ax = fig.add_subplot(111, facecolor='black')
ax.scatter(new_ralist, new_declist, s=new_maglist, color='white')
#Adjust the limits as needed
ax.set_xlim([0, 360])
ax.set_ylim([-90, 90])
ax.invert_xaxis()
ax.set_aspect('equal', adjustable='box')
plt.show()

As an example, here's Orion (looking a bit squashed because of projection issues):

Orion as seen from the Sun

Now, if I travel $d=10$ parsecs in the direction of $\alpha = 0$, $\delta = 0$, I see that looking toward that same group of stars, "Orion" looks a bit different (assuming I did the coordinate conversions correctly):

Betelgeuse after shifting 10 parsecs

We'd expect to see deformations of a few degrees if we traveled this far away, so it seems reasonable. It's possible there's a mistake in my code, though.

Similarly, here's how the script renders the night sky as seen on Earth:

Night sky on Earth]3

Here's how it renders it as seen from an exoplanet $d=10$ parsecs away at $\alpha=0$, $\delta=0$:

Night sky on this exoplanet

Of course, it's one thing to go from the celestial sphere to a night sky - any observer on an exoplanet only sees a portion of the celestial sphere, and of course it differs by latitude and time of year. But if you're looking to construct constellations, you might be okay with using this as a starting point.

$\endgroup$
3
  • $\begingroup$ Very nice little piece of code! $\endgroup$
    – Jim421616
    Commented Jul 18, 2020 at 21:33
  • $\begingroup$ Where did you get the data file from? $\endgroup$
    – Jim421616
    Commented Jul 26, 2020 at 23:01
  • $\begingroup$ @Jim421616 I got it from the site I linked to in the answer (in particular, version 3.0, if you want to try to reproduce the results), which in turn gathered data from the Hipparcos, Gliese and Yale Bright Star catalogs. $\endgroup$
    – HDE 226868
    Commented Jul 27, 2020 at 1:14

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .