Cool little Photosphere trick!
There's a photo making the rounds on Reddit and Twitter that's generating a bit of confusion.
Some people are believing
this photo
is a time-lapse of the moon, photographed at the same time on 27 consecutive days, and depicting how the moon moves in a figure-8 pattern. *
I'm not on Reddit or Twitter, and my post isn't about that photo, but that's just a preface to explain how I got involved in the photosphere project described below.
Knowing my long involvement with astronomy and mathematics, my son alerted me to the controversial photo and asked for my opinion. **
As part of my response to him, I decided to see if I could illustrate, over a period of consecutive days, the moon's path in VR format.
So that's what this post is about.
Calling upon my knowledge of spherical trigonometry and celestial calculations, I drew up a spreadsheet to convert the usual astronomical coordinates
(
Right Ascension and Declination) into the more pedestrian and earth-centered
Azimuth and Elevation coordinates. ***
This would allow me to overlay the moon's position onto a Google photosphere image for viewing in a VR viewer.
You can
see the result here.
If you have Google Chrome or a compatible browser, click the image and it should appear in 3D/VR mode, in which you can use your mouse to pan around for a 360-degree view.
If you have a VR viewer like Google Cardboard or similar, you can load the image on your phone and view it that way for a cool, immersive experience.
The photosphere I chose is one I created in August 2017, just before the
total solar eclipse.
The location was Corvallis, Oregon, almost at latitude 45 degrees, and the time of day was about 10:30 in the morning. On this image I overlaid the position of the moon,
relative to the sun's position, as of 10:30am on the 25 days preceding the eclipse.
(My photosphere wasn't of the eclipse, but the eclipse isn't relevant anyway; that's not the point. The point was to illustrate the relative locations of the sun and moon at the same time of day,
over several consecutive days. The fact that the photosphere I chose to work with happened to be near the date and location of the eclipse is basically coincidental.)
Editing the photosphere turned out to be an intriguing and fun exercise!
Using my phone's camera to capture a photosphere resulted in an 8000x4000 jpeg image.
Metadata within the jpeg instructs compatible viewers to display the image in a sphere.
8000 pixels corresponds to 360 degrees in the horizontal direction, and 4000 pixels corresponds to 180 degrees vertically (90 degrees from zenith to horizon plus 90 degrees from horizon to nadir).
Using a little math and an ordinary graphics editor, I turned the 25 azimuth/elevation coordinates into pixel x/y coordinates and overlaid small jpeg images of the moon.
(I found an image online of moon phases, and cut-and-pasted those.)
It's pretty straightforward in the horizontal direction, but the 180 vertical degrees are mapped into the photosphere image as an orthographic projection.
Readers will be familiar with orthographic projection as what makes arctic lands like Greenland and Finland appear larger on world maps than they actually are.
As a result, I'd need to add some intentional distortion in the cut-and-pasting to make things appear correctly in VR.
For instance, in an orthographic projection an object will span twice as many pixels (horizontally) at an elevation of 60 degrees as it would at horizon level.
That means I would need to distort my little moon graphic in the horizontal direction before pasting it over the photosphere image.
A little plane trigonometry [1/cos(elev)] would tell me how much distortion I would need to build in.
Once all my little moon graphics were pasted in and the photosphere jpeg resaved, I discovered it no longer worked as a VR photosphere because my graphics editor had stripped out the VR metadata.
A little online searching, however, led me to "
Exif Fixer",
a neat little one-trick utility that adds the metadata back into the jpeg file.
The edited photosphere turned out better than I expected, and the result looks kind of cool when viewed in a VR viewer!
I thought I'd post this in case others are as intrigued as I am with the possibilities.
Footnotes:
* The photographer never stated the photo was a time-lapse, and that should be obvious from the photographer's detailed description.
But unsurprisingly, most of the reposts to Twitter and Reddit omitted the photographer's description, thus leaving readers to jump to conclusions.
** Long story short, the photo is just a Photoshopped, artistic creation. That kind of time-lapse photo would be impossible in the physical world. The moon's path doesn't twist like that.
*** I hate "reinventing the wheel" if I don't have to, so I tried a number of online astronomical calculators.
That proved fruitless, however, because none would calculate the azimuth and negative elevation when the moon was below the horizon, and that's what I need for this project.
Hence, the need to write my own spreadsheet to do the calculations.
Posted by Dan 10/10/2018