Index: /trunk/psphot/doc/notes.txt
===================================================================
--- /trunk/psphot/doc/notes.txt	(revision 9890)
+++ /trunk/psphot/doc/notes.txt	(revision 9891)
@@ -1,2 +1,22 @@
+
+2006.11.06
+
+  I have added the aperture interpolation as a component of the
+  pmSourceMagnitudes function.  
+
+  I am trying to make things a bit more organized, with more
+  consistent APIs. 
+
+  * changed pmPSFtry to use the pmSourceMagnitudes API
+  * changed pmPSFtry to use new pmSource entries for each try (saving
+  * the pmModels generated)
+
+  other notes:
+  * moved psphotGrowthCurve -> pmGrowthCurveGenerate 
+
+  things I know need to be added / fixed:
+  * measure bicube fit to peak from smoothed image
+  * use psphotEnsemble fit to re-measure normalization?
+  * extended object statistical measures 
 
 2006.11.02
Index: /trunk/psphot/src/growthTest.c
===================================================================
--- /trunk/psphot/src/growthTest.c	(revision 9890)
+++ /trunk/psphot/src/growthTest.c	(revision 9891)
@@ -38,196 +38,4 @@
     modelRef->params->data.F32[PM_PAR_I0] = 1000;
     
-    // test of psImageShift 
-    { 
-	// assign the x and y coords to the image center
-	// create an object with center intensity of 1000
-	modelRef->params->data.F32[PM_PAR_XPOS] = 200+0.2;
-	modelRef->params->data.F32[PM_PAR_YPOS] = 200+0.6;
-	
-	// create modelPSF from this model
-	pmModel *model = pmModelFromPSF (modelRef, psf);
-
-	// psRegion region = {180, 220, 180, 220};
-	psRegion region = {0, 0, 0, 0};
-	psImage *imageView = psImageSubset (readout->image, region);
-	psImage *maskView = psImageSubset (readout->mask, region);
-
-	psImageInit (imageView, 0.0);
-	psImageInit (maskView, 0);
-	pmModelAdd (imageView, maskView, model, false, false);
-	float dx = 0.5 - model->params->data.F32[PM_PAR_XPOS] + (int)model->params->data.F32[PM_PAR_XPOS];
-	float dy = 0.5 - model->params->data.F32[PM_PAR_YPOS] + (int)model->params->data.F32[PM_PAR_YPOS];
-	psImage *tmpImage = tmp_psImageShift (imageView, dx, dy);
-
-	psFits *fits;
-	fits = psFitsOpen ("unshift_tmp.fits", "w");
-	psFitsWriteImage (fits, NULL, imageView, 0, NULL);
-	psFitsClose (fits);
-	
-	fits = psFitsOpen ("shift_tmp.fits", "w");
-	psFitsWriteImage (fits, NULL, tmpImage, 0, NULL);
-	psFitsClose (fits);
-    }
-
-    // test of psImageShift (Bilinear)
-    { 
-	// assign the x and y coords to the image center
-	// create an object with center intensity of 1000
-	modelRef->params->data.F32[PM_PAR_XPOS] = 200+0.2;
-	modelRef->params->data.F32[PM_PAR_YPOS] = 200+0.6;
-	
-	// create modelPSF from this model
-	pmModel *model = pmModelFromPSF (modelRef, psf);
-
-	// psRegion region = {180, 220, 180, 220};
-	psRegion region = {0, 0, 0, 0};
-	psImage *imageView = psImageSubset (readout->image, region);
-	psImage *maskView = psImageSubset (readout->mask, region);
-
-	psImageInit (imageView, 0.0);
-	psImageInit (maskView, 0);
-	pmModelAdd (imageView, maskView, model, false, false);
-	float dx = 0.5 - model->params->data.F32[PM_PAR_XPOS] + (int)model->params->data.F32[PM_PAR_XPOS];
-	float dy = 0.5 - model->params->data.F32[PM_PAR_YPOS] + (int)model->params->data.F32[PM_PAR_YPOS];
-	psImage *tmpImage = psImageShift (NULL, imageView, dx, dy, 0.0, PS_INTERPOLATE_BILINEAR);
-
-	psFits *fits;
-	fits = psFitsOpen ("unshift.fits", "w");
-	psFitsWriteImage (fits, NULL, imageView, 0, NULL);
-	psFitsClose (fits);
-	
-	fits = psFitsOpen ("shift.fits", "w");
-	psFitsWriteImage (fits, NULL, tmpImage, 0, NULL);
-	psFitsClose (fits);
-
-	modelRef->params->data.F32[PM_PAR_XPOS] = 200+0.5;
-	modelRef->params->data.F32[PM_PAR_YPOS] = 200+0.5;
-	model = pmModelFromPSF (modelRef, psf);
-	psImageInit (imageView, 0.0);
-	psImageInit (maskView, 0);
-	pmModelAdd (imageView, maskView, model, false, false);
-
-	fits = psFitsOpen ("center.fits", "w");
-	psFitsWriteImage (fits, NULL, imageView, 0, NULL);
-	psFitsClose (fits);
-    }
-
-    // test of psImageShift 
-    { 
-	// assign the x and y coords to the image center
-	// create an object with center intensity of 1000
-	modelRef->params->data.F32[PM_PAR_XPOS] = 200+0.2;
-	modelRef->params->data.F32[PM_PAR_YPOS] = 200+0.6;
-	
-	// create modelPSF from this model
-	pmModel *model = pmModelFromPSF (modelRef, psf);
-
-	// psRegion region = {180, 220, 180, 220};
-	psRegion region = {0, 0, 0, 0};
-	psImage *imageView = psImageSubset (readout->image, region);
-	psImage *maskView = psImageSubset (readout->mask, region);
-
-	psImageInit (imageView, 0.0);
-	psImageInit (maskView, 0);
-	pmModelAdd (imageView, maskView, model, false, false);
-	float dx = 0.5 - model->params->data.F32[PM_PAR_XPOS] + (int)model->params->data.F32[PM_PAR_XPOS];
-	float dy = 0.5 - model->params->data.F32[PM_PAR_YPOS] + (int)model->params->data.F32[PM_PAR_YPOS];
-	psImage *tmpImage = psImageShift (NULL, imageView, dx, dy, 0.0, PS_INTERPOLATE_BICUBE);
-
-	psFits *fits;
-	fits = psFitsOpen ("unshift_2.fits", "w");
-	psFitsWriteImage (fits, NULL, imageView, 0, NULL);
-	psFitsClose (fits);
-	
-	fits = psFitsOpen ("shift_2.fits", "w");
-	psFitsWriteImage (fits, NULL, tmpImage, 0, NULL);
-	psFitsClose (fits);
-
-	modelRef->params->data.F32[PM_PAR_XPOS] = 200+0.5;
-	modelRef->params->data.F32[PM_PAR_YPOS] = 200+0.5;
-	model = pmModelFromPSF (modelRef, psf);
-	psImageInit (imageView, 0.0);
-	psImageInit (maskView, 0);
-	pmModelAdd (imageView, maskView, model, false, false);
-
-	fits = psFitsOpen ("center_2.fits", "w");
-	psFitsWriteImage (fits, NULL, imageView, 0, NULL);
-	psFitsClose (fits);
-
-	psImageInit (maskView, 0);
-	psImageKeepCircle (maskView, model->params->data.F32[PM_PAR_XPOS], model->params->data.F32[PM_PAR_YPOS], 2, "OR", PM_MASK_MARK);
-	fits = psFitsOpen ("mask_2.fits", "w");
-	psFitsWriteImage (fits, NULL, maskView, 0, NULL);
-	psFitsClose (fits);
-
-	psImageInit (maskView, 0);
-	psImageKeepCircle (maskView, model->params->data.F32[PM_PAR_XPOS], model->params->data.F32[PM_PAR_YPOS], 3, "OR", PM_MASK_MARK);
-	fits = psFitsOpen ("mask_3.fits", "w");
-	psFitsWriteImage (fits, NULL, maskView, 0, NULL);
-	psFitsClose (fits);
-    }
-
-    // test of model insert, mask, shift
-    { 
-	psFits *fits;
-	pmModel *model;
-	psRegion region = {180, 220, 180, 220};
-
-	// create an object with center intensity of 1000 at 0.5,0.5 frac pixel center
-	modelRef->params->data.F32[PM_PAR_XPOS] = 200+0.5;
-	modelRef->params->data.F32[PM_PAR_YPOS] = 200+0.5;
-	model = pmModelFromPSF (modelRef, psf);
-
-	psImageInit (readout->image, 0.0);
-	psImageInit (readout->mask, 0);
-
-	psImage *image1 = psImageSubset (readout->image, region);
-	psImage *mask1 = psImageSubset (readout->mask, region);
-	psImageKeepCircle (mask1, model->params->data.F32[PM_PAR_XPOS], model->params->data.F32[PM_PAR_YPOS], 3, "OR", PM_MASK_MARK);
-	pmModelAdd (image1, mask1, model, false, false);
-
-	// write ref object
-	fits = psFitsOpen ("refobj.fits", "w");
-	psFitsWriteImage (fits, NULL, image1, 0, NULL);
-	psFitsClose (fits);
-	
-	// write ref mask
-	fits = psFitsOpen ("refmask.fits", "w");
-	psFitsWriteImage (fits, NULL, mask1, 0, NULL);
-	psFitsClose (fits);
-	
-	// create an object with center intensity of 1000 at 0.3,0.6 frac pixel center
-	modelRef->params->data.F32[PM_PAR_XPOS] = 200+0.3;
-	modelRef->params->data.F32[PM_PAR_YPOS] = 200+0.6;
-	model = pmModelFromPSF (modelRef, psf);
-
-	psImageInit (readout->image, 0.0);
-	psImageInit (readout->mask, 0);
-
-	psImage *image2 = psImageSubset (readout->image, region);
-	psImage *mask2 = psImageSubset (readout->mask, region);
-	psImageKeepCircle (mask2, model->params->data.F32[PM_PAR_XPOS], model->params->data.F32[PM_PAR_YPOS], 3, "OR", PM_MASK_MARK);
-	pmModelAdd (image2, mask2, model, false, false);
-
-	// write sci object
-	fits = psFitsOpen ("sciobj.fits", "w");
-	psFitsWriteImage (fits, NULL, image2, 0, NULL);
-	psFitsClose (fits);
-	
-	// write sci mask
-	fits = psFitsOpen ("scimask.fits", "w");
-	psFitsWriteImage (fits, NULL, mask2, 0, NULL);
-	psFitsClose (fits);
-	
-	// shift image to match ref object
-	float dx = 0.5 - model->params->data.F32[PM_PAR_XPOS] + (int)model->params->data.F32[PM_PAR_XPOS];
-	float dy = 0.5 - model->params->data.F32[PM_PAR_YPOS] + (int)model->params->data.F32[PM_PAR_YPOS];
-	psImage *tmpImage = tmp_psImageShift (image2, dx, dy);
-
-	fits = psFitsOpen ("scishift.fits", "w");
-	psFitsWriteImage (fits, NULL, tmpImage, 0, NULL);
-	psFitsClose (fits);
-    }
-
     // generate the growth curve (element of psf)
     psphotGrowthCurve (readout, psf, false);
@@ -259,8 +67,4 @@
 		pmModelAdd (imageView, maskView, model, false, false);
 
-		// fits = psFitsOpen ("imo.fits", "w");
-		// psFitsWriteImage (fits, NULL, imageView, 0, NULL);
-		// psFitsClose (fits);
-
 		float dX = 0.5 - model->params->data.F32[PM_PAR_XPOS] + (int)model->params->data.F32[PM_PAR_XPOS];
 		float dY = 0.5 - model->params->data.F32[PM_PAR_YPOS] + (int)model->params->data.F32[PM_PAR_YPOS];
