IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 26454


Ignore:
Timestamp:
Dec 17, 2009, 9:43:45 AM (16 years ago)
Author:
eugene
Message:

The new code which generates unconvolved and convolved stacks broke
the ability to run PR-style images without convolutions AND without
input psf models from pswarp. The zero point matching code also
requires input sources, and it had become mandatory. To fix this, I
have made the following modifications:

1) add an option to avoid matching zero points (MATCH.ZERO.POINTS)

2) do not activate the pmFPAfile PPSTACK.CONv.KERNEL unless
CONVOLVE is true

3) do not attempt to load the sources unless CONVOLVE, PHOT, or
MATCH.ZERO.POINTS is true.

4) the call of pmStackCombine ppStackReadout needs to test for the
existence of the rejected sources.

This check-in also includes again the pmReadoutFake threading which
had caused errors (problem was in pmSourceGroups.c)

Location:
trunk/ppStack/src
Files:
10 edited

Legend:

Unmodified
Added
Removed
  • trunk/ppStack/src/ppStackCombineInitial.c

    r26076 r26454  
    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    }
  • trunk/ppStack/src/ppStackConvolve.c

    r26161 r26454  
    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);
  • trunk/ppStack/src/ppStackFiles.c

    r26104 r26454  
    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
  • trunk/ppStack/src/ppStackMatch.c

    r26218 r26454  
    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);
  • trunk/ppStack/src/ppStackOptions.c

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

    r26076 r26454  
    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
  • trunk/ppStack/src/ppStackPrepare.c

    r23573 r26454  
    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);
  • trunk/ppStack/src/ppStackReadout.c

    r26076 r26454  
    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);
  • trunk/ppStack/src/ppStackSetup.c

    r26078 r26454  
    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?
  • trunk/ppStack/src/ppStackSources.c

    r26076 r26454  
    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.