IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 6673


Ignore:
Timestamp:
Mar 22, 2006, 5:09:57 PM (20 years ago)
Author:
Paul Price
Message:

Adding pmFPAUtils.[ch], moving findChip and findCell in, renaming those

Location:
branches/rel10_ifa/psModules/src/astrom
Files:
2 added
4 edited

Legend:

Unmodified
Added
Removed
  • branches/rel10_ifa/psModules/src/astrom/Makefile.am

    r6663 r6673  
    88        pmFPAMaskWeight.c \
    99        pmFPARead.c \
     10        pmFPAUtils.c \
    1011        pmFPAWrite.c \
    1112        pmHDU.c \
    12         pmHDUGetLowest.c \
     13        pmHDUUtils.c \
    1314        pmReadout.c \
    1415        pmConcepts.c \
     
    2930        pmFPAMaskWeight.h \
    3031        pmFPARead.h \
     32        pmFPAUtils.h \
    3133        pmFPAWrite.h \
    3234        pmHDU.h \
    33         pmHDUGetLowest.h \
     35        pmHDUUtils.h \
    3436        pmReadout.h \
    3537        psAdditionals.h \
  • branches/rel10_ifa/psModules/src/astrom/pmFPA.c

    r6586 r6673  
    1212* XXX: Should we implement non-linear cell->chip transforms?
    1313*
    14 *  @version $Revision: 1.1.4.3 $ $Name: not supported by cvs2svn $
    15 *  @date $Date: 2006-03-15 02:37:16 $
     14*  @version $Revision: 1.1.4.4 $ $Name: not supported by cvs2svn $
     15*  @date $Date: 2006-03-23 03:09:57 $
    1616*
    1717*  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    363363}
    364364
    365 pmHDU *pmHDUFromFPA(pmFPA *fpa          // FPA for which to find HDU
    366                    )
    367 {
    368     return fpa->hdu;
    369 }
    370 
    371 pmHDU *pmHDUFromChip(pmChip *chip       // Chip for which to find HDU
    372                     )
    373 {
    374     pmHDU *hdu = chip->hdu;             // The HDU information
    375     if (!hdu) {
    376         hdu = pmHDUFromFPA(chip->parent); // Grab HDU info from the FPA
    377     }
    378 
    379     return hdu;
    380 }
    381 
    382 pmHDU *pmHDUFromCell(pmCell *cell       // Cell for which to find HDU
    383                     )
    384 {
    385     pmHDU *hdu = cell->hdu;             // The HDU information
    386     if (!hdu) {
    387         hdu = pmHDUFromChip(cell->parent); // Grab HDU info from the chip
    388     }
    389 
    390     return hdu;
    391 }
    392 
    393365static psBool cellCheckParents(pmCell *cell)
    394366{
  • branches/rel10_ifa/psModules/src/astrom/pmFPA.h

    r6552 r6673  
    77*  @author GLG, MHPCC
    88*
    9 *  @version $Revision: 1.1.4.3 $ $Name: not supported by cvs2svn $
    10 *  @date $Date: 2006-03-09 03:08:08 $
     9*  @version $Revision: 1.1.4.4 $ $Name: not supported by cvs2svn $
     10*  @date $Date: 2006-03-23 03:09:57 $
    1111*
    1212*  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    194194);
    195195
    196 // Find the HDU in the FPA hierarchy
    197 pmHDU *pmHDUFromFPA(pmFPA *fpa          // FPA for which to find HDU
    198                    );
    199 pmHDU *pmHDUFromChip(pmChip *chip       // Chip for which to find HDU
    200                     );
    201 pmHDU *pmHDUFromCell(pmCell *cell       // Cell for which to find HDU
    202                     );
    203196
    204197/** Verify parent links.
  • branches/rel10_ifa/psModules/src/astrom/pmFPAConstruct.c

    r6663 r6673  
    99#include "pmFPAConstruct.h"
    1010#include "pmFPAview.h"
     11#include "pmFPAUtils.h"
    1112
    1213//////////////////////////////////////////////////////////////////////////////////////////////////////////////
     
    3233
    3334    return cellData;
    34 }
    35 
    36 // Find a chip by name; return the index
    37 static int findChip(pmFPA *fpa, // FPA in which to find the chip
    38                     const char *name // Name of the chip
    39                    )
    40 {
    41     psArray *chips = fpa->chips;    // Array of chips
    42     for (int i = 0; i < chips->n; i++) {
    43         pmChip *chip = chips->data[i]; // The chip of interest
    44         psString testName = psMetadataLookupStr(NULL, chip->concepts, "CHIP.NAME"); // Name of this chip
    45         if (strcmp(name, testName) == 0) {
    46             return i;
    47         }
    48     }
    49 
    50     psError(PS_ERR_IO, true, "Unable to find chip %s\n", name);
    51     return -1;
    52 }
    53 
    54 // Find a cell by name; return the index
    55 static int findCell(pmChip *chip, // Chip in which to find the cell
    56                     const char *name // Name of the cell
    57                    )
    58 {
    59     psArray *cells = chip->cells;    // Array of cells
    60     for (int i = 0; i < cells->n; i++) {
    61         pmCell *cell = cells->data[i]; // The cell of interest
    62         psString testName = psMetadataLookupStr(NULL, cell->concepts, "CELL.NAME"); // Name of this cell
    63         if (strcmp(name, testName) == 0) {
    64             return i;
    65         }
    66     }
    67 
    68     psError(PS_ERR_IO, true, "Unable to find cell %s\n", name);
    69     return -1;
    7035}
    7136
     
    232197        // Get the chip
    233198        phuChipName = phuNameFromHeader("CHIP.NAME", formatSpec, phu); // Name of the chip
    234         int chipNum = findChip(fpa, phuChipName); // Chip number
     199        int chipNum = pmFPAFindChip(fpa, phuChipName); // Chip number
    235200        if (chipNum == -1) {
    236201            psError(PS_ERR_IO, true, "Unable to find chip %s in FPA.\n", phuChipName);
     
    257222            // Added this for possible future plans which might allow PHU=CELL
    258223            phuCellName = phuNameFromHeader("CELL.NAME", formatSpec, phu); // Name of the cell
    259             int cellNum = findCell(chip, phuCellName); // Cell number
     224            int cellNum = pmChipFindCell(chip, phuCellName); // Cell number
    260225            if (cellNum == -1) {
    261226                psError(PS_ERR_IO, true, "Unable to find cell %s in chip %s.\n", phuCellName, phuChipName);
     
    330295                         "(%s) --- there may be problems when reading!\n", chipName, phuChipName);
    331296                // Find the other chip
    332                 int chipNum = findChip(fpa, chipName); // The chip we're looking for
     297                int chipNum = pmFPAFindChip(fpa, chipName); // The chip we're looking for
    333298                if (chipNum == -1) {
    334299                    psLogMsg(__func__, PS_LOG_WARN, "Unable to find chip %s in fpa --- ignored.\n", chipName);
     
    338303            }
    339304            psString cellName = values->data[i]; // The name of the cell specified
    340             int cellNum = findCell(chip, cellName); // The cell we're looking for
     305            int cellNum = pmChipFindCell(chip, cellName); // The cell we're looking for
    341306            if (cellNum == -1) {
    342307                psLogMsg(__func__, PS_LOG_WARN, "Unable to find cell %s in chip %s --- ignored.\n",
     
    388353                psString chipName = names->data[i]; // The name of the chip
    389354                psString cellName = values->data[i]; // The name of the cell
    390                 int chipNum = findChip(fpa, chipName); // The chip we're looking for
     355                int chipNum = pmFPAFindChip(fpa, chipName); // The chip we're looking for
    391356                if (chipNum == -1) {
    392357                    psLogMsg(__func__, PS_LOG_WARN, "Unable to find chip %s in FPA --- ignored.\n", chipName);
     
    394359                }
    395360                chip = fpa->chips->data[chipNum];
    396                 int cellNum = findCell(chip, cellName); // The cell we're looking for
     361                int cellNum = pmChipFindCell(chip, cellName); // The cell we're looking for
    397362                if (cellNum == -1) {
    398363                    psLogMsg(__func__, PS_LOG_WARN, "Unable to find cell %s in chip %s --- ignored\n",
     
    429394                // Need to look up the name of the chip
    430395                chipName = phuNameFromHeader("CHIP.NAME", formatSpec, phu);
    431                 int chipNum = findChip(fpa, chipName);
     396                int chipNum = pmFPAFindChip(fpa, chipName);
    432397                if (chipNum == -1) {
    433398                    psLogMsg(__func__, PS_LOG_WARN, "Unable to find chip %s in FPA --- ignored.\n", chipName);
     
    444409                    chipName = names->data[i];
    445410                    cellName = cellType;
    446                     int chipNum = findChip(fpa, chipName); // The chip we're looking for
     411                    int chipNum = pmFPAFindChip(fpa, chipName); // The chip we're looking for
    447412                    if (chipNum == -1) {
    448413                        psLogMsg(__func__, PS_LOG_WARN, "Unable to find chip %s in FPA --- ignored.\n",
     
    455420                    cellName = names->data[i];
    456421                }
    457                 int cellNum = findCell(chip, cellName); // The cell we're looking for
     422                int cellNum = pmChipFindCell(chip, cellName); // The cell we're looking for
    458423                if (cellNum == -1) {
    459424                    psLogMsg(__func__, PS_LOG_WARN, "Unable to find cell %s in chip %s --- ignored.\n",
Note: See TracChangeset for help on using the changeset viewer.