IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Mar 21, 2006, 1:52:54 PM (20 years ago)
Author:
Paul Price
Message:

Now works with GPC1 dummy OTA FITS file from Sidik; some other changes to organise things.

File:
1 edited

Legend:

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

    r6552 r6663  
    44
    55#include "pmFPA.h"
    6 #include "pmFPARead.h"
     6#include "pmHDU.h"
    77#include "pmConcepts.h"
    88
     9
     10bool pmCellWrite(pmCell *cell,          // Cell to write
     11                 psFits *fits,          // FITS file to which to write
     12                 psDB *db               // Database handle for "concepts" update
     13                )
     14{
     15    pmConceptsWriteCell(cell, PM_CONCEPT_SOURCE_HEADER, false, NULL);
     16
     17    pmHDU *hdu = cell->hdu;             // The HDU
     18    if (hdu && !pmHDUWrite(hdu, fits)) {
     19        psError(PS_ERR_IO, false, "Unable to write HDU for Chip.\n");
     20        return false;
     21    }
     22
     23    return true;
     24}
     25
     26
     27bool pmChipWrite(pmChip *chip,          // Chip to write
     28                 psFits *fits,          // FITS file to which to write
     29                 psDB *db               // Database handle for "concepts" update
     30                )
     31{
     32    pmConceptsWriteChip(chip, PM_CONCEPT_SOURCE_HEADER, false, NULL);
     33
     34    pmHDU *hdu = chip->hdu;             // The HDU
     35    if (hdu && !pmHDUWrite(hdu, fits)) {
     36        psError(PS_ERR_IO, false, "Unable to write HDU for Chip.\n");
     37        return false;
     38    }
     39
     40    bool success = true;                // Success of writing
     41    psArray *cells = chip->cells;       // Array of cells
     42    for (int i = 0; i < cells->n; i++) {
     43        pmCell *cell = cells->data[i];  // The cell of interest
     44        success |= pmCellWrite(cell, fits, db);
     45    }
     46
     47    return success;
     48}
     49
     50
     51
     52
     53bool pmFPAWrite(pmFPA *fpa,             // FPA to write
     54                psFits *fits,           // FITS file to which to write
     55                psDB *db                // Database handle for "concepts" update
     56               )
     57{
     58    pmConceptsWriteFPA(fpa, PM_CONCEPT_SOURCE_HEADER, NULL);
     59
     60    pmHDU *hdu = fpa->hdu;              // The HDU
     61    if (hdu && !pmHDUWrite(hdu, fits)) {
     62        psError(PS_ERR_IO, false, "Unable to write HDU for FPA.\n");
     63        return false;
     64    }
     65
     66    bool success = true;                // Success of writing
     67    psArray *chips = fpa->chips;        // Array of chips
     68    for (int i = 0; i < chips->n; i++) {
     69        pmChip *chip = chips->data[i];  // The chip of interest
     70        success |= pmChipWrite(chip, fits, db);
     71    }
     72
     73    return success;
     74}
     75
     76
     77
     78
     79#if 0
    980static bool writeHDU(psFits *fits,      // FITS file to which to write
    1081                     pmHDU *hdu         // Pixel data to write
     
    258329    return true;
    259330}
     331#endif
Note: See TracChangeset for help on using the changeset viewer.