Index: trunk/pswarp/src/pswarpLoop.c
===================================================================
--- trunk/pswarp/src/pswarpLoop.c	(revision 39981)
+++ trunk/pswarp/src/pswarpLoop.c	(revision 40344)
@@ -58,4 +58,5 @@
     }
 
+    psString refcat = NULL;
     // loop over this section once per input group
     for (int i = 0; i < nInputs; i++) {
@@ -121,4 +122,12 @@
 			    psMetadataAddPtr(readout->analysis, PS_LIST_TAIL, "PSPHOT.DETECTIONS", PS_DATA_ARRAY, "Sources from input astrometry", detections);
 			}
+
+			// Determine the reference catalog used
+			if (!refcat) {
+			  refcat = psMetadataLookupStr(NULL, astromRO->parent->parent->hdu->header, "PSREFCAT");
+			  psMetadataAddStr(output->fpa->analysis, PS_LIST_TAIL, "REFERENCE_CATALOG", PS_META_REPLACE, "Reference catalog used for calibration.", refcat);
+			}
+
+			
 		    }
 
Index: trunk/pswarp/src/pswarpUpdateMetadata.c
===================================================================
--- trunk/pswarp/src/pswarpUpdateMetadata.c	(revision 39981)
+++ trunk/pswarp/src/pswarpUpdateMetadata.c	(revision 40344)
@@ -20,4 +20,5 @@
     bool bilevelAstrometry = psMetadataLookupBool (NULL, skycell->analysis, "ASTROMETRY.BILEVEL");
 
+    psString refcat = psMetadataLookupStr (NULL, output->analysis, "REFERENCE_CATALOG");
     pmChip *chip;
     while ((chip = pmFPAviewNextChip (view, output, 1)) != NULL) {
@@ -165,4 +166,8 @@
     }
 
+    if (refcat) {
+      psMetadataAddStr(output->hdu->header, PS_LIST_TAIL, "PSREFCAT", PS_META_REPLACE, "Reference catalog used for calibration", refcat);
+    }
+    
     // apply the bilevel astrometry elements to the target
     if (bilevelAstrometry) {
