IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Mar 8, 2006, 5:24:49 PM (20 years ago)
Author:
magnier
Message:

fixed pmFPAview,file so they compile

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/rel10_ifa/psModules/src/astrom/pmFPAview.c

    r6521 r6559  
    1 # include "pmFPAview.h"
    2 
    3 static void pmPFAviewFree (pmFPAview *view)
     1/** @file  pmFPAview.c
     2 *
     3 *  @author EAM, IfA
     4 *
     5 *  @version $Revision: 1.1.2.2 $ $Name: not supported by cvs2svn $
     6 *  @date $Date: 2006-03-09 03:24:49 $
     7 *
     8 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     9 *
     10 */
     11
     12#include <stdio.h>
     13#include <math.h>
     14#include <string.h>
     15#include "pslib.h"
     16#include "pmHDU.h"
     17#include "pmFPA.h"
     18#include "pmFPAview.h"
     19#include "pmFPARead.h"
     20#include "pmFPAWrite.h"
     21
     22bool pmChipRead(pmChip *fpa,              // FPA to read into
     23                psFits *fits,            // FITS file from which to read
     24                psMetadata *phu,         // Primary header
     25                psDB *db                 // Database handle, for concept ingest
     26               );
     27
     28bool pmCellRead(pmCell *fpa,              // FPA to read into
     29                psFits *fits,            // FITS file from which to read
     30                psMetadata *phu,         // Primary header
     31                psDB *db                 // Database handle, for concept ingest
     32               );
     33
     34bool pmReadoutRead(pmReadout *fpa,              // FPA to read into
     35                   psFits *fits,            // FITS file from which to read
     36                   psMetadata *phu,         // Primary header
     37                   psDB *db                 // Database handle, for concept ingest
     38                  );
     39
     40bool pmReadoutReadSegment(pmReadout *fpa,              // FPA to read into
     41                          psFits *fits,            // FITS file from which to read
     42                          int n, int i,
     43                          psMetadata *phu,         // Primary header
     44                          psDB *db);
     45
     46static void pmFPAviewFree (pmFPAview *view)
    447{
    548
     
    1558
    1659    pmFPAview *view = psAlloc (sizeof(pmFPAview));
     60    psMemSetDeallocator (view, (psFreeFunc) pmFPAviewFree);
    1761
    1862    view->fpa     = fpa;
     
    167211}
    168212
    169 pmCell *pmFPAviewNextReadout (pmFPAview *view, int nStep)
     213pmReadout *pmFPAviewNextReadout (pmFPAview *view, int nStep)
    170214{
    171215
     
    178222
    179223    // if there are no available cells, return NULL
    180     if (view->fpa->readouts->n <= 0) {
    181         view->readouts = -1;
     224    if (cell->readouts->n <= 0) {
     225        view->readout = -1;
    182226        return NULL;
    183227    }
     
    210254
    211255    if (view->chip < 0) {
    212         return pmHDUfromFPA (view->fpa);
     256        return pmHDUFromFPA (view->fpa);
    213257    }
    214258    if (view->cell < 0) {
    215         return pmHDUfromChip (pmFPAviewThisChip (view));
     259        return pmHDUFromChip (pmFPAviewThisChip (view));
    216260    }
    217261    if (view->readout < 0) {
    218         return pmHDUfromCell (pmFPAviewThisCell (view));
     262        return pmHDUFromCell (pmFPAviewThisCell (view));
    219263    }
    220264    return NULL;
     
    225269{
    226270
    227     char *name;
    228271    char *newName = NULL;     // destination for resulting name
    229272
     
    249292    }
    250293    if (strstr (newName, "{EXTNAME}") != NULL) {
    251         pmCell *cell = pmFPAviewThisCell (view);
    252         char *name = psMetadataLookupStr (NULL, header, "EXTNAME");
    253         if (name != NULL) {
    254             newName = psStringSubstitute (newName, name, "{EXTNAME}");
     294        pmHDU *hdu = pmFPAviewThisHDU (view);
     295        if (hdu->extname != NULL) {
     296            newName = psStringSubstitute (newName, hdu->extname, "{EXTNAME}");
    255297        }
    256298    }
     
    266308
    267309    if (view->chip == -1) {
    268         pmFPARead (fpa, fits, phu, database);
     310        pmFPARead (fpa, fits, NULL, NULL);
    269311        return true;
    270312    }
     
    276318
    277319    if (view->cell == -1) {
    278         pmChipRead (chip, fits, phu, database);
     320        pmChipRead (chip, fits, NULL, NULL);
    279321        return true;
    280322    }
     
    286328
    287329    if (view->readout == -1) {
    288         pmCellRead (cell, fits, phu, database);
     330        pmCellRead (cell, fits, NULL, NULL);
    289331        return true;
    290332    }
     
    296338
    297339    if (view->nRows == 0) {
    298         pmReadoutRead (readout, fits, phu, database);
     340        pmReadoutRead (readout, fits, NULL, NULL);
    299341    } else {
    300         pmReadoutReadSegment (readout, fits, view->nRows, view->iRows, phu, database);
     342        pmReadoutReadSegment (readout, fits, view->nRows, view->iRows, NULL, NULL);
    301343    }
    302344    return true;
Note: See TracChangeset for help on using the changeset viewer.