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/pmFPARead.c

    r6520 r6552  
    1212//////////////////////////////////////////////////////////////////////////////////////////////////////////////
    1313
    14 
     14#if 0
    1515// Read a FITS extension into a chip
    1616static bool readExtension(p_pmHDU *hdu, // Pixel data into which to read
     
    135135    return true;
    136136}
    137 
    138 //////////////////////////////////////////////////////////////////////////////////////////////////////////////
    139 // Public functions
    140 //////////////////////////////////////////////////////////////////////////////////////////////////////////////
    141 
    142 
    143 bool pmReadoutRead(pmReadout *readout,  // Readout to read into
    144                    psFits *fits         // FITS file from which to read
    145                   )
    146 {
    147     //
    148 
    149 }
     137#endif
     138
    150139
    151140// Carve a readout from the image pixels
     
    162151
    163152    // Get the list of overscans
    164     psListIterator *iter = psListIteratorAlloc(biassecs, PS_LIST_HEAD, false); // Iterator
     153    psListIterator *iter = psListIteratorAlloc((psList*)biassecs, PS_LIST_HEAD, false); // Iterator
    165154    psRegion *biassec = NULL;       // A BIASSEC region from the list
    166155    while ((biassec = psListGetAndIncrement(iter))) {
     
    174163}
    175164
    176 
     165//////////////////////////////////////////////////////////////////////////////////////////////////////////////
     166// Public functions
     167//////////////////////////////////////////////////////////////////////////////////////////////////////////////
     168
     169
     170#if 0
     171bool pmReadoutRead(pmReadout *readout,  // Readout to read into
     172                   psFits *fits         // FITS file from which to read
     173                  )
     174{
     175    // This is very very different
     176}
     177#endif
     178
     179// Read in the cell, and allocate the readouts
    177180bool pmCellRead(pmCell *cell,           // Cell to read into
    178181                psFits *fits,           // FITS file from which to read
     
    185188        return false;
    186189    }
    187 
    188     // Read the "concepts"
    189     pmConceptsReadCell(cell, db);
    190190
    191191    // Having read the cell, we now have to cut it up
     
    205205}
    206206
    207 
     207// Read in the component cells
    208208bool pmChipRead(pmChip *chip,           // Chip to read into
    209209                psFits *fits,           // FITS file from which to read
     
    223223}
    224224
     225// Read in the component chips
    225226bool pmFPARead(pmFPA *fpa,              // FPA to read into
    226227               psFits *fits,            // FITS file from which to read
     
    228229              )
    229230{
    230     psArray *chips = fpa->cells;       // Array of cells
     231    psArray *chips = fpa->chips;       // Array of chips
    231232    for (int i = 0; i < chips->n; i++) {
    232         pmCell *chip = chips->data[i];  // The cell of interest
     233        pmChip *chip = chips->data[i];  // The cell of interest
    233234        if (!pmChipRead(chip, fits, db)) {
    234235            psError(PS_ERR_IO, false, "Unable to read chip %d.\n", i);
     
    239240    return true;
    240241}
     242
     243// Read the PHU into the nominated HDU
     244static bool readPHU(pmHDU *hdu,         // HDU to read into
     245                    psFits *fits        // FITS file from which to read
     246                   )
     247{
     248    if (! hdu || ! hdu->phu) {
     249        return false;                   // Nothing to see here, move along
     250    }
     251    if (hdu->header) {
     252        return true;                    // Already something to see here, no need to gawk at it...  (;
     253    }
     254    // Read the PHU
     255    psFitsMoveExtNum(fits, 0, false);
     256    hdu->header = psFitsReadHeader(hdu->header, fits);
     257    return true;
     258}
     259
     260// Read the PHU into a cell
     261bool pmCellReadPHU(pmCell *cell,        // Cell to read into
     262                   psFits *fits         // FITS file from which to read
     263                  )
     264{
     265    return readPHU(cell->hdu, fits) || readPHU(cell->parent->hdu, fits) ||
     266           readPHU(cell->parent->parent->hdu, fits);
     267
     268}
     269
     270// Read the PHU into a chip
     271bool pmChipReadPHU(pmChip *chip,        // Chip to read into
     272                   psFits *fits         // FITS file from which to read
     273                  )
     274{
     275    return readPHU(chip->hdu, fits) || readPHU(chip->parent->hdu, fits);
     276}
     277
     278// Read the PHU into an FPA
     279bool pmFPAReadPHU(pmFPA *fpa,           // FPA to read into
     280                  psFits *fits          // FITS file from which to read
     281                 )
     282{
     283    return readPHU(fpa->hdu, fits);
     284}
     285
     286
     287
    241288
    242289#if 0
Note: See TracChangeset for help on using the changeset viewer.