IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 37510 for trunk/psLib


Ignore:
Timestamp:
Oct 20, 2014, 5:25:31 PM (12 years ago)
Author:
watersc1
Message:

Change in scaling. If we have a median that is identically 0.0, we need to change it to something else to prevent problems in the unscaling code (there's a median(power) term. If the sigma is equally bad, simply don't scale, and hope for the best. Otherwise, choose an arbitrary small offset that's a fixed fraction of the sigma value, as we do want to scale bad ranged data, even if it is centered around zero.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/psLib/src/math/psMinimizePolyFit.c

    r37404 r37510  
    731731          scale = false;
    732732        }
     733
     734        if (median == 0.0) {
     735          if (sigma <= 0.0) {
     736            scale = false; // Try with what we started with.
     737          }
     738          else {
     739            median = 0.1 * sigma;
     740          }
     741        }
     742
    733743        // I can't see a way to not clobber x if it's already F64, so make a copy.x
    734744        psVector *z64 = psVectorCopy(NULL,x64,PS_TYPE_F64);
     
    740750#endif
    741751
    742        
    743752        result = VectorFitPolynomial1DOrd(poly, mask, maskValue, f64, fErr64, z64);
    744753        psFree(z64); // Done with this.
Note: See TracChangeset for help on using the changeset viewer.