Index: /trunk/psLib/src/astro/psCoord.c
===================================================================
--- /trunk/psLib/src/astro/psCoord.c	(revision 6252)
+++ /trunk/psLib/src/astro/psCoord.c	(revision 6253)
@@ -10,6 +10,6 @@
 *  @author GLG, MHPCC
 *
-*  @version $Revision: 1.103 $ $Name: not supported by cvs2svn $
-*  @date $Date: 2006-01-30 20:28:33 $
+*  @version $Revision: 1.104 $ $Name: not supported by cvs2svn $
+*  @date $Date: 2006-01-30 22:56:01 $
 *
 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
@@ -1088,5 +1088,5 @@
         //XXX: Should the length (nalloc) be 1 and append be used everytime a pixel is added?
         //        out = psPixelsAlloc(input->nalloc);
-        out = psPixelsAlloc(1);
+        out = psPixelsAlloc(0);
     }
     psPlane *coord = psPlaneAlloc();
Index: /trunk/psLib/test/astro/tst_psCoord.c
===================================================================
--- /trunk/psLib/test/astro/tst_psCoord.c	(revision 6252)
+++ /trunk/psLib/test/astro/tst_psCoord.c	(revision 6253)
@@ -6,6 +6,6 @@
 *  @author GLG, MHPCC
 *
-*  @version $Revision: 1.8 $ $Name: not supported by cvs2svn $
-*  @date $Date: 2006-01-30 20:28:34 $
+*  @version $Revision: 1.9 $ $Name: not supported by cvs2svn $
+*  @date $Date: 2006-01-30 22:56:01 $
 *
 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
@@ -396,5 +396,5 @@
     }
 
-    input = psPixelsAlloc(5);
+    input = psPixelsAlloc(1);
     /*    for (int i = 0; i < 2; i++) {
             input->data[i].x = i*1.0;
@@ -403,29 +403,33 @@
     */
     input->data[0].x = 1.0;
-    input->data[0].y = 2.0;
-    input->data[1].x = 1.0;
-    input->data[1].y = 3.0;
-    trans->x->nX = 1;
+    input->data[0].y = 1.0;
+    //    input->data[1].x = 1.0;
+    //    input->data[1].y = 6.0;
+    trans->x->nX = 2;
     trans->x->nY = 0;
-    trans->y->nX = 1;
-    trans->y->nY = 0;
+    trans->y->nX = 0;
+    trans->y->nY = 2;
     trans->x->coeff[0][0] = 0;
-    trans->x->coeff[1][0] = 1;
+    trans->x->coeff[1][0] = 1.0;
     trans->y->coeff[0][0] = 0;
-    trans->y->coeff[1][0] = 2;
+    trans->y->coeff[0][0] = 0;
+    trans->y->coeff[0][2] = 0.5;
 
     //Verify that the output pixels are what we expected
     output = psPixelsTransform(output, input, trans);
-    printf("\n output return %ld pixels\n\n", output->n);
-    int nExpected = 1;
+    printf("\n output returned with %ld pixels\n\n", output->n);
+    int nExpected = 9;
     if (output->n != nExpected) {
         psError(PS_ERR_BAD_PARAMETER_SIZE, false,
                 "psPixelsTransform failed to return the expected number of pixels.\n");
+        for (int i = 0; i < output->n; i++) {
+            printf("  (%6.2lf, %6.2lf) pixel %d\n", output->data[i].x, output->data[i].y, i);
+        }
         return 3;
     }
 
+    psFree(trans);
     psFree(input);
     psFree(output);
-    psFree(trans);
 
     return 0;
Index: /trunk/psLib/test/astro/tst_psCoord02.c
===================================================================
--- /trunk/psLib/test/astro/tst_psCoord02.c	(revision 6252)
+++ /trunk/psLib/test/astro/tst_psCoord02.c	(revision 6253)
@@ -6,6 +6,6 @@
 *  @author GLG, MHPCC
 *
-*  @version $Revision: 1.2 $ $Name: not supported by cvs2svn $
-*  @date $Date: 2005-11-23 01:03:18 $
+*  @version $Revision: 1.3 $ $Name: not supported by cvs2svn $
+*  @date $Date: 2006-01-30 22:56:01 $
 *
 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
@@ -18,9 +18,11 @@
 static psS32 test05( void );
 static psS32 test06( void );
+static psS32 test07( void );
 
 testDescription tests[] = {
-                              {test04, 0000, "psPlaneTransformCombine()", 0, false},
-                              {test05, 0000, "psPlaneTransformFit()", 0, false},
-                              {test06, 0000, "psPlaneTransformInvert()", 0, false},
+                              {test04, 660, "psPlaneTransformCombine()", 0, false},
+                              {test05, 662, "psPlaneTransformFit()", 0, false},
+                              {test06, 663, "psPlaneTransformInvert()", 0, false},
+                              {test07, 666, "psPlaneTransformDeriv()", 0, false},
                               {NULL}
                           };
@@ -505,3 +507,62 @@
 }
 
-
+psS32 test07( void )
+{
+    psPlane *coord = psPlaneAlloc();
+    psPlane *deriv = NULL;
+    psPlaneTransform *trans = NULL;
+
+    //Set fxn values for evaluation
+    coord->x = 1.0;
+    coord->y = 1.0;
+
+    //Return NULL for NULL input plane transform
+    psLogMsg(__func__,PS_LOG_INFO,"Following should generate error message");
+    deriv = psPlaneTransformDeriv(NULL, trans, coord);
+    if (deriv != NULL) {
+        psError(PS_ERR_BAD_PARAMETER_NULL, false,
+                "psPlaneTransformDeriv failed to return NULL for NULL plane transform input.\n");
+        return 1;
+    }
+
+    trans = psPlaneTransformAlloc(1, 2);
+
+    //Set Polynomials.  f(x) = x, f(y) = 0.5*y^2  -->  f'(x) = 1, f'(y) = y
+    //So for 1,1  -> f'(1) = 1, f'(1) = 1
+    trans->x->nX = 1;
+    trans->x->nY = 0;
+    trans->y->nX = 0;
+    trans->y->nY = 2;
+
+    trans->x->coeff[0][0] = 0.0;
+    trans->x->coeff[1][0] = 1.0;
+
+    trans->y->coeff[0][0] = 0.0;
+    trans->y->coeff[0][1] = 0.0;
+    trans->y->coeff[0][2] = 0.5;
+
+    //Return NULL for NULL input plane
+    psLogMsg(__func__,PS_LOG_INFO,"Following should generate error message");
+    deriv = psPlaneTransformDeriv(NULL, trans, NULL);
+    if (deriv != NULL) {
+        psError(PS_ERR_BAD_PARAMETER_NULL, false,
+                "psPlaneTransformDeriv failed to return NULL for NULL plane input.\n");
+        return 2;
+    }
+
+    //Return correct values.  Should have x=1.0, y=1.0.
+    deriv = psPlaneTransformDeriv(NULL, trans, coord);
+    if (deriv->x != 1.0 || deriv->y != 1.0) {
+        psError(PS_ERR_BAD_PARAMETER_VALUE, false,
+                "psPlaneTransformDeriv failed to return the correct values.\n");
+        printf("\n f' values are = %lf, %lf \n", deriv->x, deriv->y);
+        //        return 3;
+    }
+
+    psFree(trans);
+    psFree(deriv);
+    psFree(coord);
+
+    return 0;
+}
+
