Index: /branches/eam_branches/ipp-20110213/psphot/doc/stack.txt
===================================================================
--- /branches/eam_branches/ipp-20110213/psphot/doc/stack.txt	(revision 30775)
+++ /branches/eam_branches/ipp-20110213/psphot/doc/stack.txt	(revision 30776)
@@ -1,2 +1,49 @@
+
+20110302
+
+  * total number of images generated by this process:
+
+ load:
+ raw   	  : Nfilter x (image + variance + mask) (20M) 
+ cnv   	  : Nfilter x (image + variance + mask) (20M) 
+ (8 * 4B) + (4 * 2B)
+
+ match: (added)
+ match 	  : Nfilter x (image + variance + mask) (20M)
+(4 * 4B) + (2 * 2B)
+
+ phot: (added)
+ chisq 	  :       1 x (image + variance + mask) (10M) (freed at end of psphotStackReadout?)
+ backgnd  :       1 x (image) (10M) or Nfilter (20M) [unsure]
+
+ load:
+     1089174         4000000    psFitsImage.c:467
+     1092246         4000000    psFitsImage.c:467
+     1095902         4000000    psFitsImage.c:467
+     1098974         4000000    psFitsImage.c:467
+     1102619         4000000    psFitsImage.c:467
+     1105669         4000000    psFitsImage.c:467
+     1109303         4000000    psFitsImage.c:467
+     1112353         4000000    psFitsImage.c:467
+     1090766         2000000    psFitsImage.c:467
+     1097494         2000000    psFitsImage.c:467
+     1104200         2000000    psFitsImage.c:467
+     1110884         2000000    psFitsImage.c:467
+
+  match:
+     1128976         4000000    pmSubtractionMatch.c:178
+     1128979         4000000    pmSubtractionMatch.c:183
+     1652553         4000000    pmSubtractionMatch.c:178
+     1652556         4000000    pmSubtractionMatch.c:183
+     1128982         2000000    pmSubtractionMatch.c:189
+     1652559         2000000    pmSubtractionMatch.c:189
+
+  
+     2132413         4000000    pmFPAfileDefine.c:1275
+     2133004         4000000    pmFPACopy.c:71
+     2133010         4000000    pmFPACopy.c:71
+     2133007         2000000    pmFPACopy.c:71
+     8614548         2000000    psBinaryOp.c:502
+     8617313         2000000    psBinaryOp.c:502
 
 20101221 
Index: /branches/eam_branches/ipp-20110213/psphot/src/psphotExtendedSourceAnalysisByObject.c
===================================================================
--- /branches/eam_branches/ipp-20110213/psphot/src/psphotExtendedSourceAnalysisByObject.c	(revision 30775)
+++ /branches/eam_branches/ipp-20110213/psphot/src/psphotExtendedSourceAnalysisByObject.c	(revision 30776)
@@ -148,4 +148,5 @@
 		psFree(source->extpars->radFlux);
 		psFree(source->extpars->ellipticalFlux);
+		psFree(source->extpars->petProfile);
 	    }
 	}
Index: /branches/eam_branches/ipp-20110213/psphot/src/psphotMergeSources.c
===================================================================
--- /branches/eam_branches/ipp-20110213/psphot/src/psphotMergeSources.c	(revision 30775)
+++ /branches/eam_branches/ipp-20110213/psphot/src/psphotMergeSources.c	(revision 30776)
@@ -699,5 +699,6 @@
 	    sourceOut->parent = sourceSrc;
 
-	    // keep the original source flags
+	    // keep the original source flags and sequence ID (if set)
+	    sourceOut->seq      = sourceSrc->seq;
 	    sourceOut->type     = sourceSrc->type;
 	    sourceOut->mode     = sourceSrc->mode;
Index: /branches/eam_branches/ipp-20110213/psphot/src/psphotRadialAperturesByObject.c
===================================================================
--- /branches/eam_branches/ipp-20110213/psphot/src/psphotRadialAperturesByObject.c	(revision 30775)
+++ /branches/eam_branches/ipp-20110213/psphot/src/psphotRadialAperturesByObject.c	(revision 30776)
@@ -150,4 +150,7 @@
 	    } else {
 		source->mode |= PM_SOURCE_MODE_RADIAL_FLUX;
+		if (source->parent) {
+		    source->parent->mode |= PM_SOURCE_MODE_RADIAL_FLUX;
+		}
 	    }
 
Index: /branches/eam_branches/ipp-20110213/psphot/src/psphotRadialProfile.c
===================================================================
--- /branches/eam_branches/ipp-20110213/psphot/src/psphotRadialProfile.c	(revision 30775)
+++ /branches/eam_branches/ipp-20110213/psphot/src/psphotRadialProfile.c	(revision 30776)
@@ -25,4 +25,5 @@
 	return false;
     }
+    // allocate: extpars->radFlux->radii,fluxes,theta
 
     // use the radial profiles to determine the radius of a given isophote.  this isophote
@@ -33,4 +34,6 @@
 	return false;
     }
+    // allocate : extpars->radFlux->isophotalRadii (use profile->radii,fluxes)
+
 
     // convert the isophotal radius vs angle measurements to an elliptical contour
@@ -39,5 +42,6 @@
 	return false;
     }
-  
+    // use extpars->radFlux->isophotalRadii,theta (result in extpars->axes)
+
     // generate a single, normalized radial profile following the elliptical contours.
     // the radius is normalized by the axis ratio so that on the major axis, 1 pixel = 1 pixel
@@ -46,4 +50,5 @@
 	return false;
     }
+    // allocate extpars->ellipticalFlux->radiusElliptical,fluxElliptical (use axes to scale raw pixels)
   
     // generated profile in averaged bins
@@ -52,4 +57,6 @@
 	return false;
     }
+    // allocate extpars->radProfile->binSB, binSBstdv, binSum, binFill, radialBins, area (small lengths)
+    // use radiusElliptical, fluxElliptical, 
   
     return true;
Index: /branches/eam_branches/ipp-20110213/psphot/src/psphotStack.c
===================================================================
--- /branches/eam_branches/ipp-20110213/psphot/src/psphotStack.c	(revision 30775)
+++ /branches/eam_branches/ipp-20110213/psphot/src/psphotStack.c	(revision 30776)
@@ -2,4 +2,7 @@
 
 int main (int argc, char **argv) {
+
+    // XXX add memory dumps
+    psMemDumpSetState(true);
 
     psTimerStart ("complete");
@@ -12,4 +15,6 @@
 
     psphotVersionPrint();
+
+    psMemDump("start");
 
     // load input data (config and images (signal, noise, mask)
Index: /branches/eam_branches/ipp-20110213/psphot/src/psphotStackImageLoop.c
===================================================================
--- /branches/eam_branches/ipp-20110213/psphot/src/psphotStackImageLoop.c	(revision 30775)
+++ /branches/eam_branches/ipp-20110213/psphot/src/psphotStackImageLoop.c	(revision 30776)
@@ -18,4 +18,6 @@
     pmCell *cell;
     pmReadout *readout;
+
+    psMemDump("startloop");
 
     pmFPAfile *inputRaw = psMetadataLookupPtr (&status, config->files, "PSPHOT.STACK.INPUT.RAW");
@@ -86,4 +88,5 @@
 	if (!pmFPAfileIOChecks (config, view, PM_FPA_AFTER)) ESCAPE ("failed output for Chip in psphot.");
     }
+    psMemDump("doneloop");
 
     SetAstrometryFPA(config, view, bilevelAstrometry);
@@ -96,4 +99,6 @@
 
     psFree (view);
+
+    psMemDump("doneoutput");
     return true;
 }
Index: /branches/eam_branches/ipp-20110213/psphot/src/psphotStackReadout.c
===================================================================
--- /branches/eam_branches/ipp-20110213/psphot/src/psphotStackReadout.c	(revision 30775)
+++ /branches/eam_branches/ipp-20110213/psphot/src/psphotStackReadout.c	(revision 30776)
@@ -211,4 +211,6 @@
     }
 
+    psMemDump("psfstats");
+
     psphotStackObjectsUnifyPosition (objects);
 
@@ -230,4 +232,6 @@
     }
 
+    psMemDump("extmeas");
+
     bool smoothAgain = true;
     for (int nMatchedPSF = 0; smoothAgain; nMatchedPSF++) {
@@ -250,4 +254,5 @@
 	// smooth to the next FWHM, or set 'smoothAgain' to false if no more 
 	psphotStackMatchPSFsNext(&smoothAgain, config, view, STACK_OUT, nMatchedPSF);
+	psMemDump("matched");
     }
 
@@ -264,5 +269,5 @@
 
     // drop the references to the image pixels held by each source
-    // psphotSourceFreePixels (config, view, STACK_OUT);
+    psphotSourceFreePixels (config, view, STACK_OUT);
     psphotSourceFreePixels (config, view, STACK_SRC);
 
