IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Mar 8, 2006, 5:08:08 PM (20 years ago)
Author:
Paul Price
Message:

Broad changes to introduce pmHDU, and allow read/write at any level. Modified the camera configuration to use camera config (components of the camera) and format descriptions (FITS file layout).

File:
1 edited

Legend:

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

    r6448 r6552  
    1212* XXX: Should we implement non-linear cell->chip transforms?
    1313*
    14 *  @version $Revision: 1.1.4.1 $ $Name: not supported by cvs2svn $
    15 *  @date $Date: 2006-02-17 17:13:41 $
     14*  @version $Revision: 1.1.4.2 $ $Name: not supported by cvs2svn $
     15*  @date $Date: 2006-03-09 03:08:08 $
    1616*
    1717*  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    2626#include "pslib.h"
    2727
     28#include "pmHDU.h"
    2829#include "pmFPA.h"
    2930#include "pmConcepts.h"
     
    9798        #endif
    9899
    99         psFree(cell->toChip);
    100         psFree(cell->toFPA);
    101         psFree(cell->toSky);
    102100        psFree(cell->concepts);
    103101        psFree(cell->analysis);
    104         psFree(cell->camera);
     102        psFree(cell->config);
    105103        psFree(cell->hdu);
    106104    }
     
    135133        #endif
    136134
     135        #if 0
     136
    137137        psFree(chip->toFPA);
    138138        psFree(chip->fromFPA);
     139        #endif
     140
    139141        psFree(chip->concepts);
    140142        psFree(chip->analysis);
     
    148150    if (fpa != NULL) {
    149151        psTrace(__func__, 9, "Freeing fpa %lx\n", (size_t)fpa);
     152        #if 0
     153
    150154        psFree(fpa->fromTangentPlane);
    151155        psFree(fpa->toTangentPlane);
    152156        psFree(fpa->projection);
     157        #endif
     158
    153159        psFree(fpa->concepts);
    154160        psFree(fpa->analysis);
     
    172178        psFree(fpa->chips);
    173179        psFree(fpa->hdu);
    174         psFree(fpa->phu);
    175180    }
    176181}
     
    230235
    231236
    232 
    233 void p_pmHDUFree(p_pmHDU *hdu)
    234 {
    235     if (hdu) {
    236         psFree(hdu->extname);
    237         psFree(hdu->header);
    238         psFree(hdu->images);
    239         psFree(hdu->masks);
    240         psFree(hdu->weights);
    241     }
    242 }
    243 
    244 // XXX: Verify these default values for row0, col0, rowBins, colBins
    245 // PAP: These values may disappear in the future in favour of values in parent->concepts?
    246237pmReadout *pmReadoutAlloc(pmCell *cell)
    247238{
    248239    pmReadout *tmpReadout = (pmReadout *) psAlloc(sizeof(pmReadout));
    249240
    250     tmpReadout->col0 = 0;
    251     tmpReadout->row0 = 0;
    252     tmpReadout->colBins = 0;
    253     tmpReadout->rowBins = 0;
    254241    tmpReadout->image = NULL;
    255242    tmpReadout->mask = NULL;
     
    276263pmCell *pmCellAlloc(
    277264    pmChip *chip,
    278     psMetadata *cameraData,
    279265    const char *name)
    280266{
    281267    pmCell *tmpCell = (pmCell *) psAlloc(sizeof(pmCell));
    282268
    283     tmpCell->col0 = 0;
    284     tmpCell->row0 = 0;
    285     tmpCell->toChip = NULL;
    286     tmpCell->toFPA = NULL;
    287     tmpCell->toSky = NULL;
    288269    tmpCell->concepts = psMetadataAlloc();
    289270    psBool rc = psMetadataAddStr(tmpCell->concepts, PS_LIST_HEAD, "CELL.NAME", 0, NULL, name);
     
    291272        psLogMsg(__func__, PS_LOG_WARN, "WARNING: Could not add CELL.NAME to metadata.\n");
    292273    }
    293     tmpCell->camera = psMemIncrRefCounter(cameraData);
     274    tmpCell->config = NULL;
    294275    tmpCell->analysis = psMetadataAlloc();
    295276    tmpCell->readouts = psArrayAlloc(0);
     
    323304    pmChip *tmpChip = (pmChip *) psAlloc(sizeof(pmChip));
    324305
     306    #if 0
     307
    325308    tmpChip->col0 = 0;
    326309    tmpChip->row0 = 0;
    327310    tmpChip->toFPA = NULL;
    328311    tmpChip->fromFPA = NULL;
     312    #endif
     313
    329314    tmpChip->concepts = psMetadataAlloc();
    330315    psBool rc = psMetadataAddStr(tmpChip->concepts, PS_LIST_HEAD, "CHIP.NAME", 0, NULL, name);
     
    359344    pmFPA *tmpFPA = (pmFPA *) psAlloc(sizeof(pmFPA));
    360345
     346    #if 0
     347
    361348    tmpFPA->fromTangentPlane = NULL;
    362349    tmpFPA->toTangentPlane = NULL;
    363350    tmpFPA->projection = NULL;
     351    #endif
     352
    364353    tmpFPA->concepts = psMetadataAlloc();
    365354    tmpFPA->analysis = NULL;
     
    367356    tmpFPA->chips = psArrayAlloc(0);
    368357    tmpFPA->hdu = NULL;
    369     tmpFPA->phu = NULL;
    370358
    371359    pmConceptsBlankFPA(tmpFPA);
     
    375363}
    376364
    377 p_pmHDU *p_pmHDUAlloc(const char *extname)
    378 {
    379     p_pmHDU *hdu = psAlloc(sizeof(p_pmHDU));
    380     psMemSetDeallocator(hdu, (psFreeFunc)p_pmHDUFree);
    381 
    382     hdu->extname = psStringCopy(extname);
    383     hdu->header = NULL;
    384     hdu->images = NULL;
    385     hdu->masks = NULL;
    386     hdu->weights = NULL;
     365pmHDU *pmHDUFromFPA(pmFPA *fpa          // FPA for which to find HDU
     366                   )
     367{
     368    return fpa->hdu;
     369}
     370
     371pmHDU *pmHDUFromChip(pmChip *chip       // Chip for which to find HDU
     372                    )
     373{
     374    pmHDU *hdu = chip->hdu;             // The HDU information
     375    if (!hdu) {
     376        hdu = pmHDUFromFPA(chip->parent); // Grab HDU info from the FPA
     377    }
     378
     379    return hdu;
     380}
     381
     382pmHDU *pmHDUFromCell(pmCell *cell       // Cell for which to find HDU
     383                    )
     384{
     385    pmHDU *hdu = cell->hdu;             // The HDU information
     386    if (!hdu) {
     387        hdu = pmHDUFromChip(cell->parent); // Grab HDU info from the chip
     388    }
    387389
    388390    return hdu;
     
    599601}
    600602
    601 
     603#if 0
    602604bool pmCellSetWeights(pmCell *cell // Cell for which to set weights
    603605                     )
     
    609611    float bad = psMetadataLookupF32(NULL, cell->concepts, "CELL.BAD"); // Bad level
    610612
    611     p_pmHDU *hdu = cell->hdu;           // The data unit, containing the weight and mask originals
     613    pmHDU *hdu = cell->hdu;             // The data unit, containing the weight and mask originals
    612614    if (!hdu) {
    613615        pmChip *chip = cell->parent;    // The parent chip
     
    682684}
    683685
    684 
     686#endif
Note: See TracChangeset for help on using the changeset viewer.