IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Feb 2, 2009, 8:05:38 AM (17 years ago)
Author:
Paul Price
Message:

Adding work on integrating covariances into the read/write system. Not sure I like this framework (putting covariances for an HDU into a common table); might rework to write a covariance image for each cell. I think I started doing that and ran into problems, but I can't remember what they were and how they stopped me.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/pap_branch_20090128/psModules/src/camera/pmFPAWrite.c

    r21211 r21264  
    2929    FPA_WRITE_TYPE_IMAGE,               // Write image
    3030    FPA_WRITE_TYPE_MASK,                // Write mask
    31     FPA_WRITE_TYPE_VARIANCE               // Write variance map
     31    FPA_WRITE_TYPE_VARIANCE             // Write variance map
    3232} fpaWriteType;
    3333
     
    7474}
    7575
     76
     77
     78
     79// Some type-specific additions to the header
     80static bool writeUpdateHeader(pmFPA *fpa, // FPA of interest
     81                              pmChip *chip, // Chip of interest, or NULL
     82                              pmCell *cell, // Cell of interest, or NULL
     83                              fpaWriteType type // Type to write
     84    )
     85{
     86    switch (type) {
     87      case FPA_WRITE_TYPE_MASK: {
     88          pmHDU *phu = pmHDUGetHighest(fpa, chip, cell); // Primary header
     89          if (!pmConfigMaskWriteHeader(config, phu->header)) {
     90              psError(PS_ERR_UNKNOWN, false, "Unable to set the mask names in the PHU header");
     91              return false;
     92          }
     93          break;
     94      }
     95      case FPA_WRITE_TYPE_VARIANCE: {
     96          pmHDU *hdu = pmHDUGetLowest(fpa, chip, cell); // Header being written
     97
     98
     99
    76100// Write a cell image/mask/variance
    77101static bool cellWrite(pmCell *cell,     // Cell to write
     
    97121    // generate the HDU, but only copies the structure.
    98122    if (!blank && !hdu->blankPHU && !*imageArray && (!pmHDUGenerateForCell(cell) || !*imageArray)) {
    99         psError(PS_ERR_UNKNOWN, false, "Unable to generate HDU for cell --- likely programming error.\n");
     123        psError(PS_ERR_UNKNOWN, false, "Unable to generate HDU for cell --- likely programming error.");
    100124        return false;
    101125    }
     
    106130
    107131    if (writeBlank || writeImage) {
    108 
    109132        pmFPAUpdateNames(cell->parent->parent, cell->parent, cell);
    110133        pmConceptSource source = PM_CONCEPT_SOURCE_HEADER | PM_CONCEPT_SOURCE_CELLS |
    111134                                 PM_CONCEPT_SOURCE_DEFAULTS | PM_CONCEPT_SOURCE_DATABASE;
    112135        if (!pmConceptsWriteCell(cell, source, true, config)) {
    113             psError(PS_ERR_IO, false, "Unable to write concepts for cell.\n");
     136            psError(PS_ERR_IO, false, "Unable to write concepts for cell.");
    114137            return false;
    115138        }
     139
     140
    116141        if (!appropriateWriteFunc(hdu, fits, config, type)) {
    117142            psError(PS_ERR_IO, false, "Unable to write HDU for cell.\n");
Note: See TracChangeset for help on using the changeset viewer.