Index: trunk/Ohana/src/getstar/src/getstar.c
===================================================================
--- trunk/Ohana/src/getstar/src/getstar.c	(revision 2490)
+++ trunk/Ohana/src/getstar/src/getstar.c	(revision 6239)
@@ -10,4 +10,47 @@
   
   args (argc, argv);
+  set_db (&db);
+
+  Nstars = 0;
+  stars = NULL;
+
+  switch (MODE) {
+
+    case BY_REGION:
+    case BY_RADIUS:
+
+      /* load corresponding sky regions, associated images */
+      status = dvo_image_lock (&db, ImageCat, 60.0, LCK_SOFT);
+      if (!status) Shutdown ("ERROR: failure to lock image catalog %s", db.filename);
+
+      skylist = SkyListByPatch (sky, -1, &REGION);
+      overlap = gimages (&db, &image, MOSAIC, &Noverlap);
+      dvo_image_unlock (&db);
+
+      for (i = 0; i < skylist[0].Nregions; i++) {
+	  
+	  catalog.filename = skylist[0].filename[i];
+	  load_pt_catalog (&catalog, skylist[0].regions[i]);
+	  unlock_catalog (&catalog);
+
+	  /* skip empty catalogs */
+	  if (catalog.Nave_disk == 0) continue;
+
+	  stars = find_matches (&catalog, &image, 0, 0, stars, &Nstars);
+
+      break;
+
+    case BY_CATALOG:
+      /* not implemented */
+      break;
+
+    case BY_IMAGE:
+
+      break;
+
+    case BY_IMLIST:
+
+      break;
+  }
 
   image = gimages (argv[1]);
