Index: trunk/doc/release.2015/ps1.analysis/examples/.mana
===================================================================
--- trunk/doc/release.2015/ps1.analysis/examples/.mana	(revision 40690)
+++ trunk/doc/release.2015/ps1.analysis/examples/.mana	(revision 40690)
@@ -0,0 +1,85 @@
+input moments.sh
+show.pol
+input moments.sh
+show.pol
+print e1 e2
+input moments.sh
+show.pol
+print theta e1 e2
+set fr = f0
+rotate fr 190
+tv -n tv fr -0.01 0.5
+rotate fr 90
+set fr = f0
+rotate fr 90
+tv -n tv fr -0.01 0.5
+set fr = f0
+rotate fr 95
+tv -n tv fr -0.01 0.5
+rotate fr 85
+tv -n tv fr -0.01 0.5
+set fr = f0
+rotate fr 85
+tv -n tv fr -0.01 0.5
+star fr {fr[][0]/2} {fr[0][]/2} 71
+echo star fr {fr[][0]/2} {fr[0][]/2} 71
+buff
+input moments.sh; test.rot
+tv fr -0.01 0.2
+set fr = f0
+rotate fr 5
+tv fr
+input moments.sh; test.rot
+tv fr -0.01 0.2
+tv f0
+set fr = f0
+rotate fr 2
+tv fr
+input moments.sh; test.rot; tv f0
+input moments.sh; test.rot; tv f0
+tv fr
+input moments.sh; test.rot; tv -ch 1 f0; tv -ch 2 fr
+input moments.sh; test.rot; tv -ch 1 f0; tv -ch 2 fr
+input moments.sh; test.rot; tv -ch 1 f0; tv -ch 2 fr
+input moments.sh; test.rot; tv -ch 1 f0; tv -ch 2 fr
+resize 800 800
+set fr = f0
+rotate fr 10
+tv -ch 2 fr
+input moments.sh; test.rot; tv -ch 1 f0; tv -ch 2 fr
+input moments.sh; test.rot; tv -ch 1 f0; tv -ch 2 fr
+input moments.sh; test.rot; tv -ch 1 f0; tv -ch 2 fr
+buffers
+echo {fr[][0]/2} {fr[0][]/2}
+$x = 360 - 720/2
+$y = 360 - 720/2
+$xo = 360 - 720/2
+$yo = 360 - 720/2
+$x = $xo*dcos(2) + $yo*dsin(2)
+$y = $yo*dcos(2) - $xo*dsin(2)
+echo $x
+echo $y
+echo $xo
+echo quit
+echo {dcos(2)} {dsin(2)}
+input moments.sh; test.rot; tv -ch 1 f0; tv -ch 2 fr
+echo {fr[][0]/2}  {fr[0][]/2}
+input moments.sh; test.rot; tv -ch 1 f0; tv -ch 2 fr
+header
+head f0
+head fr
+show.pol
+lim -n 2 theta e1; clear; box; plot theta e1
+lim -n 2 theta e2; clear; box; plot theta e2
+input moments.sh; show.pol
+lim -n 2 theta e2; clear; box; plot theta e2
+plot -c blue theta e1
+vstat e1
+tv -n 0 -0.01 0.2 f0
+tv -n 0 f0 -0.01 0.2
+input moments.sh; show.pol
+tv -n 0 f0 -0.01 0.2
+input moments.sh; show.pol
+tv -n 0 f0 -0.01 0.2
+vstat e1
+vstat e2
Index: trunk/doc/release.2015/ps1.analysis/examples/moments.sh
===================================================================
--- trunk/doc/release.2015/ps1.analysis/examples/moments.sh	(revision 40690)
+++ trunk/doc/release.2015/ps1.analysis/examples/moments.sh	(revision 40690)
@@ -0,0 +1,51 @@
+
+macro show.pol
+
+  mcreate z 500 500
+  set x = xramp(z) - 250
+  set y = yramp(z) - 250
+  set f0 = 10*exp(-0.5*(x^2 + (y/25)^2))
+
+  delete -q e1 e2 theta
+  for rot 0 360 5
+    set fr = f0
+    rotate fr $rot
+
+    star -q fr {fr[][0]/2} {fr[0][]/2} 101
+
+    $Mxx = ($SXg/2.355)^2
+    $Myy = ($SYg/2.355)^2
+    $Mxy = $SXYg
+
+    $T = $Mxx + $Myy
+    $e1 = ($Mxx - $Myy) / $T
+    $e2 = 2*$Mxy / $T
+
+    concat $rot theta
+    concat $e1 e1
+    concat $e2 e2
+  end
+
+  lim -n graph -1.5 1.5 -1.5 1.5; clear; box; plot -pt cir -sz 2 -c blue e1 e2 
+end
+
+
+macro test.rot
+
+  mcreate z 720 720
+  set x = xramp(z) - 360
+  set y = yramp(z) - 360
+
+  set f1 = 10*exp(-0.5*(((x-100)/2)^2 + ((y-100)/2)^2))
+  set f2 = 10*exp(-0.5*(((x+100)/2)^2 + ((y-100)/2)^2))
+  set f3 = 10*exp(-0.5*(((x-100)/2)^2 + ((y+100)/2)^2))
+  set f4 = 10*exp(-0.5*(((x+100)/2)^2 + ((y+100)/2)^2))
+  set f0 = f1 + f2 + f3 + f4
+
+  set f1 = 10*exp(-0.5*((x/2)^2 + (y/2)^2))
+  set f0 = dsin(5*x)*dcos(5*y) + f1
+
+  set fr = f0
+
+  rotate fr 2
+end
