Index: /branches/eam_branches/ipp-20140904/Ohana/src/fakeastro/src/initialize.c
===================================================================
--- /branches/eam_branches/ipp-20140904/Ohana/src/fakeastro/src/initialize.c	(revision 37599)
+++ /branches/eam_branches/ipp-20140904/Ohana/src/fakeastro/src/initialize.c	(revision 37600)
@@ -16,4 +16,9 @@
   if (argc != 1) usage ();
 
+  // XXX add to config?
+  if (!InitGalaxyModel ("ROESER")) {
+    fprintf (stderr, "failed to init galaxy model\n");
+    exit (2);
+  }
 }
 
@@ -23,4 +28,10 @@
   ConfigInit (&argc, argv);
   if (argc != 1) usage_client ();
+
+  // XXX add to config?
+  if (!InitGalaxyModel ("ROESER")) {
+    fprintf (stderr, "failed to init galaxy model\n");
+    exit (2);
+  }
 }
 
Index: /branches/eam_branches/ipp-20140904/Ohana/src/fakeastro/src/load_template_images.c
===================================================================
--- /branches/eam_branches/ipp-20140904/Ohana/src/fakeastro/src/load_template_images.c	(revision 37599)
+++ /branches/eam_branches/ipp-20140904/Ohana/src/fakeastro/src/load_template_images.c	(revision 37600)
@@ -59,6 +59,6 @@
     }
     // XXX hard=wire the photcode range for now (just i-band)
-    if (childImage->photcode < 10200) continue;
-    if (childImage->photcode < 10277) continue;
+    // if (childImage->photcode < 10200) continue;
+    // if (childImage->photcode < 10277) continue;
 
     refimage[Nrefimage].secz     = childImage->secz;
Index: /branches/eam_branches/ipp-20140904/Ohana/src/fakeastro/src/make_fakestars.c
===================================================================
--- /branches/eam_branches/ipp-20140904/Ohana/src/fakeastro/src/make_fakestars.c	(revision 37599)
+++ /branches/eam_branches/ipp-20140904/Ohana/src/fakeastro/src/make_fakestars.c	(revision 37600)
@@ -1,11 +1,3 @@
 # include "fakeastro.h"
-
-static double iFkap = 0.001 / 4.74047; // (km/sec/kpc) / (arcsec/ year)
-static double A_oort = +14.5;  // km/sec/kpc
-static double B_oort = -13.0;  // km/sec/kpc
-
-static double U_sol  =  9.44; // km/sec
-static double V_sol  = 11.90; // km/sec
-static double W_sol  =  7.20; // km/sec
 
 FakeAstro_Stars *make_fakestars (int Nstars) {
@@ -78,9 +70,9 @@
     double distance = sqrt (SQ(r) + SQ(z));
 
-    double uL_gal = (A_oort * cos(2.0*Lrad) + B_oort) * cos(Brad) * iFkap;
-    double uB_gal = -0.5*A_oort * sin(2.0*Lrad) * sin(2.0*Brad) * iFkap;
+    double uL_gal, uB_gal;
+    GalaxyMotionModel_radians(&uL_gal, &uB_gal, Lrad, Brad);
 
-    double uL_sol =  (U_sol * sin(Lrad) - V_sol * cos(Lrad))                              * iFkap / distance;
-    double uB_sol = ((U_sol * cos(Lrad) + V_sol * sin(Lrad))*sin(Brad) - W_sol*cos(Brad)) * iFkap / distance;
+    double uL_sol, uB_sol;
+    SolarMotionModel_radians(&uL_sol, &uB_sol, Lrad, Brad, distance);
 
     double uL = uL_gal + uL_sol;
@@ -93,4 +85,7 @@
     }
     
+    double uR, uD;
+    TransformProperMotion (&uR, &uD, uL, uB, R, D, transback);
+
     // crude Mr distribution from Bochanski et al 2010
     // http://iopscience.iop.org/1538-3881/139/6/2679/pdf/aj_139_6_2679.pdf
@@ -108,23 +103,4 @@
     }
     
-    // C1, C2 are from http://arxiv.org/pdf/1306.2945v2.pdf
-    double Rrad = R*RAD_DEG;
-    double Drad = D*RAD_DEG;
-
-    double C1 = 
-      cos(Drad)*transback->cos_phi +
-      sin(Drad)*cos(Rrad)*transback->sin_phi_sin_Xo - 
-      sin(Drad)*sin(Rrad)*transback->sin_phi_cos_Xo;
-
-    double C2 =
-      - cos(Rrad)*transback->sin_phi_cos_Xo
-      - sin(Rrad)*transback->sin_phi_sin_Xo;
-
-    double cosBinv = 1.0 / sqrt(C1*C1 + C2*C2);
-
-    // XXX add errors : I need to be able to choose the stars based on the error distribution
-    double uR = cosBinv * (C1 * uL - C2 * uB);
-    double uD = cosBinv * (C1 * uB + C2 * uL);
-
     stars[i].R = R;
     stars[i].D = D;
