Sun-centred Halo to Zenith Fisheye using Hugin

Updated August 5, 2019

Ice crystal halo displays that cover much of the sky present a variety of challenges to those of us trying to image them. Often, one needs to block the Sun while simultaneously catching the fainter traces of arcs overhead and at the anthelion point. This article focuses on using Hugin panoramic software to display the results in different ways. Without a fisheye lens, with old images showing only part of the sky, you can still provide a scene for VR360 viewers or the dome of a planetarium!

Original, Sun-centric


VR360


Dome


"Sparing no expense" would be nice: having unconstrained time and 2 cameras with high end lenses is ideal. The good news for most of us is that a lot is possible with modest equipment.

The first tradeoff I take is to use an occulting disk to block the Sun, accepting the downside that the view also contains the support rod. One can argue that there is minimal impact in taking a few quick shots without protection. However, I love time-lapses, which require keeping the lenses and detectors pointed at the Sun for hours.

Setup on a Star Adventurer tracker, with a Samsung Gear360 as the camera.

You can quickly see why the original image is tilted on its side: it is a side effect of shooting in the equatorial mode. AltAz trackers avoid this issue since one can ensure the camera is parallel to the horizon. But as you will see below, when reprojecting with software, it doesn't matter, saving one additional expense.

Hugin Panorama Software

Available for free at http://hugin.sourceforge.net, hugin is an interface (windows or linux) for remapping and seamlessly stitching images. Importantly, the underlying tools can be used (with some scripting) in batch mode when turning thousands of images into a time-lapse.

Hugin does the lion's share automatically, reading the image's EXIF data to extract the lens and exposure settings, so it knows the field of view and can account for barrel and fisheye distortion. It appears to handle the yaw/pitch/roll orientation of the camera, but I found it less confusing to first set these values to zero and then overwrite these myself.

The pitch is simply the altitude of the Sun, while the roll is the amount of tilt your head would make with respect to the horizon in making celestial north "up". Technically, this is called the parallactic angle, its value provided by several planetarium programs, online calculators, or simply eyeballed when working with a single image. You can use the Sun's azimuth as the yaw value.

Making a VR360 image

YouTube and Facebook detect the EXIF tag that prompts them to display the image as a 360. But first, with Hugin click the "projection" tab, force the field of view to 360x180 and choose "equirectangular" from the drop-down menu. Next select the Move/drag tab and input the roll value to make the horizon horizontal. To mitigate disorientation you want to simulate the typical human perspective of eyes forward looking at the distant the horizon. Assuming your original image has the Sun in the middle, you need to pitch the view by its altitude.

After using the "Stitcher" tab and generating the image, I then use the command-line program exifinfo (installed along with hugin) to add the tag

"C:\Program Files\Hugin\bin\exiftool.exe" -ProjectionType=equirectangular image.jpg

so it will be properly interpreted and displayed on a webpage or in a viewer.

Making a Planetarium Dome Projection

Modern planetariums have software to take a circular fisheye view of the sky with the zenith in the middle and project it up onto the dome. Under Hugin's projection tab, choose fisheye with a view of 180x180, and modify the pitch of the equirectangular view by 90 degrees. If you are starting with the Sun in the centre then instead adjust the pitch by "90-Alt".

Two-thirds of the dome might be black because of the camera's narrow field, but it will be correctly oriented.

Full sky coverage

At first, you might think that a fisheye lens capture of the sky is all you need. Although this is true of a single shot pointing straight up and a judiciously placed Sun occulted by the head of a streetlight, you can't do a time-lapse. It would be tricky to have an occulting disk track the Sun while keeping the camera stationary. Fortunately, you let the software do it for you in post.

The Gear360 camera has two fisheye lenses for full 360 coverage, and outputs the image from each lens side by side:

Once again, you can use Hugin to stitch then reproject to equirectangular (VR360) view. The Hugin project pto file to do this was provided by Lukasz Goralczyk on github (user "ultramango"), to which I made a minor modification to produce a fisheye at the zenith. It is important to note that in time-lapse mode, the Gear360 records only the datetime when the movie is either saved or downloaded after the battery ran out. In order to get the pitch/roll values, you need to note the start time of the video and the frame interval so you feed the calculated frame time into the altitude and parallactic angle calculator then pass those on to Hugin in batch mode.

Here is a sample VR360 time-lapse: https://youtu.be/Kz5EPMRStPc. The following link is an earlier halo event with segments of a parhelic circle, taken in equatorial mode with a wide angle lens, reprojected in zenith-centric view: https://youtu.be/Xv9DvcjXx1U.

The downside to the Gear360 (2017):

  • key limitation of only 3h recording time; cannot take images while plugged in!
  • inability to do HDR in time-lapse mode (only one or the other, sigh)

Appendix - details

Hugin files: VR360: pto file ; Zenith: Zenith_pto

Jean Meeus, in his wonderful book Astronomical Algorithms, has a formula for calculating the changing tilt (parallactic angle):

tan q = sin H / [ (tan phi * cos delta ) - (sin delta * cos H)]

where H is the hour angle, phi is latitude, and delta is declination. Next I run a perl program to loop through each image in my folder. In pseudo code:

foreach image.jpg do {
   extract image time 
       (using exifinfo module or start time with increment)
   get H and declination of the Sun from Astro::Coord 
       (given lat/lon/datetime)
   calculate q, Alt, Azimuth
   roll = 90 + q
   pitch = Alt
   yaw = Azimuth
   # rem overwrite the pitch and roll in the pto
   \\bin\\pano_modify.exe --output=$Subdir\\rotated.pto \
      --rotate=0,pitch,roll template.pto`
   # use nona to reproject into rotated.tif
   \\bin\\nona.exe -m TIFF_m -o $Subdir\\Rotated \       
      $Subdir\\rotated.pto image.jpg
   
   # for stitching pair of VR images:
   \\bin\\enblend -o rotated\\image_xxx.jpg \    
      $Subdir\\Rotated*.tif`;

   # for a zenithal reproject onto a black background:
   # convert to jpg and save in subfolder
   convert $Subdir\\Rotated0000.tif ( +clone -background \
      black -rotate $yaw ) -gravity center -compose   \
      Src -composite zenith\\image_xxx.jpg`;
}