IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jun 18, 2008, 2:39:33 PM (18 years ago)
Author:
Paul Price
Message:

Calculate and record the variance factor (required for transforming between variances on large scales and small scales)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/pswarp/src/pswarpLoop.c

    r18068 r18179  
    253253    }
    254254
     255    // Set variance factor
     256    {
     257        float varFactor = psMetadataLookupF32(NULL, output->analysis, PSWARP_ANALYSIS_VARFACTOR);
     258        psAssert(isfinite(varFactor), "Should be something here.");
     259        long goodPix = psMetadataLookupS64(NULL, output->analysis, PSWARP_ANALYSIS_GOODPIX);
     260        psAssert(goodPix > 0, "Should be something here.");
     261        varFactor /= goodPix;
     262
     263        psMetadataItem *vfItem = psMetadataLookup(outCell->concepts, "CELL.VARFACTOR"); // Item to update
     264        psAssert(vfItem && vfItem->type == PS_TYPE_F64, "Concept should be as specified.");
     265        if (!isfinite(vfItem->data.F64)) {
     266            vfItem->data.F64 = varFactor;
     267        } else {
     268            vfItem->data.F64 *= varFactor;
     269        }
     270    }
     271
    255272    if (!pmConceptsAverageCells(outCell, cells, NULL, NULL, false)) {
    256273        psError(PS_ERR_UNKNOWN, false, "Unable to average cell concepts.");
Note: See TracChangeset for help on using the changeset viewer.