SunSphereImage displays an image of the earth showing the sunrise and sunset terminator. It uses your local timezone, which must have been set correctly, to approximate your local longitude and give the impression that you are looking down on the earth from above the equator. You can reposition the image by clicking or grabbing it with the mouse. Opt-clicking (Mac) or Alt-clicking (Windows), or Control-clicking displays the time of sunrise and sunset for the nearest city to the mouse.
Click the "spin" button (if visible) to rotate the globe continuously. You can also grab the globe with the mouse and spin it directly. You'll see that city lights "twinkle" because the transformation from the underlying map to the globe reveals different patterns of the yellow city color. You can spin the globe faster or slower (or in the wrong direction) by dragging it with the mouse.
Because rotating and spinning with latitude changes requires much more computation than longitude-only, you need to enable these features by clicking on the 'i' button or double-clicking near the globe image to display the option dialog. This dialog also lets you enable or disable the dynamic cloud display.
SunSphereImage is a large applet and takes a while to load and start running; give it time. The SunSphereImage Applet requires complete Java 1.1 support and does not run on some versions of Netscape Navigator on MacOS. Click here for a simpler applet that should work on all browsers that support Java.
The original version of the SunSphereImage applet was "Rated Top 5% WebApplet" by JARS. This revision has not yet been rated.
If you find bugs in this program (or make improvements), please contact me.
<param name="bgcolor" value="#EEEEFF" >
The SunSphere Applet is displayed here if your browser supports Java. SunSphereImage requires complete Java 1.1 support.
|A value that matches the background color of your web page. A value of #000099 looks nice, for example.|
|The desired text (foreground) color. This is really only useful if you also specify a background color.|
|The name of the image file. The applet looks for the image file in your document folder (directory) and, if it is not in that folder, it looks in the folder containing the applet code archive.|
||"true" to start spinning the globe when the applet starts.|
|The name of an XML formatted file that contains the names of all cities, their location, and timezones. The applet looks for the city file in your document folder (directory) and, if it is not in that folder, it looks in the folder containing the applet code archive.|
|The name of an image file containing the latest cloud image. Do not specify to fetch the cloud image from the University of Wisconsin server. If set, an auxiliary process, such as a "crontab" script running on a Unix system, will provide a timely local copy of the University of Wisconsin file. See the cloud image description for more information.|
|"true" to fetch the current cloud image. See the cloud image description for more information.|
|"true" to show the "spin" and "info" buttons (default). "false" to hide these buttons. If false, you can call up the configuration dialog by double-clicking near (but not in) the globe image..|
|"true" to show the analog clock (default). False to hide the clock.|
|The number of seconds to show the user-interface hint (default 30). Set to zero to hide the hint at startup..|
|The initial latitude of the center of the globe in fractional degrees. North is positive.|
|The initial longitude of the center of the globe in fractional degrees. East is positive.|
The initial latitude spin (North/South). To enable latitude spins,
both the |
|The initial longitude spin (East/West). Latitude spins are very fast to compute. The value should be negative to spin in the "natural" direction of the Earth's rotation.|
True to enable spinning the globe in a North/South direction.
this is computationally intensive. The
||The time between each spin cycle in milliseconds..|
If SunSphereImage runs as an application on a computer that is directly connected to the Internet, it can download an up-to-date satellite cloud image from a University of Wisconsin server. To access this server, you must either run SunSphereImage as an application from your local system or set your browser's Java security preferences to allow applets "unrestricted network access." Note that this will increase the risk that a rogue Java applet performs some unwanted action (it does not allow Java applets to read files on your local system, however).
As an alternative, you can specify a local file in the applet parameter list and provide an external mechanism, such as a "crontab" script, that maintains a timely image on your web server.
By default, the cloud image display feature is enabled if SunSphereImage runs as an application and disabled if it runs as an applet. You can explicitly enable or disable it using the option dialog or applet parameter list.
To show twilight and night, the program shades the map by computing the altitude of the sun at every pixel. If the sun is below the horizon, the algorithm darkens the pixel. (This is, actually, slightly inaccurate: shading should begin when the sun is 20° above the horizon.)
SunriseFilter.java performs this computation once a minute using support functions in SunEphemeris.java. While the filter operation is moderately compute-intensive, the implementation uses several vectors to pre-compute most of the data and this is not a performance bottleneck.
When these vectors have been computed, the program can rotate the image very quickly in the East to West direction, as it doesn't need to recompute the trignometric "sphere to circle" projection. Unfortunately, to rotate North or South, the vectors must be rebuilt whenever the latitude changes. This takes about ten times longer than a purely horizontal rotation. By default, the image can only be rotated horizontally: use the option dialog to override the default.
||Detemine the location of the mouse point with respect to the sphere. This value ranges from zero to the sphere diameter, with increasing values to the right and down.|
||Convert the horizontal pixel coordinate to a value that ranges from (-radius) to (+radius) from left to right.|
||Convert the vertical pixel coordinate to a value that ranges from (-radius) to (+radius) from bottom to top. Note that this is opposite the Java coordinate convention.|
||Compute the length of the vector from the origin
to the indicated point. If this is greater than the
radius of the sphere, return an error. Alternatively,
you can force the value to the radius. If
||Compute the latitude and longitude with respect to the origin. As noted above, the algorithm must detect a click on the origin to avoid dividing by zero.|
src.ziparchive. SunSphereImage uses several additional files:
SunSphere was created using MRJ Mac OS Runtime for Java.
Copyright © 1996-2000 Martin Minow. All Rights Reserved.