Index: /branches/eam_branches/ipp-20120805/Ohana/src/addstar/Makefile
===================================================================
--- /branches/eam_branches/ipp-20120805/Ohana/src/addstar/Makefile	(revision 34388)
+++ /branches/eam_branches/ipp-20120805/Ohana/src/addstar/Makefile	(revision 34389)
@@ -47,4 +47,5 @@
 $(SRC)/SkyTableFromTychoIndex.$(ARCH).o \
 $(SRC)/addstar.$(ARCH).o \
+$(SRC)/addstar_create_ID.$(ARCH).o \
 $(SRC)/airmass.$(ARCH).o \
 $(SRC)/args.$(ARCH).o \
Index: /branches/eam_branches/ipp-20120805/Ohana/src/addstar/include/addstar.h
===================================================================
--- /branches/eam_branches/ipp-20120805/Ohana/src/addstar/include/addstar.h	(revision 34388)
+++ /branches/eam_branches/ipp-20120805/Ohana/src/addstar/include/addstar.h	(revision 34389)
@@ -59,5 +59,5 @@
 typedef struct sockaddr_in SockAddress;
 
-enum {ADDSTAR_MODE_NONE, ADDSTAR_MODE_IMAGE, ADDSTAR_MODE_REFLIST, ADDSTAR_MODE_REFCAT, ADDSTAR_MODE_FAKEIMAGE, ADDSTAR_MODE_RESORT};
+enum {ADDSTAR_MODE_NONE, ADDSTAR_MODE_IMAGE, ADDSTAR_MODE_REFLIST, ADDSTAR_MODE_REFCAT, ADDSTAR_MODE_FAKEIMAGE, ADDSTAR_MODE_RESORT, ADDSTAR_MODE_CREATE_ID};
 enum {NONE, SIMPLE_CMP, SIMPLE_CMF, SIMPLE_MEF, MOSAIC_CMP, MOSAIC_CMF, MOSAIC_MEF, MOSAIC_PHU, SDSS_OBJ};
 /* note: MEF implies CMF */
@@ -293,4 +293,5 @@
 // this is a gnu extension?? caution!
 void *memrchr(const void *s, int c, size_t n);
+int addstar_create_ID ();
 
 /** 
Index: /branches/eam_branches/ipp-20120805/Ohana/src/addstar/src/addstar.c
===================================================================
--- /branches/eam_branches/ipp-20120805/Ohana/src/addstar/src/addstar.c	(revision 34388)
+++ /branches/eam_branches/ipp-20120805/Ohana/src/addstar/src/addstar.c	(revision 34389)
@@ -27,4 +27,9 @@
   options = args (argc, argv, options);
 
+  if (options.mode == ADDSTAR_MODE_CREATE_ID) {
+    addstar_create_ID ();
+    exit (0);
+  }
+
   sky = SkyTableLoadOptimal (CATDIR, SKY_TABLE, GSCFILE, TRUE, SKY_DEPTH, VERBOSE);
   if (sky == NULL) {
Index: /branches/eam_branches/ipp-20120805/Ohana/src/addstar/src/args.c
===================================================================
--- /branches/eam_branches/ipp-20120805/Ohana/src/addstar/src/args.c	(revision 34388)
+++ /branches/eam_branches/ipp-20120805/Ohana/src/addstar/src/args.c	(revision 34389)
@@ -32,4 +32,8 @@
   if ((N = get_argument (argc, argv, "-resort"))) {
     options.mode = ADDSTAR_MODE_RESORT;
+    remove_argument (N, &argc, argv);
+  }
+  if ((N = get_argument (argc, argv, "-create-id"))) {
+    options.mode = ADDSTAR_MODE_CREATE_ID;
     remove_argument (N, &argc, argv);
   }
@@ -101,4 +105,5 @@
       if (options.mode == ADDSTAR_MODE_FAKEIMAGE) goto allow;
       if (options.mode == ADDSTAR_MODE_REFLIST) goto allow;
+      if (options.mode == ADDSTAR_MODE_CREATE_ID) goto allow;
       if (options.mode == ADDSTAR_MODE_REFCAT) {
 	  fprintf (stderr, "you have requested uploading from a catalog to the entire sky in one pass\n");
@@ -364,4 +369,5 @@
   }
 
+  if ((options.mode == ADDSTAR_MODE_CREATE_ID) && (argc == 1)) return (options);
   if ((options.mode == ADDSTAR_MODE_RESORT) && (argc == 1)) return (options);
   if (argc == 2) return (options);
@@ -378,4 +384,5 @@
   fprintf (stderr, "USAGE: addstar -fakeimage (ra) (dec) (theta) (name)\n");
   fprintf (stderr, "USAGE: addstar -resort (SkyRegion)\n");
+  fprintf (stderr, "USAGE: addstar -add-id\n");
   fprintf (stderr, "USAGE: addstar -ppm (filename)\n");
   exit (2);
