IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Nov 9, 2007, 3:09:20 PM (19 years ago)
Author:
eugene
Message:

updating all changes from from eam_branch_20071023

File:
1 edited

Legend:

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

    r15254 r15562  
    66 *  @author EAM, IfA
    77 *
    8  *  @version $Revision: 1.27 $ $Name: not supported by cvs2svn $
    9  *  @date $Date: 2007-10-09 19:26:25 $
     8 *  @version $Revision: 1.28 $ $Name: not supported by cvs2svn $
     9 *  @date $Date: 2007-11-10 01:09:20 $
    1010 *
    1111 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    5050bool pmPSFmodelCheckDataStatusForView (const pmFPAview *view, const pmFPAfile *file)
    5151{
     52    PS_ASSERT_PTR_NON_NULL(view, false);
     53    PS_ASSERT_PTR_NON_NULL(file, false);
     54    PS_ASSERT_PTR_NON_NULL(file->fpa, false);
     55    PS_ASSERT_PTR_NON_NULL(file->fpa->chips, false);
     56
    5257    pmFPA *fpa = file->fpa;
    5358
     
    6166    }
    6267    pmChip *chip = fpa->chips->data[view->chip];
     68    PS_ASSERT_PTR_NON_NULL(chip, false);
     69    PS_ASSERT_PTR_NON_NULL(chip->cells, false);
    6370
    6471    if (view->cell == -1) {
     
    7582
    7683bool pmPSFmodelCheckDataStatusForFPA (const pmFPA *fpa) {
     84
     85    PS_ASSERT_PTR_NON_NULL(fpa, false);
     86    PS_ASSERT_PTR_NON_NULL(fpa->chips, false);
    7787
    7888    for (int i = 0; i < fpa->chips->n; i++) {
     
    8595
    8696bool pmPSFmodelCheckDataStatusForChip (const pmChip *chip) {
     97    PS_ASSERT_PTR_NON_NULL(chip, false);
    8798
    8899    bool status;
     
    95106bool pmPSFmodelWriteForView (const pmFPAview *view, pmFPAfile *file, const pmConfig *config)
    96107{
     108    PS_ASSERT_PTR_NON_NULL(view, false);
     109    PS_ASSERT_PTR_NON_NULL(file, false);
     110    PS_ASSERT_PTR_NON_NULL(file->fpa, false);
     111    PS_ASSERT_PTR_NON_NULL(file->fpa->chips, false);
    97112
    98113    pmFPA *fpa = file->fpa;
     
    126141bool pmPSFmodelWriteFPA (pmFPA *fpa, const pmFPAview *view, pmFPAfile *file, const pmConfig *config)
    127142{
     143    PS_ASSERT_PTR_NON_NULL(view, false);
     144    PS_ASSERT_PTR_NON_NULL(fpa, false);
     145    PS_ASSERT_PTR_NON_NULL(fpa->chips, false);
    128146    pmFPAview *thisView = pmFPAviewAlloc (view->nRows);
    129147    *thisView = *view;
     
    145163bool pmPSFmodelWriteChip (pmChip *chip, const pmFPAview *view, pmFPAfile *file, const pmConfig *config)
    146164{
     165    PS_ASSERT_PTR_NON_NULL(view, false);
     166    PS_ASSERT_PTR_NON_NULL(chip, false);
     167
    147168    if (!pmPSFmodelWrite (chip->analysis, view, file, config)) {
    148169        psError(PS_ERR_IO, false, "Failed to write PSF for chip");
     
    162183bool pmPSFmodelWrite (psMetadata *analysis, const pmFPAview *view, pmFPAfile *file, const pmConfig *config)
    163184{
     185    PS_ASSERT_PTR_NON_NULL(view, false);
     186    PS_ASSERT_PTR_NON_NULL(file, false);
     187    PS_ASSERT_PTR_NON_NULL(file->fpa, false);
    164188    bool status;
    165189    pmHDU *hdu;
     
    450474
    451475// if this file needs to have a PHU written out, write one
    452 bool pmPSFmodelWritePHU (const pmFPAview *view, pmFPAfile *file, const pmConfig *config) {
    453 
     476bool pmPSFmodelWritePHU (const pmFPAview *view, pmFPAfile *file, const pmConfig *config)
     477{
     478    PS_ASSERT_PTR_NON_NULL(view, false);
     479    PS_ASSERT_PTR_NON_NULL(file, false);
     480    PS_ASSERT_PTR_NON_NULL(file->fpa, false);
    454481    // not needed if already written
    455482    if (file->wrote_phu) return true;
     
    494521bool pmPSFmodelReadForView (const pmFPAview *view, pmFPAfile *file, const pmConfig *config)
    495522{
     523    PS_ASSERT_PTR_NON_NULL(view, false);
     524    PS_ASSERT_PTR_NON_NULL(file, false);
     525    PS_ASSERT_PTR_NON_NULL(file->fpa, false);
    496526
    497527    pmFPA *fpa = file->fpa;
     
    517547bool pmPSFmodelReadFPA (pmFPA *fpa, const pmFPAview *view, pmFPAfile *file, const pmConfig *config)
    518548{
     549    PS_ASSERT_PTR_NON_NULL(view, false);
     550    PS_ASSERT_PTR_NON_NULL(file, false);
     551    PS_ASSERT_PTR_NON_NULL(file->fpa, false);
     552
    519553    bool success = true;                // Was everything successful?
    520554    for (int i = 0; i < fpa->chips->n; i++) {
     
    528562bool pmPSFmodelReadChip (pmChip *chip, const pmFPAview *view, pmFPAfile *file, const pmConfig *config)
    529563{
     564    PS_ASSERT_PTR_NON_NULL(view, false);
     565    PS_ASSERT_PTR_NON_NULL(file, false);
     566    PS_ASSERT_PTR_NON_NULL(file->fpa, false);
     567
    530568    if (!pmPSFmodelRead (chip->analysis, view, file, config)) {
    531569        psError(PS_ERR_IO, false, "Failed to write PSF for chip");
     
    539577bool pmPSFmodelRead (psMetadata *analysis, const pmFPAview *view, pmFPAfile *file, const pmConfig *config)
    540578{
     579    PS_ASSERT_PTR_NON_NULL(view, false);
     580    PS_ASSERT_PTR_NON_NULL(file, false);
     581    PS_ASSERT_PTR_NON_NULL(file->fpa, false);
     582
    541583    bool status;
    542584    char *rule = NULL;
     
    763805}
    764806
    765 // create a psMetadata representation (human-readable) of a psf model
    766807// XXX pmPSF to/from Metadata functions were defined for 1.22 and earlier, but were dropped
Note: See TracChangeset for help on using the changeset viewer.