IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Dec 12, 2005, 11:52:24 AM (21 years ago)
Author:
desonia
Message:

merged post-release fixes from CVS main.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/rel9/psModules/src/astrom/pmAstrometry.c

    r5681 r5768  
    1313* XXX: Should we implement non-linear cell->chip transforms?
    1414*
    15 *  @version $Revision: 1.10 $ $Name: not supported by cvs2svn $
    16 *  @date $Date: 2005-12-05 21:28:55 $
     15*  @version $Revision: 1.10.2.1 $ $Name: not supported by cvs2svn $
     16*  @date $Date: 2005-12-12 21:52:17 $
    1717*
    1818*  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    799799    return(cellCoord);
    800800}
     801
     802/*****************************************************************************
     803 *****************************************************************************/
     804bool pmFPASelectChip(
     805    pmFPA *fpa,
     806    int chipNum)
     807{
     808    PS_ASSERT_PTR_NON_NULL(fpa, false);
     809    if ((fpa->chips == NULL) || (chipNum >= fpa->chips->n)) {
     810        return(false);
     811    }
     812    psBool rc = true;
     813
     814    for (psS32 i = 0 ; i < fpa->chips->n ; i++) {
     815        pmChip *tmpChip = (pmChip *) fpa->chips->data[i];
     816        if (tmpChip == NULL) {
     817            rc = false;
     818        } else {
     819            if (i == chipNum) {
     820                tmpChip->valid = true;
     821            } else {
     822                tmpChip->valid = false;
     823            }
     824        }
     825    }
     826
     827    return(rc);
     828}
     829
     830
     831/*****************************************************************************
     832XXX: The SDRS is ambiguous on a few things:
     833    Whether or not the other chips should be set valid=true.
     834    Should we return the number of chip valid=true before or after they're set,
     835 *****************************************************************************/
     836/**
     837 *
     838 * pmFPAExcludeChip shall set valid to false only for the specified chip
     839 * number (chipNum). In the event that the specified chip number does not exist
     840 * within the fpa, the function shall generate a warning, and perform no action.
     841 * The function shall return the number of chips within the fpa that have valid
     842 * set to true.
     843 * 
     844 */
     845int pmFPAExcludeChip(
     846    pmFPA *fpa,
     847    int chipNum)
     848{
     849    PS_ASSERT_PTR_NON_NULL(fpa, false);
     850
     851    if (fpa->chips == NULL) {
     852        psLogMsg(__func__, PS_LOG_WARN, "WARNING: fpa->chips == NULL\n");
     853        return(0);
     854    }
     855    if ((chipNum >= fpa->chips->n) || (NULL == (pmChip *) fpa->chips->data[chipNum])) {
     856        psLogMsg(__func__, PS_LOG_WARN, "WARNING: the specified chip (%d) does not exist.\n", chipNum);
     857        return(0);
     858    }
     859
     860    psS32 numChips = 0;
     861    for (psS32 i = 0 ; i < fpa->chips->n ; i++) {
     862        pmChip *tmpChip = (pmChip *) fpa->chips->data[i];
     863        if (tmpChip != NULL) {
     864            if (i == chipNum) {
     865                tmpChip->valid = false;
     866            } else {
     867                tmpChip->valid = true;
     868                numChips++;
     869            }
     870        }
     871    }
     872
     873    return(numChips);
     874}
Note: See TracChangeset for help on using the changeset viewer.