TransWikia.com

How can I depict the stars as if looking up from a specific planet not in our solar system?

Worldbuilding Asked on September 3, 2021

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.

2 Answers

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.

Correct answer by parasoup on September 3, 2021

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=dcosdeltacosalpha$$ $$y=dcosdeltasinalpha$$ $$z=dsindelta$$ Similarly, the location of the exoplanet is $$x_p=d_pcosdelta_pcosalpha_p$$ $$y_p=d_pcosdelta_psinalpha_p$$ $$z_p=d_psindelta_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'=arctanleft(frac{y'}{x'}right)$$ $$delta'=arcsinleft(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.

Answered by HDE 226868 on September 3, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP