IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 13192


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

added functions to check pmFPA/Chip/Cell/Readout for psphot sources

Location:
trunk/psModules/src/objects
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/psModules/src/objects/pmSourceIO.c

    r13136 r13192  
    33 *  @author EAM, IfA
    44 *
    5  *  @version $Revision: 1.38 $ $Name: not supported by cvs2svn $
    6  *  @date $Date: 2007-05-03 00:12:03 $
     5 *  @version $Revision: 1.39 $ $Name: not supported by cvs2svn $
     6 *  @date $Date: 2007-05-03 20:04:31 $
    77 *
    88 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    662662}
    663663
    664 
     664bool pmFPAviewCheckDataStatusForSources (const pmFPAview *view, const pmFPAfile *file)
     665{
     666    pmFPA *fpa = file->fpa;
     667
     668    if (view->chip == -1) {
     669        bool exists = pmFPACheckDataStatusForSources (fpa);
     670        return exists;
     671    }
     672    if (view->chip >= fpa->chips->n) {
     673        psError(PS_ERR_IO, true, "Requested chip == %d >= fpa->chips->n == %ld", view->chip, fpa->chips->n);
     674        return false;
     675    }
     676    pmChip *chip = fpa->chips->data[view->chip];
     677
     678    if (view->cell == -1) {
     679        bool exists = pmChipCheckDataStatusForSources (chip);
     680        return exists;
     681    }
     682    if (view->cell >= chip->cells->n) {
     683        psError(PS_ERR_IO, true, "Requested cell == %d >= chip->cells->n == %ld", view->cell, chip->cells->n);
     684        return false;
     685    }
     686    pmCell *cell = chip->cells->data[view->cell];
     687
     688    if (view->readout == -1) {
     689        bool exists = pmCellCheckDataStatusForSources (cell);
     690        return exists;
     691    }
     692
     693    if (view->readout >= cell->readouts->n) {
     694        psError(PS_ERR_IO, true, "Requested readout == %d >= cell->readouds->n == %ld", view->readout, cell->readouts->n);
     695        return false;
     696    }
     697    pmReadout *readout = cell->readouts->data[view->readout];
     698
     699    bool exists = pmReadoutCheckDataStatusForSources (readout);
     700    return exists;
     701}
     702
     703bool pmFPACheckDataStatusForSources (const pmFPA *fpa) {
     704
     705    for (int i = 0; i < fpa->chips->n; i++) {
     706        pmChip *chip = fpa->chips->data[i];
     707        if (!chip) continue;
     708        if (pmChipCheckDataStatusForSources (chip)) return true;
     709    }
     710    return false;
     711}
     712
     713bool pmChipCheckDataStatusForSources (const pmChip *chip) {
     714
     715    for (int i = 0; i < chip->cells->n; i++) {
     716        pmCell *cell = chip->cells->data[i];
     717        if (!cell) continue;
     718        if (pmCellCheckDataStatusForSources (cell)) return true;
     719    }
     720    return false;
     721}
     722
     723bool pmCellCheckDataStatusForSources (const pmCell *cell) {
     724
     725    for (int i = 0; i < cell->readouts->n; i++) {
     726        pmReadout *readout = cell->readouts->data[i];
     727        if (!readout) continue;
     728        if (pmReadoutCheckDataStatusForSources (readout)) return true;
     729    }
     730    return false;
     731}
     732
     733bool pmReadoutCheckDataStatusForSources (const pmReadout *readout) {
     734
     735    bool status;
     736
     737    // select the psf of interest
     738    pmPSF *psf = psMetadataLookupPtr (&status, readout->analysis, "PSPHOT.SOURCES");
     739    if (!psf) return false;
     740    return true;
     741}
     742
  • trunk/psModules/src/objects/pmSourceIO.h

    r13137 r13192  
    44 * @author EAM, IfA; GLG, MHPCC
    55 *
    6  * @version $Revision: 1.9 $ $Name: not supported by cvs2svn $
    7  * @date $Date: 2007-05-03 00:13:03 $
     6 * @version $Revision: 1.10 $ $Name: not supported by cvs2svn $
     7 * @date $Date: 2007-05-03 20:04:31 $
    88 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii
    99 *
     
    5050bool pmReadoutWriteObjects (pmReadout *readout, const pmFPAview *view, pmFPAfile *file, const pmConfig *config);
    5151
     52bool pmFPAviewCheckDataStatusForSources (const pmFPAview *view, const pmFPAfile *file);
     53bool pmFPACheckDataStatusForSources (const pmFPA *fpa);
     54bool pmChipCheckDataStatusForSources (const pmChip *chip);
     55bool pmCellCheckDataStatusForSources (const pmCell *cell);
     56bool pmReadoutCheckDataStatusForSources (const pmReadout *readout);
     57
    5258/// @}
    5359# endif /* PM_SOURCE_IO_H */
Note: See TracChangeset for help on using the changeset viewer.