Index: branches/pap/psModules/src/objects/pmSourceIO.c
===================================================================
--- branches/pap/psModules/src/objects/pmSourceIO.c	(revision 23948)
+++ branches/pap/psModules/src/objects/pmSourceIO.c	(revision 25027)
@@ -496,4 +496,7 @@
                 status = pmSourcesWrite_CMF_PS1_V1 (file->fits, readout, sources, file->header, outhead, dataname);
             }
+            if (!strcmp (exttype, "PS1_V2")) {
+                status = pmSourcesWrite_CMF_PS1_V2 (file->fits, readout, sources, file->header, outhead, dataname);
+            }
             if (xsrcname) {
               if (!strcmp (exttype, "PS1_DEV_1")) {
@@ -506,4 +509,7 @@
                   status = pmSourcesWrite_CMF_PS1_V1_XSRC (file->fits, sources, xsrcname, recipe);
               }
+              if (!strcmp (exttype, "PS1_V2")) {
+                  status = pmSourcesWrite_CMF_PS1_V2_XSRC (file->fits, sources, xsrcname, recipe);
+              }
             }
             if (xfitname) {
@@ -517,4 +523,7 @@
                   status = pmSourcesWrite_CMF_PS1_V1_XFIT (file->fits, sources, xfitname);
               }
+              if (!strcmp (exttype, "PS1_V2")) {
+                  status = pmSourcesWrite_CMF_PS1_V2_XFIT (file->fits, sources, xfitname);
+              }
             }
             if (!status) {
@@ -562,6 +571,8 @@
 
     // not needed if only one chip
-    if (file->fpa->chips->n == 1) return true;
-
+    if (file->fpa->chips->n == 1) {
+	pmSourceIO_WriteMatchedRefs (file->fits, file->fpa, config);
+	return true;
+    }
 
     // find the FPA phu
@@ -667,4 +678,5 @@
     psFree (outhead);
 
+    pmSourceIO_WriteMatchedRefs (file->fits, file->fpa, config);
     return true;
 }
@@ -679,4 +691,6 @@
 
     pmFPA *fpa = file->fpa;
+
+    pmSourceIO_ReadMatchedRefs (file->fits, fpa, config);
 
     if (view->chip == -1) {
@@ -941,4 +955,7 @@
                 sources = pmSourcesRead_CMF_PS1_V1 (file->fits, hdu->header);
             }
+            if (!strcmp (exttype, "PS1_V2")) {
+                sources = pmSourcesRead_CMF_PS1_V2 (file->fits, hdu->header);
+            }
         }
 
@@ -1053,2 +1070,3 @@
 }
 
+    
