Capturing the Mountian Shadow

A high quality pan-tilt-zoom camera on the roof of the observatory at an altitude of 13,630ft? Just too much fun. I have found myself logging into the camera at sunset to enjoy the view, or keeping the video in the corner of my screen through a Hawaiian blizzard. I have even forwarded images to a local television station when they requested views of a white Christmas in Hawaiʻi. Yes, they used them for the evening news!

Weather Mast
The Keck weather mast with a sonic anemometer at top, MastCam, and the housings for the temperature, humidity and barometric pressure sensors.
This camera can do more… The camera is an Axis Q6044-E dome style security camera. The camera contains a small Linux computer with a huge array of scripting and control options. Combined with a 720p HD camera, reasonably decent optics, and an accurate PTZ mechanism the camera is quite capable.

To make the best of this wonderful toy I need some tools. To that end several Python programs have been written, including a camera scheduler. This program takes a text file with a schedule and captures images at the programmed time and date. All of this was easy to implement in Python, all of the necessary ‘net protocol support is available in the libraries.

The schedule file can contain any number of separate schedules for multiple sequences. At the specified time the program insures the camera is set properly, moves the camera to the correct position and captures the image. Each sequence is saved to a unique directory and given a sequential name suitable for compiling time lapse video. Add a simple GUI to allow images and status to be monitored and the program becomes a very useful tool.

There are now multiple sequences running… Photos of the summit ridge at each sunset, the shadow of the GPS antenna every day at noon, the Kohala mountain every day mid-morning, the TMT construction site several times a day, and more.

Cam Schedule GUI
The CamSchedule Python/Tk GUI
One of the things I would like to photograph is the mountain shadow every day at dawn. Setting that up is a little more interesting.

The shadow cast by any large mountain is a beautiful symmetrical cone, a sublime sight from the summit of Mauna Kea. Watching dawn or sunset I often find myself wandering away from the tourists watching the Sun, walking to the other side of the summit where you can see the shadow. Interestingly the shape is a result of perspective, and does not relay on the actual shape of the summit casting the shadow. Even if the mountain were flat-topped, the shadow will be a symmetrical cone.

Earth's shadow setting and the Belt of Venus
The Earth’s shadow and the Belt of Venus as seen in the dawn from MastCam on the roof of Keck Observatory
The first step in photographing the shadow is to calculate the moment of sunrise for every day of the year. As this varies depending on the observer’s longitude and latitude a fairly complex calculation is needed. No need to drag out the calculator, this information is available from some good sources. I simply went to the the US Naval Observatory Data Center where there are some very nice scripted calculators ready on the website. Feed in your latitude and longitude and a table of sunset and sunrise is generated. Taking the USNO table into an Excel spreadsheet allowed me to automatically generate the schedule script for my camera.

If you take a photo too early you do not see the shadow. The Sun needs to rise a bit to allow sunlight to illuminate the haze west of the summit. You do get a very nice image of the Earth’s shadow setting and the Belt of Venus. The photo posted at the left is what you get before the shadow appears.

Mauna Kea Shadow
The dawn shadow of Mauna Kea projected on the clouds below 15 minutes after the moment of sunrise
Thus an offset from dawn is needed to get a good shadow image… Time to experiment. To do this properly would require calculating when the Sun would be at a specific elevation in the sky. As the angle of the Sun’s rise changes throughout the year this would also be an involved calculation. Something simpler? I suspect a fixed delay is good enough for this purposes.

Perhaps a 15 minute delay? Adjust the schedule and wait for another dawn… Adding fifteen minutes to the calculated sunrise time results in a good shadow image. Perhaps not the best possible shadow image, the tip of the shadow could be a little higher and just above the horizon.

For the next trial I set the camera to take photos at one minute intervals after the moment of calculated sunrise, covering a fifty minute period. (why did I not do that the first time?). The result is compiled as a video.

The Python code and a sample scheduler files is included here in a zip archive. The code is written for Python 3.4 and requires installation of Pillow package to handle the images. Pillow is needed only to display the images, the program could be modified to remove that function. The code is a bit naive, better checking could be done for network errors or bad syntax in the schedule file… The code is provided as-is, use at your own risk.

Source Code for CamSchedule

Below is a snippet from the schedule file. A simple syntax sets up a sequence of images. Any number of sequences can be defined and processed, there are currently more than a dozen in the file I am using. Each set of sequence imagery is stored in a separate directory with a unique filename. There is support for more than one camera specified by IP address. This file is read in when the start button is pressed and checked against the time a couple times each minute.

# Kohala Weather
# - Acquire an image of Kohala every day mid-morning
# Added 29Dec2014 A. Cooper
start Kohala H:\Images\Kohala\ Kohala
img everyday 0730 Kohala

# Mauna Kea Shadow
# - Acquire an image of the mountain shadow every morning through 2015
# - Use sunrise times calculated by the USNO Data Center for 2014
# - Add 15 minutes to allow Sun to rise from horizon plane
# Added 29Dec2014 A. Cooper
start MaunaKeaShadow H:\Images\MaunaKeaShadow\ MaunaKeaShadow
img 20150101 0712 Sunset
img 20150102 0712 Sunset
img 20150103 0712 Sunset
img 20150104 0713 Sunset
img 20151228 0710 Sunset
img 20151229 0711 Sunset
img 20151230 0711 Sunset
img 20151231 0711 Sunset

One worry is that the PTZ mechanism will not register each image well. That each day the camera will be panned to a slightly different place. This can create jittery video when the daily sequences are assembled as time lapse. And indeed, over time there has been shift in the images. There will need to be a bit of post processing needed to align the images allowing the creation of jitter free video.

I do not expect most of these time lapse sequences to produce anything interesting. Some will, I just need to wait and see what I get over the coming months and years. I can add new sequences as new ideas occur to me.

Now… What will a year of mountain shadows look like when assembled as a video?

Author: Andrew

An electrical engineer, amateur astronomer, and diver, living and working on the island of Hawaiʻi.

Leave a Reply

Your email address will not be published. Required fields are marked *