Index: /branches/czw_branch/20160809/Ohana/src/relphot/src/setMrelCatalog.c
===================================================================
--- /branches/czw_branch/20160809/Ohana/src/relphot/src/setMrelCatalog.c	(revision 39731)
+++ /branches/czw_branch/20160809/Ohana/src/relphot/src/setMrelCatalog.c	(revision 39732)
@@ -322,10 +322,21 @@
   for (Nsec = 0; Nsec < Nsecfilt; Nsec++) {
 
-    // if we detected this object in PS1, keep the mean photometry
-    if (PRESERVE_PS1) {
-      if (secfilt[Nsec].flags & ID_SECF_HAS_PS1) continue;
-    }
-
-    dvo_secfilt_init (&secfilt[Nsec], SECFILT_RESET_CHIP); // this does not reset astrometry or STACK bits
+    // if we detected this object in PS1, or do not request -preserve-ps1, keep the mean photometry values
+    if (!PRESERVE_PS1 || !(secfilt[Nsec].flags & ID_SECF_HAS_PS1)) {
+      dvo_secfilt_init (&secfilt[Nsec], SECFILT_RESET_CHIP); // this does not reset astrometry or STACK bits
+    }
+
+    if (haveTYCHO) {
+      secfilt[Nsec].flags |= ID_SECF_HAS_TYCHO;
+    }
+    if (haveHSC) {
+      secfilt[Nsec].flags |= ID_SECF_HAS_HSC;
+    }
+    if (haveCFH) {
+      secfilt[Nsec].flags |= ID_SECF_HAS_CFH;
+    }
+
+    if (PRESERVE_PS1 && (secfilt[Nsec].flags & ID_SECF_HAS_PS1)) continue;
+    // if -preserve-ps1 is set and this object has PS1 data, skip the rest of the steps:
 
     // XXX hardwired grizy = (01234) JHK = (567) w = (8)
@@ -334,14 +345,4 @@
     } else {
       secfilt[Nsec].Ncode = results->Nmeas[Nsec]; // 2MASS data if it exists
-    }
-
-    if (haveTYCHO) {
-      secfilt[Nsec].flags |= ID_SECF_HAS_TYCHO;
-    }
-    if (haveHSC) {
-      secfilt[Nsec].flags |= ID_SECF_HAS_HSC;
-    }
-    if (haveCFH) {
-      secfilt[Nsec].flags |= ID_SECF_HAS_CFH;
     }
 
