IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 26475


Ignore:
Timestamp:
Dec 22, 2009, 10:01:06 AM (16 years ago)
Author:
eugene
Message:

fixing bugs related to stacking PR images

Location:
branches/eam_branches/20091201/ppStack
Files:
11 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/20091201/ppStack

  • branches/eam_branches/20091201/ppStack/src/ppStackCombineInitial.c

    r26076 r26475  
    2020    if (!options->convolve) {
    2121        // No need to do initial combination when we haven't convolved
     22        // XXX either allocate inspect and rejected here, or do not require them downstream
    2223        return true;
    2324    }
  • branches/eam_branches/20091201/ppStack/src/ppStackConvolve.c

    r26161 r26475  
    5959        pmFPAfileActivate(config->files, false, NULL);
    6060        ppStackFileActivationSingle(config, PPSTACK_FILES_CONVOLVE, true, i);
     61        if (options->convolve) {
     62            // XXX PPSTACK.CONV.KERNEL not defined unless convolve
     63            // pmFPAfileActivate(config->files, true, "PPSTACK.CONV.KERNEL");
     64            pmFPAfileActivateSingle(config->files, true, "PPSTACK.CONV.KERNEL", i); // Activated file
     65        }
     66
    6167        pmFPAfile *file = pmFPAfileSelectSingle(config->files, "PPSTACK.INPUT", i); // File of interest
    6268        pmFPAview *view = ppStackFilesIterateDown(config);
  • branches/eam_branches/20091201/ppStack/src/ppStackFiles.c

    r26104 r26475  
    1717
    1818/// Files required for the convolution
    19 static char *filesConvolve[] = { "PPSTACK.INPUT", "PPSTACK.INPUT.MASK", "PPSTACK.INPUT.VARIANCE",
    20                                  "PPSTACK.CONV.KERNEL", NULL };
     19static char *filesConvolve[] = { "PPSTACK.INPUT", "PPSTACK.INPUT.MASK", "PPSTACK.INPUT.VARIANCE", NULL };
     20
     21//                                 "PPSTACK.CONV.KERNEL", NULL };
    2122
    2223/// Output files for the combination
  • branches/eam_branches/20091201/ppStack/src/ppStackMatch.c

    r26218 r26475  
    344344                                                       footprint); // Filtered list of sources
    345345
     346            bool oldThreads = pmReadoutFakeThreads(true); // Old threading state
    346347            if (!pmReadoutFakeFromSources(fake, readout->image->numCols, readout->image->numRows,
    347348                                          stampSources, SOURCE_MASK, NULL, NULL, options->psf,
     
    353354                return false;
    354355            }
     356            pmReadoutFakeThreads(oldThreads);
    355357
    356358            fake->mask = psImageCopy(NULL, readout->mask, PS_TYPE_IMAGE_MASK);
  • branches/eam_branches/20091201/ppStack/src/ppStackOptions.c

    r26076 r26475  
    4242
    4343    options->convolve = true;
     44    options->matchZPs = true;
    4445    options->stats = NULL;
    4546    options->statsFile = NULL;
  • branches/eam_branches/20091201/ppStack/src/ppStackOptions.h

    r26076 r26475  
    99    // Setup
    1010    bool convolve;                      // Convolve images?
     11    bool matchZPs;                      // Adjust relative fluxes based on transparency analysis?
    1112    psMetadata *stats;                  // Statistics for output
    1213    FILE *statsFile;                    // File to which to write statistics
  • branches/eam_branches/20091201/ppStack/src/ppStackPrepare.c

    r23573 r26475  
    176176
    177177
    178         pmReadout *ro = pmFPAviewThisReadout(view, inputFile->fpa); // Readout with sources
    179         psArray *sources = psMetadataLookupPtr(NULL, ro->analysis, "PSPHOT.SOURCES"); // Sources
    180         if (!sources) {
    181             psError(PS_ERR_UNEXPECTED_NULL, false, "Unable to find sources in readout.");
    182             return NULL;
    183         }
    184         options->sourceLists->data[index] = psMemIncrRefCounter(sources);
     178        bool redoPhot = psMetadataLookupBool(NULL, recipe, "PHOT");
     179        psArray *sources = NULL;
     180
     181        if (options->convolve || options->matchZPs || redoPhot) {
     182            pmReadout *ro = pmFPAviewThisReadout(view, inputFile->fpa); // Readout with sources
     183            sources = psMetadataLookupPtr(NULL, ro->analysis, "PSPHOT.SOURCES"); // Sources
     184            if (!sources) {
     185                psError(PS_ERR_UNEXPECTED_NULL, false, "Unable to find sources in readout.");
     186                return NULL;
     187            }
     188            options->sourceLists->data[index] = psMemIncrRefCounter(sources);
     189        }
    185190
    186191        // Re-do photometry if we don't trust the source lists
    187         if (psMetadataLookupBool(NULL, recipe, "PHOT")) {
     192        if (redoPhot) {
    188193            psTrace("ppStack", 2, "Photometering input %d of %d....\n", index, num);
    189194            pmFPAfileActivate(config->files, false, NULL);
    190195            ppStackFileActivationSingle(config, PPSTACK_FILES_CONVOLVE, true, index);
     196            if (options->convolve) {
     197                pmFPAfileActivate(config->files, true, "PPSTACK.CONV.KERNEL");
     198            }
    191199            pmFPAfile *file = pmFPAfileSelectSingle(config->files, "PPSTACK.INPUT", index); // File
    192200            pmFPAview *photView = ppStackFilesIterateDown(config);
  • branches/eam_branches/20091201/ppStack/src/ppStackReadout.c

    r26076 r26475  
    272272
    273273    if (!pmStackCombine(outRO, stack, maskVal | maskBad, maskSuspect, maskBad, 0, iter, combineRej,
    274                         combineSys, combineDiscard, useVariance, safe, true)) {
     274                        combineSys, combineDiscard, useVariance, safe, rejected)) {
    275275        psError(PS_ERR_UNKNOWN, false, "Unable to combine input readouts.");
    276276        psFree(stack);
  • branches/eam_branches/20091201/ppStack/src/ppStackSetup.c

    r26078 r26475  
    2121    psMetadata *recipe = psMetadataLookupMetadata(NULL, config->recipes, PPSTACK_RECIPE); // ppStack recipe
    2222    psAssert(recipe, "We've thrown an error on this before.");
     23
     24    options->matchZPs = psMetadataLookupBool(NULL, recipe, "MATCH.ZERO.POINTS"); // Adjust zero points based on tranparency analysis?
    2325
    2426    options->convolve = psMetadataLookupBool(NULL, recipe, "CONVOLVE"); // Convolve images?
  • branches/eam_branches/20091201/ppStack/src/ppStackSources.c

    r26076 r26475  
    6161    PS_ASSERT_PTR_NON_NULL(config, false);
    6262
     63    if (!options->matchZPs) {
     64        int num = psMetadataLookupS32(NULL, config->arguments, "INPUTS.NUM"); // Number of inputs
     65        options->norm = psVectorAlloc(num, PS_TYPE_F32);
     66        psVectorInit (options->norm, 0.0);
     67
     68        // XXX do I need to set this?
     69        // options->sumExposure = sumExpTime;
     70
     71        return true;
     72    }
     73
    6374    psArray *sourceLists = options->sourceLists; // Source lists for each input
    6475    psVector *inputMask = options->inputMask; // Mask for inputs
Note: See TracChangeset for help on using the changeset viewer.