IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 6559


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

fixed pmFPAview,file so they compile

Location:
branches/rel10_ifa/psModules/src/astrom
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • branches/rel10_ifa/psModules/src/astrom/pmFPAfile.h

    r6546 r6559  
     1/** @file  pmFPAview.h
     2*
     3*  @brief Tools to manipulate the FPA structure elements.
     4*
     5*  @ingroup AstroImage
     6*
     7*  @author EAM, IfA
     8*
     9*  @version $Revision: 1.1.2.3 $ $Name: not supported by cvs2svn $
     10*  @date $Date: 2006-03-09 03:24:49 $
     11*
     12*  Copyright 2004-2005 Institute for Astronomy, University of Hawaii
     13*/
     14
     15#ifndef PM_FPA_FILE_H
     16#define PM_FPA_FILE_H
    117
    218typedef enum {
    3     PM_FPA_FILE_IMAGE;
    4     PM_FPA_FILE_SX;
    5     PM_FPA_FILE_OBJ;
    6     PM_FPA_FILE_CMP;
    7     PM_FPA_FILE_CMF;
    8     PM_FPA_FILE_RAW;
     19    PM_FPA_FILE_IMAGE,
     20    PM_FPA_FILE_SX,
     21    PM_FPA_FILE_OBJ,
     22    PM_FPA_FILE_CMP,
     23    PM_FPA_FILE_CMF,
     24    PM_FPA_FILE_RAW,
    925} pmFPAfileType;
    1026
     
    3046
    3147pmFPAfile *pmFPAfileAlloc ();
    32 pmFile *pmFPAfileDefine (pmFPAview *view, psMetadata *camera, char *name);
     48pmFPAfile *pmFPAfileDefine (pmFPAview *view, psMetadata *camera, char *name);
    3349bool pmFPAfileOpen (pmFPAfile *file, pmFPAview *view, psMetadata *camera);
    3450bool pmFPAfileRead (pmFPAfile *file, pmFPAview *view, psMetadata *camera);
     
    3652bool pmFPAfileIOCheck (pmFPAview *view, psMetadata *camera);
    3753bool pmFPAviewReadFitsImage (pmFPAview *view, psFits *fits);
     54
     55# endif
  • 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;
  • branches/rel10_ifa/psModules/src/astrom/pmFPAview.h

    r6521 r6559  
    77*  @author EAM, IfA
    88*
    9 *  @version $Revision: 1.1.2.1 $ $Name: not supported by cvs2svn $
    10 *  @date $Date: 2006-03-05 23:34:35 $
     9*  @version $Revision: 1.1.2.2 $ $Name: not supported by cvs2svn $
     10*  @date $Date: 2006-03-09 03:24:49 $
    1111*
    1212*  Copyright 2004-2005 Institute for Astronomy, University of Hawaii
     
    1515#ifndef PM_FPA_VIEW_H
    1616#define PM_FPA_VIEW_H
    17 #if HAVE_CONFIG_H
    18 #include <config.h>
    19 #endif
    20 #include "pslib.h"
    21 #include "pmFPA.h"
    2217
    2318/// @addtogroup AstroImage
     
    3631{
    3732    pmFPA *fpa;
    38     psMetadata IO;
    39     psMetadata camera;
     33    psMetadata *IO;
     34    psMetadata *camera;
    4035    int chip;
    4136    int cell;
     
    6863
    6964// advance view to the next readout
    70 pmCell *pmFPAviewNextReadout (pmFPAview *view, int nStep);
     65pmReadout *pmFPAviewNextReadout (pmFPAview *view, int nStep);
    7166
    7267// return the HDU corresponding to the current view
     
    7873// read an image into the current view
    7974bool pmFPAviewReadFitsImage (pmFPAview *view, psFits *fits);
     75
     76# endif
Note: See TracChangeset for help on using the changeset viewer.