Generating a custom landscape for Stellarium - smart-underworld/seestar_alp GitHub Wiki

I did this on iOS, and OSX using two paid tools - but I presume the details are similar on Windows / Android.

Software used:

Observer Pro is a paid app for iOS for astronomy planning. One of the features it has, is the ability to create horizon measurements, and export them to a .hrz file - which contains values measuring az/el in a text format

Affinity Photo is a paid image editing app that I use for astrophotography...it also happens to have panorama stitching capabilities.

Alternative software

While I don't cover the details here, the following tools may be good to investigate as free alternatives to the above Gyrocam and Gimp with a panorama plugin

Prepping the filesystem

On OSX, Stellarium stores files in ~/Library/Application Support/Stellarium/

The landscapes folder must be created, along with the two folders we will use for a polygon based landscape, and a panoramic image based landscape:

mkdir -p "~/Library/Application Support/Stellarium/landscapes/polygon"
mkdir -p "~/Library/Application Support/Stellarium/landscapes/panoramic"

Generating a polygon based horizon file

Using Observer Pro, generate a "site" - with a defined horizon. Export this file from iOS, to your computer. We will name this file horizon.hrz

Copy this file to "~/Library/Application Support/Stellarium/landscapes/polygon"

Create a text file in that same directory, named landscape.ini:

Note that text following ; are comments

[landscape]
name = your_polygon_name
author = You
description = anything is fine here
type = polygonal
polygonal_horizon_list = horizon.hrz
; in case the measured line was grid-relative only (meridian convergence issue) or had other problems, allow a corrective rotation also here.
; Unfortunately, a horizon with edges at exactly 0 or 180 degrees azimuth causes bad effects. Adding a minimal offset avoids this without causing much trouble.
; Because we can mix photo and polygon in the other classes, use a different name for the polygon rotation:
polygonal_angle_rotatez=0.00001

; Fill color for this landscape. It gets darkened at night
ground_color = .15,.45,.45
; Color for the line. It will not be drawn if this is not defined. This color will not be dimmed at night.
horizon_line_color =  .25,.15,.15
; specify a minimum brightness value 0..1 to have the ground always visible.
minimal_brightness = 0.15

[location]
light_pollution = 5
atmospheric_extinction_coefficient = 0.29
atmospheric_temperature = 10
; The next line with value -1 translates to "compute from altitude and standard atmosphere model"
atmospheric_pressure = -1
planet = Earth
latitude = YOUR_LATITUDE
longitude = YOUR_LONGITUDE
altitude = YOUR_ALTITUDE_IN_METERS

Generating an imaged based horizon file

Ideally, you would use a tool that could create an image sphere...but I couldn't find one for iOS that didn't require signing up for another service - so I stitched one myself

  1. Take a bunch of overlapping photos while spinning in place. Export these to your computer
  2. In Affinity Photo - create a new panorama from File -> New Panorama...
  3. Add the photos, and stitch them together
  4. Crop the photo so the left side matches up with the right side of the panorama - and any image warping artifacts are cropped out
  5. Scale the image to a width of 4096 pixels - keep the height auto generated
  6. Expand the canvas from Document -> Resize Canvas - make the document 4096x2048, keeping the existing panorama centered in the document
  7. Using the lasso tool - delete everything above your horizon - Eg, above trees, house lines, etc
  8. Move the actual horizon line to the midpoint of the Y axis @ 1024px
  9. Make a new layer behind the panorama layer
  10. Using the rectangular selection tool, select any part of the canvas visible below the bottom of the panorama.
  11. Using the fill tool - fill this selection in with a solid color of your choice
  12. Save the file, and export to a file - we'll use horizon.png for this
  13. Move/copy the horizon.png file to "~/Library/Application Support/Stellarium/landscapes/panoramic"
  14. Create a landscape ini file:
[landscape]
name = your_panoramic_name
author = you
description = anything is fine here
type = spherical
maptex = horizon.png
angle_rotatez = -41 ;Fine tune this to your site

minimal_brightness = 0.12

[location]
planet = Earth
country = USA
latitude = YOUR_LATITUDE
longitude = YOUR_LONGITUDE
altitude = YOUR_ALTITUDE_IN_METERS
light_pollution = 5
;atmospheric_extinction_coefficient = 0.175
timezone = Americas/New_York
  1. Using a compass app - note a landmark at one of the cardinal directions. Adjust angle_rotatez until this matches reality
  2. By switching between the polygon, and panoramic landscapes - you can validate your actual horizon is approximately correct by comparing your polygon horizon objects with your image. It may be necessary to go back to step 8, and adjust the horizon location.