IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 13190


Ignore:
Timestamp:
May 3, 2007, 10:04:01 AM (19 years ago)
Author:
magnier
Message:

added functions to check pmFPA/Chip/Cell/Readout data_exists flags

Location:
trunk/psModules/src/camera
Files:
5 edited

Legend:

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

    r12838 r13190  
    1212#include "pmFPA.h"
    1313#include "pmFPALevel.h"
     14#include "pmFPAview.h"
    1415#include "pmFPAFlags.h"
    1516#include "pmConcepts.h"
    16 #include "pmFPAview.h"
    1717#include "pmFPAConstruct.h"
    1818#include "pmFPAUtils.h"
  • trunk/psModules/src/camera/pmFPAFlags.c

    r12696 r13190  
    88#include "pmHDU.h"
    99#include "pmFPA.h"
     10#include "pmFPALevel.h"
     11#include "pmFPAview.h"
    1012#include "pmFPAFlags.h"
    1113
     
    128130}
    129131
     132// pmFPA does not have its own data_exists flag; check its children
     133bool pmFPACheckDataStatus (const pmFPA *fpa) {
     134
     135    PS_ASSERT_PTR_NON_NULL(fpa, false);
     136
     137    for (int i = 0; i < fpa->chips->n; i++) {
     138        pmChip *chip = fpa->chips->data[i];
     139        if (chip == NULL) continue;
     140        if (chip->data_exists) return true;
     141    }
     142    return false;
     143}
     144
     145bool pmChipCheckDataStatus (const pmChip *chip) {
     146
     147    PS_ASSERT_PTR_NON_NULL(chip, false);
     148
     149    return (chip->data_exists);
     150}
     151
     152bool pmCellCheckDataStatus (const pmCell *cell) {
     153
     154    PS_ASSERT_PTR_NON_NULL(cell, false);
     155
     156    return (cell->data_exists);
     157}
     158
     159bool pmReadoutCheckDataStatus (const pmReadout *readout) {
     160
     161    PS_ASSERT_PTR_NON_NULL(readout, false);
     162
     163    return (readout->data_exists);
     164}
     165
     166bool pmFPAviewCheckDataStatus (const pmFPA *fpa, const pmFPAview *view) {
     167
     168    PS_ASSERT_PTR_NON_NULL(fpa, false);
     169    PS_ASSERT_PTR_NON_NULL(view, false);
     170
     171    if (view->chip == -1) {
     172        bool exists = pmFPACheckDataStatus (fpa);
     173        return exists;
     174    }
     175
     176    if (view->chip >= fpa->chips->n) {
     177        psError(PS_ERR_IO, true, "Requested chip == %d >= fpa->chips->n == %ld", view->chip, fpa->chips->n);
     178        return false;
     179    }
     180    pmChip *chip = fpa->chips->data[view->chip];
     181
     182    if (view->cell == -1) {
     183        bool exists = pmChipCheckDataStatus (chip);
     184        return exists;
     185    }
     186
     187    if (view->cell >= chip->cells->n) {
     188        psError(PS_ERR_IO, true, "Requested cell == %d >= chip->cells->n == %ld", view->cell, chip->cells->n);
     189        return false;
     190    }
     191    pmCell *cell = chip->cells->data[view->cell];
     192
     193    if (view->readout == -1) {
     194        bool exists = pmCellCheckDataStatus (cell);
     195        return exists;
     196    }
     197
     198    if (view->readout >= cell->readouts->n) {
     199        psError(PS_ERR_IO, true, "Requested readout == %d >= cell->readouds->n == %ld", view->readout, cell->readouts->n);
     200        return false;
     201    }
     202    pmReadout *readout = cell->readouts->data[view->readout];
     203
     204    bool exists = pmReadoutCheckDataStatus (readout);
     205    return exists;
     206}
    130207
    131208// Set cells within a chip to be processed or not
  • trunk/psModules/src/camera/pmFPAFlags.h

    r12696 r13190  
    66 *  @author Eugene Magnier, IfA
    77 *
    8  *  @version $Revision: 1.4 $ $Name: not supported by cvs2svn $
    9  *  @date $Date: 2007-03-30 21:12:56 $
     8 *  @version $Revision: 1.5 $ $Name: not supported by cvs2svn $
     9 *  @date $Date: 2007-05-03 20:04:01 $
    1010 *  Copyright 2005-2006 Institute for Astronomy, University of Hawaii
    1111 */
     
    6565                        );
    6666
     67
     68// Functions the check the data_exists flags
     69
     70/// Check data_exists for the element of this fpa at this view
     71bool pmFPAviewCheckDataStatus (const pmFPA *fpa, ///< FPA to check
     72                               const pmFPAview *view ///< check for this view
     73  );
     74
     75/// Check data_exists for this fpa
     76bool pmFPACheckDataStatus (const pmFPA *fpa ///< FPA to check
     77  );
     78
     79/// Check data_exists for this chip
     80bool pmChipCheckDataStatus (const pmChip *chip ///< Chip to check
     81);
     82
     83/// Check data_exists for this cell
     84bool pmCellCheckDataStatus (const pmCell *cell ///< Cell to check
     85);
     86
     87/// Check data_exists for this readout
     88bool pmReadoutCheckDataStatus (const pmReadout *readout ///< Readout to check
     89);
     90
     91
    6792// Functions to set the process flags
    6893
  • trunk/psModules/src/camera/pmFPAMosaic.c

    r13189 r13190  
    99#include "pmHDU.h"
    1010#include "pmFPA.h"
     11#include "pmFPALevel.h"
     12#include "pmFPAview.h"
    1113#include "pmFPAFlags.h"
    1214#include "pmConceptsAverage.h"
  • trunk/psModules/src/camera/pmFPARead.c

    r12696 r13190  
    1212#include "pmFPA.h"
    1313#include "pmFPALevel.h"
     14#include "pmFPAview.h"
    1415#include "pmFPAFlags.h"
    1516#include "pmHDUUtils.h"
Note: See TracChangeset for help on using the changeset viewer.