IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Mar 5, 2009, 11:24:29 AM (17 years ago)
Author:
beaumont
Message:

sync with mainline

Location:
branches/cnb_branches/cnb_branch_20090215
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/cnb_branches/cnb_branch_20090215

  • branches/cnb_branches/cnb_branch_20090215/ppStack/src/ppStackLoop.c

    r22214 r23199  
    257257    pmPSF *targetPSF = NULL;            // Target PSF
    258258    float sumExposure = NAN;            // Sum of exposure times
     259    psVector *inputMask = psVectorAlloc(num, PS_TYPE_VECTOR_MASK); // Mask for inputs
     260    psVectorInit(inputMask, 0);
    259261    if (psMetadataLookupBool(NULL, config->arguments, "HAVE.PSF")) {
    260262        pmFPAfileActivate(config->files, false, NULL);
     
    283285                psFree(fileIter);
    284286                psFree(psfs);
     287                psFree(inputMask);
    285288                return false;
    286289            }
     
    299302                psFree(fileIter);
    300303                psFree(psfs);
     304                psFree(inputMask);
    301305                return false;
    302306            }
     
    324328                    psFree(sourceLists);
    325329                    psFree(targetPSF);
    326                     return false;
     330                    psFree(inputMask);
     331                   return false;
    327332                }
    328333
     
    333338                    psFree(sourceLists);
    334339                    psFree(targetPSF);
     340                    psFree(inputMask);
    335341                    return false;
    336342                }
     
    340346                    psFree(sourceLists);
    341347                    psFree(targetPSF);
     348                    psFree(inputMask);
    342349                    return false;
    343350                }
     
    351358
    352359        // Zero point calibration
    353         sumExposure = ppStackSourcesTransparency(sourceLists, view, config);
     360        sumExposure = ppStackSourcesTransparency(sourceLists, inputMask, view, config);
    354361        if (!isfinite(sumExposure) || sumExposure <= 0) {
    355362            psError(PS_ERR_UNKNOWN, false, "Unable to calculate transparency differences");
    356363            psFree(sourceLists);
    357364            psFree(targetPSF);
     365            psFree(inputMask);
    358366            return false;
    359367        }
    360368
    361369        // Generate target PSF
    362         targetPSF = ppStackPSF(config, numCols, numRows, psfs);
     370        targetPSF = ppStackPSF(config, numCols, numRows, psfs, inputMask);
    363371        psFree(psfs);
    364372        if (!targetPSF) {
     
    366374            psFree(sourceLists);
    367375            psFree(view);
     376            psFree(inputMask);
    368377            return false;
    369378        }
     
    409418    int numGood = 0;                    // Number of good frames
    410419    int numCols = 0, numRows = 0;       // Size of image
    411     psVector *inputMask = psVectorAlloc(num, PS_TYPE_VECTOR_MASK); // Mask for inputs
    412     psVectorInit(inputMask, 0);
    413420    psVector *matchChi2 = psVectorAlloc(num, PS_TYPE_F32); // chi^2 for stamps when matching
    414421    psVectorInit(matchChi2, NAN);
     
    419426    psArray *covariances = psArrayAlloc(num); // Covariance matrices
    420427    for (int i = 0; i < num; i++) {
     428        if (inputMask->data.U8[i]) {
     429            continue;
     430        }
    421431        psTrace("ppStack", 2, "Convolving input %d of %d to target PSF....\n", i, num);
    422432        pmFPAfileActivate(config->files, false, NULL);
     
    11681178        fileActivation(config, photFiles, true);
    11691179        pmFPAview *photView = filesIterateDown(config);
     1180        fileActivation(config, combineFiles, true);
     1181
    11701182        if (!ppStackPhotometry(config, outRO, photView)) {
    11711183            psError(PS_ERR_UNKNOWN, false, "Unable to perform photometry on output.");
     1184            filesIterateUp(config);
    11721185            psFree(outRO);
    11731186            psFree(photView);
     
    11751188        }
    11761189        psFree(photView);
    1177 
    1178         fileActivation(config, combineFiles, true);
    11791190
    11801191        if (stats) {
     
    12171228        hdu->header = psMetadataAlloc();
    12181229    }
    1219     ppStackVersionMetadata(hdu->header);
     1230    ppStackVersionHeader(hdu->header);
    12201231
    12211232    psFree(outRO);
Note: See TracChangeset for help on using the changeset viewer.