Index: /trunk/Ohana/src/addstar/src/psps_ids.c
===================================================================
--- /trunk/Ohana/src/addstar/src/psps_ids.c	(revision 26385)
+++ /trunk/Ohana/src/addstar/src/psps_ids.c	(revision 26386)
@@ -1,20 +1,16 @@
 # include "addstar.h"
 
-// Compute PSPS defined IDs
+// Compute IDs for PSPS based on recipe they defined
 
 uint64_t
 CreatePSPSDetectionID(double tobs, int ccdid, int detID)
 {
-//    double floor();
     // t0 for detection id is 2007-01-01 00:00:00 utc
     double  t0 = 54101.0;
-    double diff;
-    int itmp;
-    uint64_t detectid;
-        
-    diff = floor( 100000. * (tobs - t0) );
-    itmp = diff;
+    double diff = floor( 100000. * (tobs - t0) );
+    int itmp = diff;
+
     // ccdid must be < 100
-    detectid = 1000000000*((uint64_t) itmp) + 10000000 * ((uint64_t) ccdid) +
+    uint64_t detectid = 1000000000*((uint64_t) itmp) + 10000000 * ((uint64_t) ccdid) +
              ((uint64_t) detID);
 
@@ -25,16 +21,13 @@
 CreatePSPSObjectID(double ra, double dec)
 {
+    double zh = 0.0083333;
+    double zid = (dec + 90.) / zh;             // 0 - 180*60*2 = 21600 < 15 bits
+    int izone = (int) floor(zid);
+    double zresid = zid -  ((float) izone);    // 0.0 - 1.0
+
     uint64_t part1, part2, part3;
-    double zid, zresid;
-    int izone;
-    double zh = 0.0083333;
-    
-    zid = (dec + 90.) / zh;             // 0 - 180*60*2 = 21600 < 15 bits
-    izone = (int) floor(zid);
-    zresid = zid -  ((float) izone);    // 0.0 - 1.0
-
     part1 = (uint64_t)( izone  * 10000000000000) ; 
     part2 = ((uint64_t)(ra * 1000000.)) * 10000 ; // 0 - 360*1e6 = 3.6e8 (< 29 bits)
-    part3 = (int) (zresid * 10000.0) ; // 0 - 10000 (1 bit == 30/10000 arcsec (< 14 bits)
+    part3 = (int) (zresid * 10000.0) ; // 0 - 10000 (1 bit == 30/10000 arcsec) (< 14 bits)
 
     return part1 + part2 + part3;
