IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Nov 13, 2006, 12:33:20 PM (20 years ago)
Author:
Paul Price
Message:

Writing fringe data using new table functions.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ppMerge/src/ppMergeCombine.c

    r9907 r9954  
    7878#endif
    7979
     80#if 0
    8081// Write fringe extensions
    8182static void writeFringes(psMetadata *fringes, // Table of extensions with fringe statistics to write
     
    103104    return;
    104105}
    105 
     106#endif
    106107
    107108// Combine the inputs
     
    128129    // Iterate over the FPA
    129130    pmFPA *fpa = data->out;             // Output FPA
    130     psMetadata *fringeExtns = psMetadataAlloc(); // List of fringe extensions to write
    131131    pmFPAview *view = pmFPAviewAlloc(0);// View of FPA, for iteration
    132132    int cellNum = -1;                   // Cell number in the whole FPA
     
    319319                fringes->data[0] = fringe;
    320320
    321                 const char *chipName = psMetadataLookupStr(NULL, chip->concepts, "CHIP.NAME"); // Name of chip
    322                 const char *cellName = psMetadataLookupStr(NULL, cell->concepts, "CELL.NAME"); // Name of cell
    323                 psString extname = NULL;
    324                 psStringAppend(&extname, "FRINGE_%s_%s", chipName, cellName);
    325 
    326                 psMetadataAdd(fringeExtns, PS_LIST_TAIL, extname, PS_DATA_UNKNOWN,
    327                               "Fringe data to write", fringes);
    328                 psFree(fringes);
    329                 psFree(extname);
     321                pmFringesFormat(cell, NULL, fringes);
     322                psFree(fringes);        // Drop reference
    330323            }
    331324
     
    351344
    352345            // Write the pixels
    353             if (cell->hdu) {
     346            if (cell->hdu && !cell->hdu->blankPHU) {
    354347                psTrace("ppMerge", 5, "Writing out cell HDU.\n");
    355348                pmCellWrite(cell, data->outFile, config->database, false);
     349                if (options->fringe) {
     350                    pmCellWriteTable(data->outFile, cell, "FRINGE");
     351                }
     352
    356353                pmCellFreeData(cell);
    357 
    358                 if (options->fringe) {
    359                     writeFringes(fringeExtns, data->outFile);
    360                 }
    361354            }
    362355        }
     
    370363
    371364        // Write the pixels
    372         if (chip->hdu) {
     365        if (chip->hdu && !chip->hdu->blankPHU) {
    373366            psTrace("ppMerge", 5, "Writing out chip HDU.\n");
    374367            pmChipWrite(chip, data->outFile, config->database, false, false);
     368            if (options->fringe) {
     369                pmChipWriteTable(data->outFile, chip, "FRINGE");
     370            }
     371
    375372            pmChipFreeData(chip);
    376 
    377             if (options->fringe) {
    378                 writeFringes(fringeExtns, data->outFile);
    379             }
    380         }
    381     }
    382 
    383     if (data->out->hdu) {
    384         // Write the pixels
    385         psTrace("ppMerge", 5, "Writing out FPA HDU.\n");
    386         pmFPAWrite(data->out, data->outFile, config->database, false, false);
     373        }
    387374    }
    388375
     
    391378        pmFPA *fpaIn = data->in->data[i]; // Input FPA
    392379        pmFPAFreeData(fpaIn);
    393 
     380    }
     381
     382    if (data->out->hdu && !data->out->hdu->blankPHU) {
     383        // Write the pixels
     384        psTrace("ppMerge", 5, "Writing out FPA HDU.\n");
     385        pmFPAWrite(data->out, data->outFile, config->database, false, false);
    394386        if (options->fringe) {
    395             writeFringes(fringeExtns, data->outFile);
    396         }
    397     }
     387            pmFPAWriteTable(data->outFile, fpa, "FRINGE");
     388        }
     389    }
     390
    398391    pmFPAFreeData(data->out);
    399392
Note: See TracChangeset for help on using the changeset viewer.