Index: /tags/ipp-ops-20220906/pswarp/src/pswarp.h
===================================================================
--- /tags/ipp-ops-20220906/pswarp/src/pswarp.h	(revision 42957)
+++ /tags/ipp-ops-20220906/pswarp/src/pswarp.h	(revision 42958)
@@ -199,5 +199,5 @@
 pswarpBounds *pswarpBoundsAlloc();
 
-bool pswarpLoadAstrometry (pmFPAfile *target, pmFPAfile *astrom, pmConfig *config);
+bool pswarpLoadAstrometry (pmFPAfile *target, pmFPAfile *astrom, pmConfig *config, float *zptObs, float *zptErr);
 
 bool pswarpTransformToTarget (pmFPA *output, pmReadout *input, pmConfig *config, bool backgroundWarp);
Index: /tags/ipp-ops-20220906/pswarp/src/pswarpArguments.c
===================================================================
--- /tags/ipp-ops-20220906/pswarp/src/pswarpArguments.c	(revision 42957)
+++ /tags/ipp-ops-20220906/pswarp/src/pswarpArguments.c	(revision 42958)
@@ -21,4 +21,5 @@
     fprintf(stderr, "    [-mask mask.fits] : provide a corresponding mask image\n");
     fprintf(stderr, "    [-variance variance.fits] : provide a corresponding variance image\n");
+    fprintf(stderr, "    [-skycell_id skycell_id] : input skycell_id\n");
     psErrorStackPrint(stderr, "\n");
     exit(PS_EXIT_CONFIG_ERROR);
@@ -76,4 +77,11 @@
         psMetadataAddStr(config->arguments, PS_LIST_TAIL, "STATS", PS_DATA_STRING,
                          "Filename for statistics of output image", argv[N]);
+        psArgumentRemove(N, &argc, argv);
+    }
+    // Skycell id
+    if ((N = psArgumentGet(argc, argv, "-skycell_id"))) {
+        psArgumentRemove(N, &argc, argv);
+        psMetadataAddStr(config->arguments, PS_LIST_TAIL, "SKYCELL_ID", PS_DATA_STRING,
+                         "Skycell_id to use", argv[N]);
         psArgumentRemove(N, &argc, argv);
     }
Index: /tags/ipp-ops-20220906/pswarp/src/pswarpDefineLayout.c
===================================================================
--- /tags/ipp-ops-20220906/pswarp/src/pswarpDefineLayout.c	(revision 42957)
+++ /tags/ipp-ops-20220906/pswarp/src/pswarpDefineLayout.c	(revision 42958)
@@ -11,5 +11,5 @@
 # include "pswarp.h"
 
-bool pswarpGenerateOutputCell (pmChip *chip, pmCell *cell, pmCell *refcell, float xBin, float yBin);
+bool pswarpGenerateOutputCell (pmChip *chip, pmCell *cell, pmCell *refcell, float xBin, float yBin, float zptObs, float zptErr);
 
 // load the astrometry header info and generate the tranformations 
@@ -17,4 +17,6 @@
 
     bool status = false;
+    float zptObs = 0.;
+    float zptErr = 0.;
 
     pmFPAfile *output = psMetadataLookupPtr(&status, config->files, "PSWARP.OUTPUT");
@@ -29,8 +31,9 @@
         return false;
     }
-    if (!pswarpLoadAstrometry (output, skycell, config)) {
+    if (!pswarpLoadAstrometry (output, skycell, config,&zptObs,&zptErr)) {
         psError(PSWARP_ERR_CONFIG, false, "problem loading output astrometry\n");
         return false;
     }
+
 
     // if a background model is supplied and the output is requested, then 
@@ -68,5 +71,5 @@
 	    return false;
 	}
-	if (!pswarpLoadAstrometry (input, astrom, config)) {
+	if (!pswarpLoadAstrometry (input, astrom, config,&zptObs,&zptErr)) {
 	    psError(PSWARP_ERR_CONFIG, false, "problem loading input astrometry\n");
 	    return false;
@@ -126,14 +129,19 @@
 	    pmCell *refcell = pmFPAviewThisCell(view, skycell->fpa); ///< Target cell
 
-	    if (!pswarpGenerateOutputCell (chip, cell, refcell, output->xBin, output->yBin)){
+	    if (!pswarpGenerateOutputCell (chip, cell, refcell, output->xBin, output->yBin,zptObs,zptErr)){
 		psError(PSWARP_ERR_DATA, false, "failed to generate output cell");
 		psFree(view);
 		return false;
 	    }
+	    
+	    //also output the skycell id
+	    char *skycell_id = psMetadataLookupStr(&status, config->arguments, "SKYCELL_ID");
+            pmHDU *outHDU = pmHDUFromCell (cell);           ///< HDU for the output warped image
+            psMetadataAddStr (outHDU->header, PS_LIST_TAIL, "SKYCELL_ID", PS_META_REPLACE, "skycell_id",  skycell_id);
 
 	    if (bkgModel) {
 		pmChip *bkgChip = pmFPAviewThisChip(view, bkgModel->fpa); ///< Target cell
 		pmCell *bkgCell = pmFPAviewThisCell(view, bkgModel->fpa); ///< Target cell
-		if (!pswarpGenerateOutputCell (bkgChip, bkgCell, refcell, bkgModel->xBin, bkgModel->yBin)) {
+		if (!pswarpGenerateOutputCell (bkgChip, bkgCell, refcell, bkgModel->xBin, bkgModel->yBin,zptObs,zptErr)) {
 		    psError(PSWARP_ERR_DATA, false, "failed to generate output cell");
 		    psFree(view);
@@ -152,5 +160,5 @@
 }
 
-bool pswarpGenerateOutputCell (pmChip *chip, pmCell *cell, pmCell *refcell, float xBin, float yBin) {
+bool pswarpGenerateOutputCell (pmChip *chip, pmCell *cell, pmCell *refcell, float xBin, float yBin, float zptObs, float zptErr) {
 
     bool status = false;
@@ -197,4 +205,7 @@
     pmHDU *outHDU = pmHDUFromCell (cell);           ///< HDU for the output warped image
     outHDU->header = psMetadataCopy(outHDU->header, hdu->header);
+
+    psMetadataAddF32 (outHDU->header, PS_LIST_TAIL, "ZPT_OBS", PS_META_REPLACE, "measured zero point",  zptObs);
+    psMetadataAddF32 (outHDU->header, PS_LIST_TAIL, "ZPT_ERR", PS_META_REPLACE, "error on zero point",  zptErr);
     pswarpVersionHeader(outHDU->header);
     return true;
Index: /tags/ipp-ops-20220906/pswarp/src/pswarpLoadAstrometry.c
===================================================================
--- /tags/ipp-ops-20220906/pswarp/src/pswarpLoadAstrometry.c	(revision 42957)
+++ /tags/ipp-ops-20220906/pswarp/src/pswarpLoadAstrometry.c	(revision 42958)
@@ -14,5 +14,5 @@
 // WCS and read the headers.  We place the resulting info on the target astrometry
 // containers
-bool pswarpLoadAstrometry (pmFPAfile *target, pmFPAfile *astrom, pmConfig *config) {
+bool pswarpLoadAstrometry (pmFPAfile *target, pmFPAfile *astrom, pmConfig *config, float *zptObs,float *zptErr) {
 
     pmChip *chip = NULL;
@@ -126,4 +126,6 @@
 	    return false;
 	}
+        *zptObs = psMetadataLookupF32 (NULL, hdu->header, "ZPT_OBS");
+        *zptErr = psMetadataLookupF32 (NULL, hdu->header, "ZPT_ERR");
 
 	if (bilevelAstrometry) {
