Create a fisheye horizon landscape for Stellarium
2023 Dec 03 - Brian Kloppenborg
In this blog post I explain how to use your mobile phone and some cross-platform software to create a custom fisheye landscape for Stellarium. This form of landscape is exceptionally useful for planning observations from less-than-ideal observing locations. For example, I observe from my condo’s covered patio. As shown in the image below, my field of view is restricted by the patio ceiling, roof overhangs, gutters, downspouts, trees, and nearby buildings. Creating this projection map in Stellarium allows me to quickly check if a given object is observable without having to use complicated tools.
Creating a landscape like this isn’t too difficult. The steps are as follows:
- Create a panorama or photosphere of your observing location.
- Use Hugin to change the projection method
- Edit the image to make sky regions transparent
- Create a new landscape for Stellarium.
- Activate the landscape within Stellarium.
1. Create a panorama or photosphere of your observing location
The precise method for how to do this is beyond the scope of this blog post. With that said, there are multiple ways to do this:
- Sitching together photos to form panoramas using Hugin,
- Creating photo spheres using Android’s default photo application, or
- Creating photo spheres using the Photo Sphere application for iOS
In all situations, once you’ve created either a panorama or photosphere save it to your local computer so we can change the projection in the next step.
2. Use Hugin to change the projection mode.
After installing Hugin on your computer, launch the software and perform the following steps:
- Add your panorama / panosphere image to Hugin.
- At the top of the screen, click the “Preview Project” button.
- In the “Move/Drag” tab, change the Pitch to -90 degrees and click “Apply”. This should rotate the previewed image so that the Zenith is up in the preview.
- In the “Projection” tab select “Fisheye” from the drop-down menu.
- In the “Crop” tab click “Autocrop Outside”. This will change the white box in right preview menu to include the entire fisheye projection.
- In the “Assistant Tab” click “Create Panorama”
- Save the resulting image as a PNG.
Screenshots of these steps are shown in the images below.
3. Edit the image to make sky regions transparent
The precise method to do this is also beyond the scope of this tutorial. Generically speaking, open up the resulting image in your favorite image editing software and use the free selection tool to cut out regions containing the sky. In Gimp, this is accomplished using the lasso tool and pressing “delete” with the background color set to the image’s transparent color. Save the resulting image as a PNG file with transparency enabled.
I would also suggest padding the top/bottom and left/right equally to make the image square. Doing so will make it a lot easier to apply scaling adjustments in the next step of this process.
The images below show my original fisheye projection image with the sky present and the edited version with the sky removed. The images were taken during the winter, so I’ve allowed generous spacing around the trees to allow for foliage during the summer months. Notice that I also tightly cropped the image to minimize the black area outside of the fisheye projection.
4. Create a new landscape for Stellarium.
- Make a new directory to hold the data
Create a new directory in the Stellarium User Data Directory to hold your landscape data. When this document was written, the current version of Stellarium was 23.0 and the data were stored here:
Newer versions of Stellarium may use different locations, so please consult the documentation above for more recent versions.
- Put your fisheye projection file in that directory. I named mine
- Create a
landscape.inifile with the following data and save it
name = My Observatory's Horizon
author = Your Name
description = Some useful description
type = fisheye
maptex = fisheye_projection.png
texturefov = 220
minimal_altitude = -2
You may need to try different values of the following parameters to best fit your image:
texturefov- sets the total field of view of the projection. Ideally this would be 180 degrees; however, Hugin often makes projections that are larger than this. You can count the 10 degree squares in Hugin to get an estimate of how large your image will be.
minimal_altitude- specifies the altitude for the lower bound of the image.
angle_rotatez- allows you to rotate the image around the zenith location to align with North.
5. Activate the landscape within Stellarium.
Launch Stellarium. If all went well, you should find your new landscape in the “Sky and Viewing Options [F4]” dialog under the Landscape tab.