IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Nov 2, 2006, 12:30:06 PM (20 years ago)
Author:
Paul Price
Message:

Adding fringe combination.

File:
1 edited

Legend:

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

    r9824 r9832  
    214214                            }
    215215                            numRead++;
     216                        } else {
     217                            psTrace("ppMerge", 3, "Unable to read from file %d for chip %d, "
     218                                    "cell %d, scan %d\n", i, view->chip, view->cell, numScan);
    216219                        }
    217220                    }
    218221
     222                    psTrace("ppMerge", 5, "Chip %d, cell %d, scan %d\n", view->chip, view->cell, numScan);
    219223                    if (numRead > 0) {
    220224                        pmReadoutCombine(readout, stack, cellZeros, cellScales, options->combine);
    221                         psTrace("ppMerge", 5, "Chip %d, cell %d, scan %d\n", view->chip, view->cell, numScan);
    222225                    }
    223226                    numScan++;
     
    259262            }
    260263
    261             psFree(readout);            // Drop reference
    262264            psFree(stack);
    263265
     
    270272            }
    271273
     274            // Measure the fringes for this cell
     275            //
     276            // XXX Need to deal with multiple components: we will do this by building up the components
     277            // Read the existing fringe measurements
     278            // Use existing regions to measure fringe statistics
     279            // Add the new fringe measurements to the existing fringe measurements.
     280            // Write the appended fringe measurements.
     281            // Read in the "output" file to get the existing components.
     282            // Put the new readout into the cell after the existing readouts.
     283            if (options->fringe && readout->image) {
     284                pmFringeRegions *regions = pmFringeRegionsAlloc(options->fringeNum, options->fringeSize,
     285                                                                options->fringeSize, options->fringeSmoothX,
     286                                                                options->fringeSmoothY); // Fringe regions
     287                pmFringeStats *fringe = pmFringeStatsMeasure(regions, readout, options->combine->maskVal);
     288                psFree(regions);
     289
     290                psArray *fringes = psArrayAlloc(1); // Array of fringes
     291                fringes->data[0] = fringe;
     292
     293                const char *chipName = psMetadataLookupStr(NULL, chip->concepts, "CHIP.NAME"); // Name of chip
     294                const char *cellName = psMetadataLookupStr(NULL, cell->concepts, "CELL.NAME"); // Name of cell
     295                psString extname = NULL;
     296                psStringAppend(&extname, "FRINGE_%s_%s", chipName, cellName);
     297
     298                if (!pmFringesWriteFits(data->outFile, NULL, fringes, extname)) {
     299                    psWarning("Unable to write fringe data to extension %s\n", extname);
     300                }
     301
     302                psFree(fringes);
     303                psFree(extname);
     304            }
     305
     306            psFree(readout);            // Drop reference
    272307
    273308            // Statistics on the merged cell
Note: See TracChangeset for help on using the changeset viewer.