Index: trunk/Ohana/src/opihi/scripts/fft.pro
===================================================================
--- trunk/Ohana/src/opihi/scripts/fft.pro	(revision 25871)
+++ trunk/Ohana/src/opihi/scripts/fft.pro	(revision 25871)
@@ -0,0 +1,25 @@
+
+macro fft.subraster
+
+  delete B
+
+  $Nx = $1
+  $Ny = $2
+  $DX = 4096/$Nx
+  $DY = 4096/$Nx
+  date
+  for ix 0 $Nx
+    for iy 0 $Ny
+      subraster b B {$DX*$ix} {$DY*$iy} $DX $DY 0 0 $DX $DY
+      fft2d B 0 to Br Bi
+    end
+  end
+  date
+end
+
+macro fft.timing
+  fft.subraster 1 1
+  fft.subraster 2 2
+  fft.subraster 4 4
+  fft.subraster 8 8
+end
Index: trunk/Ohana/src/opihi/scripts/fiterrors.pro
===================================================================
--- trunk/Ohana/src/opihi/scripts/fiterrors.pro	(revision 25871)
+++ trunk/Ohana/src/opihi/scripts/fiterrors.pro	(revision 25871)
@@ -0,0 +1,27 @@
+
+# create and fit a quadratic:
+macro fiterrors
+
+  if ($0 != 2)
+    echo "USAGE: fiterrors (sigma)"
+    break
+  end
+
+  create x 0 30 
+  set y = 1000 - 5*(x-15)^2
+
+  gaussdev sigma x[] 0.0 1.0
+  set Y = $1*(y + sigma)
+  set dY = zero(x) + $1
+
+  lim x Y; clear; box; plot x Y -dy dY
+
+  fit x Y 2 -dy dY
+  applyfit x Yf
+  plot -x 0 x Yf -c red
+  
+  $xo = -0.5*$C1 / $C2
+  $dxo = $xo * sqrt (($dC1/$C1)^2 + ($dC2/$C2)^2)
+  echo "$xo +/- $dxo"
+
+end
