Index: trunk/psLib/src/astronomy/psAstrometry.c
===================================================================
--- trunk/psLib/src/astronomy/psAstrometry.c	(revision 2778)
+++ trunk/psLib/src/astronomy/psAstrometry.c	(revision 2855)
@@ -8,6 +8,6 @@
  *  @author GLG, MHPCC
  *
- *  @version $Revision: 1.52 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2004-12-02 21:12:51 $
+ *  @version $Revision: 1.53 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2004-12-30 20:18:36 $
  *
  *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -399,9 +399,14 @@
 
     // create array of NULL psCells
-    chip->cells = psArrayAlloc(nCells);
+    int n = (nCells > 0) ? nCells : 1;
+    chip->cells = psArrayAlloc(n);
     psPtr* cells = chip->cells->data;
-    for (psS32 i=0;i<nCells;i++) {
+    for (psS32 i=0;i<n;i++) {
         cells[i] = NULL;
     }
+    chip->cells->n = 0; // per requirement
+
+    *(int*)&chip->row0 = 0;
+    *(int*)&chip->col0 = 0;
 
     chip->metadata = NULL;
@@ -429,9 +434,14 @@
 
     // create array of NULL psReadouts
-    cell->readouts = psArrayAlloc(nReadouts);
+    int n = (nReadouts > 0) ? nReadouts : 1;
+    cell->readouts = psArrayAlloc(n);
     psPtr* readouts = cell->readouts->data;
-    for (psS32 i=0;i<nReadouts;i++) {
+    for (psS32 i=0;i<n;i++) {
         readouts[i] = NULL;
     }
+    cell->readouts->n = 0; // per requirement
+
+    *(int*)&cell->row0 = 0;
+    *(int*)&cell->col0 = 0;
 
     cell->metadata = NULL;
@@ -452,19 +462,16 @@
 }
 
-psReadout* psReadoutAlloc(psS32 col0,
-                          psS32 row0,
-                          const psImage* image)
-{
-    PS_INT_CHECK_NON_NEGATIVE(col0, NULL);
-    PS_INT_CHECK_NON_NEGATIVE(row0, NULL);
-
+psReadout* psReadoutAlloc()
+{
     psReadout* readout = psAlloc(sizeof(psReadout));
 
-    *(psU32*)&readout->colBins = 1;
-    *(psU32*)&readout->rowBins = 1;
-    *(psS32*)&readout->col0 = col0;
-    *(psS32*)&readout->row0 = row0;
-
-    readout->image = (psImage*)image;
+    *(psU32*)&readout->colBins = 0;
+    *(psU32*)&readout->rowBins = 0;
+    *(psU32*)&readout->rowParity = 0;
+    *(psU32*)&readout->colParity = 0;
+    *(psS32*)&readout->col0 = 0;
+    *(psS32*)&readout->row0 = 0;
+
+    readout->image = NULL;
     readout->mask = NULL;
     readout->objects = NULL;
@@ -718,5 +725,5 @@
     PS_PTR_CHECK_NULL(cellCoord, NULL);
     PS_PTR_CHECK_NULL(cell, NULL);
-    PS_PTR_CHECK_NULL(cell->toTP, NULL);
+    PS_PTR_CHECK_NULL(cell->toSky, NULL);
     PS_PTR_CHECK_NULL(cell->parent, NULL);
     PS_PTR_CHECK_NULL(cell->parent->parent, NULL);
Index: trunk/psLib/src/astronomy/psAstrometry.h
===================================================================
--- trunk/psLib/src/astronomy/psAstrometry.h	(revision 2778)
+++ trunk/psLib/src/astronomy/psAstrometry.h	(revision 2855)
@@ -8,6 +8,6 @@
 *  @author GLG, MHPCC
 *
-*  @version $Revision: 1.32 $ $Name: not supported by cvs2svn $
-*  @date $Date: 2004-12-02 21:12:51 $
+*  @version $Revision: 1.33 $ $Name: not supported by cvs2svn $
+*  @date $Date: 2004-12-30 20:18:36 $
 *
 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -99,8 +99,12 @@
 typedef struct
 {
-    const psU32 colBins;        ///< Amount of binning in x-dimension
-    const psU32 rowBins;        ///< Amount of binning in y-dimension
-    const psS32 col0;                    ///< Offset from the left of chip.
-    const psS32 row0;                    ///< Offset from the bottom of chip.
+    const psS32 col0;                  ///< Offset from the left of chip.
+    const psS32 row0;                  ///< Offset from the bottom of chip.
+
+    const int colParity;               ///< Column Readout Direction
+    const int rowParity;               ///< Row Readout Direction
+
+    const psU32 colBins;               ///< Amount of binning in x-dimension
+    const psU32 rowBins;               ///< Amount of binning in y-dimension
 
     psImage* image;                    ///< Imaging area of readout
@@ -122,12 +126,16 @@
 typedef struct
 {
+    const psS32 col0;                  ///< Offset from the left of chip
+    const psS32 row0;                  ///< Offset from the bottom of chip
+
     psArray* readouts;                 ///< readouts from the cell
+
     psMetadata* metadata;              ///< cell-level metadata
 
     psPlaneTransform* toChip;          ///< transformations from cell to chip coordinates
-    psPlaneTransform* fromChip;        ///< transformations from chip to cell coordinates
+    psPlaneTransform* fromChip;        ///< transformations from cell to chip coordinates
     psPlaneTransform* toFPA;           ///< transformations from cell to FPA coordinates
-    psPlaneTransform* toTP;            ///< transformations from cell to tangent plane coordinates
-    psPlaneTransform* toSky;            ///< transformations from cell to tangent plane coordinates
+    psPlaneTransform* toTP;            ///< transformations from cell to FPA coordinates
+    psPlaneTransform* toSky;           ///< transformations from cell to tangent plane coordinates
 
     struct psChip* parent;             ///< chip in which contains this cell
@@ -145,5 +153,9 @@
 typedef struct psChip
 {
+    const psS32 col0;                  ///< Offset from the left of FPA
+    const psS32 row0;                  ///< Offset from the bottom of FPA
+
     psArray* cells;                    ///< cells in the chip
+
     psMetadata* metadata;              ///< chip-level metadata
 
@@ -282,5 +294,5 @@
 /** Allocator for psObservatory
  *
- *  This function shall construct a new psObservatory with attributes 
+ *  This function shall construct a new psObservatory with attributes
  *  cooresponding to the function parameters.
  *
@@ -340,11 +352,7 @@
  *  to NULL.
  *
- *  @return psReadout*    newly allocated psReadout
- */
-psReadout* psReadoutAlloc(
-    psS32 col0,                          ///< offset from the left of the cell
-    psS32 row0,                          ///< offset from the bottom of the cell
-    const psImage* image               ///< image of the readout
-);
+ *  @return psReadout*    newly allocated psReadout with all internal pointers set to NULL
+ */
+psReadout* psReadoutAlloc();
 
 /** Allocates a Wallace's Grommit structure.
