Mathematica 9 is now available

 Documentation /  Scientific Astronomer /  Notebooks /

Making Star MapsLunar Libration

Window Views of the Sky

http://www.wolfram.com/applications/astronomer/index.html

setup

<<Astronomer`HomeSite`

<<Astronomer`Star3000`

SetLocation[TimeZoneRuleDelayed10,
GeoLongitudeRule145.0 Degree,
GeoLatitudeRule-37.8 Degree,
GeoAltitudeRule0. KiloMeter];

About Window

This notebook uses RadialStarChart with an Epilog option to add a skyline and a window frame around the field of view. For example the rising Sun is shown at dawn in the above graphic. Near the center of the window the bright planet Venus is still visible.

An animation of an entire day looking out a window is also produced in this notebook.

The Implementation

Window View Routine

windowView[compass_, date_, opts___] :=
Module[{p, c = -0.2, d = 0.2,
r = 20, alt = 12},
p = Tan[N[Altitude /.
HorizonCoordinates[Sun, date]]];
p = Which[p <= c, 1,
c < p < d, (p - d)/(c - d),
d <= p, 0];
RadialStarChart[{Azimuth -> compass,
Altitude -> alt*Degree}, date,
Horizon -> True, opts,
PlotLabel -> dateForm[date],
RadialAngle -> r*Degree,
Planets ->
{Mercury, Venus, Mars,
Jupiter, Saturn},
StarColors -> True,
Ecliptic -> False,
Constellations -> False,
Background -> back[p],
MagnitudeRange -> magr[p],
MagnitudeScale -> mags[p],
Epilog -> {sunp[date], moon[date],
skyline[p, r], window[p, r]}]]

Window Frame and Sky Line Routines

window[p_,r_]:=Module[{arch,th},arch=Table[{Sin[N[th Degree]],Cos[N[th Degree]]},{th,-55,55,10}];{{RGBfade[{1.,.8,.4},1-.8 p],Polygon[Join[arch,{{.8,1.01},{-.8,1.01}}] r],Rectangle[{-1,-1.2} r,{1.01,-1.} r],Rectangle[{.8,-1.2} r,{1.01,1.01} r],Rectangle[{-1,-1.2} r,{-.8,1.01} r]},{RGBfade[{.6,.8,.0},1-.8 p],Polygon[Join[arch,Reverse[arch] .9] r],Rectangle[{-.8,-1.} r,{.8,-.9} r],Rectangle[{.7,-1.} r,{.8,.6} r],Rectangle[{-.8,-1.} r,{-.7,.6} r]},{RGBfade[{.6,.8,.0},1-.8 p],Rectangle[{-.02,-1.} r,{.02,1.} r],Rectangle[{-.8,-.02} r,{.8,.02} r]}}];

skyline[p_,r_]:=Module[{f,x,y},f[{x_,y_}]:=0.71 0.02 {x-49.5,y-64} r;{RGBfade[{0.8,0.9,0.7},1-0.8 p],Polygon[f/@{{16,24},{18,25},{23,22},{27,25},{30,23},{30,19},{16,20},{16,24}}],RGBfade[{0.6,0.7,0.5},1-0.8 p],Polygon[f/@{{0,24},{3,23},{8,22},{13,27},{15,26},{18,21},{23,21},{29,24},{32,24},{40,22},{44,23},{47,24},{51,21},{55,21},{61,23},{65,23},{73,25},{80,23},{86,21},{91,22},{97,24},{99,23},{99,16},{0,16},{0,24}}],RGBfade[{1.0,1.0,1.0},1-0.8 p],Polygon[f/@{{13,27},{16,24},{16,23},{14,24},{12,25},{14,27}}],RGBfade[{0.4,0.6,1.0},1-0.8 p],Polygon[f/@{{0,7},{99,7},{99,16},{0,16},{0,7}}],RGBfade[{0.5,1.0,0.1},1-0.8 p],Polygon[f/@{{0,14},{9,12},{16,13},{22,15},{29,15},{31,14},{35,14},{40,11},{44,10},{44,9},{35,9},{0,9},{0,14}}],RGBfade[{0.6,1.0,0.2},1-0.8 p],Polygon[f/@{{56,10},{57,12},{62,12},{67,14},{69,14},{73,13},{81,12},{84,13},{90,15},{97,15},{99,14},{99,9},{66,9},{56,10}}],RGBfade[{1.0,0.5,0.2},1-0.8 p],Polygon[f/@{{0,0},{99,0},{99,7},{0,7},{0,0}}],RGBfade[{1.0,0.8,0.2},1-0.8 p],Polygon[f/@{{66,32},{67,27},{69,21},{74,16},{79,11},{80,5},{85,4},{84,8},{81,12},{73,20},{71,23},{69,27},{68,30},{66,32}}],RGBfade[{0.4,1.0,0.0},1-0.8 p],Polygon[f/@{{55,28},{55,31},{60,34},{65,34},{67,33},{72,35},{75,34},{79,33},{81,29},{78,32},{75,33},{71,33},{70,32},{73,32},{76,30},{77,26},{76,25},{75,27},{72,30},{70,30},{68,31},{68,28},{67,25},{68,21},{69,20},{67,21},{65,24},{65,29},{64,29},{62,26},{62,23},{62,19},{60,21},{60,26},{61,29},{65,31},{64,32},{61,32},{58,31},{55,28}}]}]

Auxilary Routines

RGBfade[rgb_,s_]:=RGBColor@@(rgb s)

back[p_]:=RGBfade[{.5,.5,1},1-p]

magr[p_]:=5 p+0 (1-p)
mags[p_]:=1 p+0 (1-p)

sunp[t_]:={RGBColor[1,1,0],Disk[ChartCoordinates[Sun,t],1.0]}
moon[t_]:={GrayLevel[0.9],Disk[ChartCoordinates[Moon,t],1.0]}

dateForm[{_, _, _, h_, m_, _}] :=
Module[{hh, mm, h12, m60}, h12 = Mod[Mod[h + Floor[m/60], 24] - 1, 12] + 1;
m60 = Mod[m, 60]; hh = ToString[h12];
If[h12 < 10, hh = StringJoin[" ", hh]]; mm = ToString[m60];
If[m60 < 10, mm = StringJoin["0", mm]];
StringJoin[hh, ":", mm, If[h < 12, "am", "pm"]]]

The Skyline

Here is the sky line that is used. It is defined in the implementation section above, but you can define your own if you want.

Show[Graphics[skyline[0,20]],
AspectRatioRule0.35];1;

A 24-hour Animation

Here is an animation of a 24 hour period (in half hour intervals) looking out a window that is facing roughly north-east (actually it is facing 50 degrees east of north) as seen from my location. Double click on the image below and, after it is buffered in, use the number keys 1 through 9 to adjust the frame rate. If the animation appears dark, then try using full brightness on your monitor.

Do[windowView[50 Degree,
{1995,7,10,h,m,0}],
{h,0,23,1}, {m,0,30,30}];

Miscellaneous Views

All the normal star chart options are available. For example in the graphic below, the planet Jupiter is labeled because of the PlanetLabels option. Next to Jupiter you can see the Moon.

windowView[260 Degree,
{1995,7,10,3,20,0},
PlanetLabelsRuleTrue];1;

The Sun and Moon are rendered correctly (although at quadruple size). Here a new moon is shown next to the rising Sun.

windowView[60 Degree,
{1995,6,28,8,0,0}];1;

Making Star MapsLunar Libration



Any questions about topics on this page? Click here to get an individual response.Buy NowMore Information
THIS IS DOCUMENTATION FOR AN OBSOLETE PRODUCT.