IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Sep 3, 2008, 5:09:21 PM (18 years ago)
Author:
Paul Price
Message:

View to top is based on existence of an HDU, not data.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/psModules/src/camera/pmFPAview.c

    r18905 r19351  
    33 *  @author EAM, IfA
    44 *
    5  *  @version $Revision: 1.15 $ $Name: not supported by cvs2svn $
    6  *  @date $Date: 2008-08-05 02:16:06 $
     5 *  @version $Revision: 1.16 $ $Name: not supported by cvs2svn $
     6 *  @date $Date: 2008-09-04 03:09:21 $
    77 *
    88 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    380380    pmFPAview *view = pmFPAviewAlloc(0);// View to top
    381381
    382     int numChips = 0;                   // Number of active chips
    383     psArray *chips = fpa->chips;        // Chips of interest
    384     for (int i = 0; i < chips->n; i++) {
    385         pmChip *chip = chips->data[i];  // Chip of interest
    386         if (!chip || !chip->file_exists) {
    387             continue;
    388         }
    389         numChips++;
    390         view->chip = i;
    391 
    392         int numCells = 0;               // Number of active cells
    393         psArray *cells = chip->cells;   // Cells of interest
    394         for (int j = 0; j < cells->n; j++) {
    395             pmCell *cell = cells->data[j]; // Cell of interest
    396             if (!cell || !cell->file_exists) {
     382    view->chip = -1;
     383    view->cell = -1;
     384    if (!fpa->hdu) {
     385        int numChips = 0;                   // Number of active chips
     386        psArray *chips = fpa->chips;        // Chips of interest
     387        for (int i = 0; i < chips->n; i++) {
     388            pmChip *chip = chips->data[i];  // Chip of interest
     389            if (!chip) {
    397390                continue;
    398391            }
    399             numCells++;
    400             view->cell = j;
     392            if (chip->hdu) {
     393                numChips++;
     394                view->chip = i;
     395            } else {
     396                int numCells = 0;               // Number of active cells
     397                psArray *cells = chip->cells;   // Cells of interest
     398                for (int j = 0; j < cells->n; j++) {
     399                    pmCell *cell = cells->data[j]; // Cell of interest
     400                    if (!cell) {
     401                        continue;
     402                    }
     403                    if (cell->hdu) {
     404                        numCells++;
     405                        view->cell = j;
     406                    }
     407                }
     408
     409                if (numCells > 1) {
     410                    if (numCells != cells->n) {
     411                        psWarning("More than one, but not all cells are active.");
     412                    }
     413                    view->cell = -1;
     414                }
     415            }
    401416        }
    402417
    403         if (numCells > 1) {
    404             if (numCells != cells->n) {
    405                 psWarning("More than one, but not all cells are active.");
     418        if (numChips > 1) {
     419            if (numChips != chips->n) {
     420                psWarning("More than one, but not all chips are active.");
    406421            }
     422            view->chip = -1;
    407423            view->cell = -1;
    408424        }
    409425    }
    410426
    411     if (numChips > 1) {
    412         if (numChips != chips->n) {
    413             psWarning("More than one, but not all chips are active.");
    414         }
    415         view->chip = -1;
    416         view->cell = -1;
    417     }
    418 
    419427    return view;
    420428}
Note: See TracChangeset for help on using the changeset viewer.