IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 35541


Ignore:
Timestamp:
May 9, 2013, 10:54:51 AM (13 years ago)
Author:
eugene
Message:

in multi-input mode, some output readouts may not have valid inputs on the first pass

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/ipp-20130419/pswarp/src/pswarpUpdateMetadata.c

    r35535 r35541  
    4848                    psAssert(covariances, "Should be there");
    4949                    psArray *covars = psListToArray(covariances); // Array of covariance matrices
    50                     psKernel *covar = psImageCovarianceAverage(covars);
    51                     psFree(covars);
    52                     psMetadataRemoveKey(readout->analysis, PSWARP_ANALYSIS_COVARIANCES);
     50                    if (covars->n) {
     51                      psKernel *covar = psImageCovarianceAverage(covars);
     52                      psMetadataRemoveKey(readout->analysis, PSWARP_ANALYSIS_COVARIANCES);
    5353
    54                     // Correct covariance matrix scale for the mean (square root of the) Jacobian
    55                     double jacobian = psMetadataLookupF64(NULL, readout->analysis, PSWARP_ANALYSIS_JACOBIAN); // Jacobian
    56                     int goodPixels = psMetadataLookupS32(NULL, readout->analysis, PSWARP_ANALYSIS_GOODPIX);   // Good pixels
    57                     jacobian /= goodPixels;
    58                     readout->covariance = psImageCovarianceScale(covar, jacobian);
    59                     psFree(covar);
     54                      // Correct covariance matrix scale for the mean (square root of the) Jacobian
     55                      double jacobian = psMetadataLookupF64(NULL, readout->analysis, PSWARP_ANALYSIS_JACOBIAN); // Jacobian
     56                      int goodPixels = psMetadataLookupS32(NULL, readout->analysis, PSWARP_ANALYSIS_GOODPIX);   // Good pixels
     57                      jacobian /= goodPixels;
     58                      readout->covariance = psImageCovarianceScale(covar, jacobian);
     59                      psFree(covar);
    6060
    61                     if (readout->variance) {
     61                      if (readout->variance) {
    6262                        psImageCovarianceTransfer(readout->variance, readout->covariance);
     63                      }
     64
     65                      psFree(covars);
    6366                    }
    6467                }
Note: See TracChangeset for help on using the changeset viewer.