Saturday, February 18, 2012

ARISSat-1 SSTV Images Geo-Referenced

If you visit the AMSAT SSTV Gallery, you will see several spacey-images that were taken from ARISSat-1.   Each of the images on this website are tagged with the operator that collected the photo and the acquired time.  Wouldn't it be nice if we could see these images plotted over the Earth at the satellites position at the time the image was acquired?  I think there is an intrinsic beauty to this type of plot so I just had to do it!  Here's how.

Step 1 - Acquire the Images

The images are available via the AMSAT SSTV gallery website.  Unfortunately, I was unable to find them on an FTP site or anywhere else.  The images ended up on the website by users actively submitting them via a web form.  As a result, I should note that it is possible that we may process invalid Acquired times.  I will ignore this fact, because I am assuming that the operator was at least within a minute or so of the actual transit time.  I needed to scrape these photos from the website with all of the metadata.  20 lines of Python later, the problem was solved.  The data I scraped from the website included the following:
SSTV Image
Operator Name
Acquired Time
Operator Call Sign
Operator Country Name

I ended up with 792 SSTV images and a file I generated, called map.txt.  This file maps image filenames on disk to metadata.  Here is a snippet of what the file looks like (reasonably self-explanatory):

4542.jpg, Nick Kucij, KB1RVT, NorthAmerica , 2011-08-31 18:41:00
4540.jpg, Ted  Veall, G6HMS, Europe , 2011-08-31 17:11:00
4539.jpg, Ted  Veall, G6HMS, Europe , 2011-08-31 17:09:00
4525.jpg, yosimasa.uehara, JH0GEV, Asia , 2011-08-31 03:13:00
4520.jpg, Tetsurou Satou, JA0CAW, Asia , 2011-08-31 06:20:00
4519.jpg, Tetsurou Satou, JA0CAW, Asia , 2011-08-31 04:50:00
4506.jpg, Doug, KD8CAO, NorthAmerica , 2011-08-30 21:10:00
4505.jpg, Doug, KD8CAO, NorthAmerica , 2011-08-30 21:08:00
4504.jpg, Doug, KD8CAO, NorthAmerica , 2011-08-30 19:34:00
4499.jpg, Ted  Veall, G6HMS, Europe , 2011-08-30 19:46:00
4493.jpg, Ted  Veall, G6HMS, Europe , 2011-08-30 18:11:00

All but one of the entries had meta-data so I just threw that one entry out.  Now that I have a basket of images and times, I was able to derive the location of the satellite from the Keplerian Elements.  This means we have 80% of the problem solved, so on-to the easy part, looking at it!

Step 2 - Decide How to Plot

I had two options for the plots, either I could:
- add EXIF tags to the JPGs, so they could be loaded up nicely in any GIS software
- create KML so I could load them up in Google Earth

Either way I could achieve the same end-result, which is having the images geo-spatially referenced.  However, I enjoyed the KML approach more because it allows me to attach meta-data that you can access by clicking on the image in Google Earth.  In the end, I decided to do both, because I can and I love to do things!  In the end, I generated a single KML file and just modified all the JPGs, so that they contained the appropriate EXIF tags.  Here is what the tags of 4540 looked like:

File Name                       : 4540.jpg
Directory                       : .
File Size                       : 24 kB
File Modification Date/Time     : 2012:02:18 21:50:49-05:00
File Permissions                : rw-r--r--
File Type                       : JPEG
MIME Type                       : image/jpeg
JFIF Version                    : 1.02
Exif Byte Order                 : Big-endian (Motorola, MM)
Image Description               : Ted  Veall G6HMS Europe
X Resolution                    : 200
Y Resolution                    : 200
Resolution Unit                 : inches
Y Cb Cr Positioning             : Centered
GPS Version ID                  :
GPS Latitude Ref                : North
GPS Longitude Ref               : West
GPS Altitude Ref                : Above Sea Level
GPS Map Datum                   : WGS-84
Image Width                     : 320
Image Height                    : 256
Encoding Process                : Baseline DCT, Huffman coding
Bits Per Sample                 : 8
Color Components                : 3
Y Cb Cr Sub Sampling            : YCbCr4:2:0 (2 2)
GPS Altitude                    : 370359.9 m Above Sea Level
GPS Latitude                    : 51 deg 26' 33.31" N
GPS Longitude                   : 13 deg 16' 19.18" W
GPS Position                    : 51 deg 26' 33.31" N, 13 deg 16' 19.18" W
Image Size                      : 320x256

I bet this Ted guy (G6HMS) never would have guessed that someone would be digging through his EXIF tags one day!  In addition to adding the EXIF tags to the JPGs, I generated a KML file that contains carefully generated place marks for each of the SSTV images.  This is a snapshot of all SSTV images acquired over the United States.

This is a snapshot of all SSTV images acquired over Europe.

When you click on a particular SSTV image, you can see the Acquired time and station data.

This one is a bit cluttered but it shows many of the transit times that these images were acquired.

In the end, this was a really fun experiment.  I am going to spend some time browsing through these images now, from right where they were received from ARISSat over our Beautiful Planet Earth!

Update [19 Feb]:  I added the image to the description window.  Now, when you click on the placemark image the popup shows the full-size image.

Update:  The algorithm used to decide when an sstv image was captured and transmitted was somewhat hoaky.  As a result, what i'm really plotting here is when a particular image was transmitted to a station and what image it was.  The images are not necessarily taken from the particular geographic locations you see.

1 comment:

KO4MA said...

Awesome stuff Joe!