You can now create KML files that display objects in the sky, such as stars, constellations, planets, the Earth's moon, and galaxies. This page explains how to create a KML file to display celestial data in Google Sky. Specifically, you'll need to do the following:
The Google Earth user can control when to switch to Sky mode, using the View > Switch to Sky menu option or the Sky button in the user interface. When the user switches to Sky mode, Google Earth transitions to show the sky above the user's current location on Earth (the zenith). It is as if the user is standing at the center of the Earth's sphere, looking outward toward the heavens. The celestial data is mapped onto the inside of a virtual sphere that surrounds the Earth.
Celestial coordinates are described in terms of right ascension (RA) and declination. Right ascension, which corresponds to longitude, represents a distance from the point in the sky where the sun crosses the celestial equator at the vernal equinox. Right ascension is measured from 0 to 24 hours, with one hour of RA equal to the amount the sky rotates above a given point on the Earth's surface in one hour of time. Zero hours of RA is at the point of the vernal equinox, with RA increasing eastward from that point.
Declination is analogous to latitude, with 0 degrees declination located at the celestial equator. Declination values range from −90° directly above the South Pole to +90° directly above the North Pole.
The following figure shows Google Sky with grid lines for right ascension and declination turned on:
The following elements are supported in Google Earth 4.2, Sky mode:
Note, however, that <tilt> and <roll> are currently ignored in these elements.
If your KML file contains Sky data, be sure to add the hint attribute to the <kml> element at the beginning of the file:
<kml xmlns="http://earth.google.com/kml/2.2" hint="target=sky">
When a file with the "target=sky" hint is loaded, Google Earth prompts the user to switch to Sky view if it is not already in this mode.
You'll need to perform some simple calculations to convert right ascension coordinates (Hours/Minutes/Seconds) into degrees of longitude so that the data displays correctly in Google Earth (Sky mode).
To convert right ascension coordinates from values in a range from 0 to 24 to values in the range from −180 ° to +180 °, use this formula, where hour, minute, and second are the original right ascension values of the data:
(hour + minute/60 + second/3600)*15 − 180
Declination coordinates correspond directly to latitude values, ranging from −90° south of the celestial equator to +90° north of the celestial equator.
When you use the <LookAt> element with sky data, you will need to perform the following calculations to determine the range. The basic formula is as follows:
r = R*(k*sin(β/2) - cos(β/2) + 1)
where
Note: The Google Calculator is a handy tool for making such calculations.
Here are some sample ranges:
In Google Earth, if you are in Sky mode and you save a file, Google Earth assumes you want to save the file as a Sky file, so it adds the hint attribute to the <kml> element automatically.
Here is an example of creating a KML file that shows the Crab Nebula in Google Earth:
<kml xmlns="http://earth.google.com/kml/2.2" hint="target=sky">
<Document>
<Style id="CrabNebula">
<BalloonStyle>
<text><center><b>$[name]</b></center><br/>$[description]</text>
</BalloonStyle>
</Style> <Placemark>
<name>Crab Nebula</name>
<description>
<![CDATA[
This is the Crab Nebula. It is the remnant of a supernovae that was
observed on Earth in 1054 CE. You can find out more about the Crab
Nebula by looking at the information in the default layers, specifically:
<ul>
<li> <b>Backyard Astronomy</b>
<li> <b>Hubble Showcase</b>
<li> <b>Life of a Star</b>
</ul>
Enjoy exploring Sky!
]]>
</description>
<LookAt>
<longitude>-96.366783</longitude>
<latitude>22.014467</latitude>
<altitude>0</altitude>
<range>10000</range>
<tilt>0</tilt>
<heading>0</heading>
</LookAt>
<styleUrl>#CrabNebula</styleUrl>
<Point>
<coordinates>-96.366783,22.014467,0</coordinates>
</Point> </Placemark>
</Document>
</kml>
Here is how this file appears in Google Earth: