IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 25439


Ignore:
Timestamp:
Sep 18, 2009, 9:20:23 AM (17 years ago)
Author:
Paul Price
Message:

Fixing fuzz so that the expectation value is preserved: by adding
random values on [0,l), was effectively adding 0.5 to the background.
The proper range is [-0.5,0.5).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/psLib/src/fits/psFitsScale.c

    r24901 r25439  
    319319                    value = (value - zero) * scale; \
    320320                    if (options->fuzz) { \
    321                        /* Add random factor [0,1): adds a variance of 1/12, */ \
     321                       /* Add random factor [-0.5,0.5): adds a variance of 1/12, */ \
    322322                       /* but preserves the expectation value */ \
    323                         value += psRandomUniform(rng); \
     323                        value += psRandomUniform(rng) - 0.5; \
    324324                    } \
    325325                    /* Check for underflow and overflow; set either to max */ \
Note: See TracChangeset for help on using the changeset viewer.