Index: trunk/psModules/src/astrom/pmAstrometry.c
===================================================================
--- trunk/psModules/src/astrom/pmAstrometry.c	(revision 5681)
+++ trunk/psModules/src/astrom/pmAstrometry.c	(revision 5739)
@@ -13,6 +13,6 @@
 * XXX: Should we implement non-linear cell->chip transforms?
 * 
-*  @version $Revision: 1.10 $ $Name: not supported by cvs2svn $
-*  @date $Date: 2005-12-05 21:28:55 $
+*  @version $Revision: 1.11 $ $Name: not supported by cvs2svn $
+*  @date $Date: 2005-12-08 00:00:57 $
 *
 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
@@ -799,2 +799,76 @@
     return(cellCoord);
 }
+
+/*****************************************************************************
+ *****************************************************************************/
+bool pmFPASelectChip(
+    pmFPA *fpa,
+    int chipNum)
+{
+    PS_ASSERT_PTR_NON_NULL(fpa, false);
+    if ((fpa->chips == NULL) || (chipNum >= fpa->chips->n)) {
+        return(false);
+    }
+    psBool rc = true;
+
+    for (psS32 i = 0 ; i < fpa->chips->n ; i++) {
+        pmChip *tmpChip = (pmChip *) fpa->chips->data[i];
+        if (tmpChip == NULL) {
+            rc = false;
+        } else {
+            if (i == chipNum) {
+                tmpChip->valid = true;
+            } else {
+                tmpChip->valid = false;
+            }
+        }
+    }
+
+    return(rc);
+}
+
+
+/*****************************************************************************
+XXX: The SDRS is ambiguous on a few things:
+    Whether or not the other chips should be set valid=true.
+    Should we return the number of chip valid=true before or after they're set,
+ *****************************************************************************/
+/**
+ * 
+ * pmFPAExcludeChip shall set valid to false only for the specified chip
+ * number (chipNum). In the event that the specified chip number does not exist
+ * within the fpa, the function shall generate a warning, and perform no action.
+ * The function shall return the number of chips within the fpa that have valid
+ * set to true.
+ *  
+ */
+int pmFPAExcludeChip(
+    pmFPA *fpa,
+    int chipNum)
+{
+    PS_ASSERT_PTR_NON_NULL(fpa, false);
+
+    if (fpa->chips == NULL) {
+        psLogMsg(__func__, PS_LOG_WARN, "WARNING: fpa->chips == NULL\n");
+        return(0);
+    }
+    if ((chipNum >= fpa->chips->n) || (NULL == (pmChip *) fpa->chips->data[chipNum])) {
+        psLogMsg(__func__, PS_LOG_WARN, "WARNING: the specified chip (%d) does not exist.\n", chipNum);
+        return(0);
+    }
+
+    psS32 numChips = 0;
+    for (psS32 i = 0 ; i < fpa->chips->n ; i++) {
+        pmChip *tmpChip = (pmChip *) fpa->chips->data[i];
+        if (tmpChip != NULL) {
+            if (i == chipNum) {
+                tmpChip->valid = false;
+            } else {
+                tmpChip->valid = true;
+                numChips++;
+            }
+        }
+    }
+
+    return(numChips);
+}
Index: trunk/psModules/src/astrom/pmAstrometry.h
===================================================================
--- trunk/psModules/src/astrom/pmAstrometry.h	(revision 5681)
+++ trunk/psModules/src/astrom/pmAstrometry.h	(revision 5739)
@@ -8,6 +8,6 @@
 *  @author GLG, MHPCC
 *
-*  @version $Revision: 1.4 $ $Name: not supported by cvs2svn $
-*  @date $Date: 2005-12-05 21:28:55 $
+*  @version $Revision: 1.5 $ $Name: not supported by cvs2svn $
+*  @date $Date: 2005-12-08 00:00:57 $
 *
 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
@@ -423,3 +423,32 @@
 );
 
+/**
+ * 
+ * pmFPASelectChip shall set valid to true for the specified chip number
+ * (chipNum), and all other chips shall have valid set to false. In the event
+ * that the specified chip number does not exist within the fpa, the function
+ * shall return false.
+ *  
+ */
+bool pmFPASelectChip(
+    pmFPA *fpa,
+    int chipNum
+);
+
+/**
+ * 
+ * pmFPAExcludeChip shall set valid to false only for the specified chip
+ * number (chipNum). In the event that the specified chip number does not exist
+ * within the fpa, the function shall generate a warning, and perform no action.
+ * The function shall return the number of chips within the fpa that have valid
+ * set to true.
+ *  
+ */
+int pmFPAExcludeChip(
+    pmFPA *fpa,
+    int chipNum
+);
+
+
 #endif // #ifndef PS_ASTROMETRY_H
+
