IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Dec 17, 2010, 10:06:58 AM (16 years ago)
Author:
eugene
Message:

merge changes from trunk

Location:
branches/eam_branches/ipp-20101205/psLib/src/imageops
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/ipp-20101205/psLib/src/imageops

  • branches/eam_branches/ipp-20101205/psLib/src/imageops/psImageMapFit.c

    r30019 r30104  
    4848
    4949// map defines the output image dimensions and scaling.
    50 bool psImageMapFit(bool *goodFit, psImageMap *map, const psVector *mask, psVectorMaskType maskValue,
     50bool psImageMapFit(bool *pGoodFit, psImageMap *map, const psVector *mask, psVectorMaskType maskValue,
    5151                   const psVector *x, const psVector *y, const psVector *f, const psVector *df)
    5252{
    5353    // XXX Add Asserts
    5454
    55     *goodFit = false;
     55    *pGoodFit = false;
    5656
    5757    // dimensions of the output map image
     
    8383        map->map->data.F32[0][0]   = psStatsGetValue(map->stats, mean);
    8484        map->error->data.F32[0][0] = psStatsGetValue(map->stats, stdev);
    85         *goodFit = true;
     85        if (isfinite(map->map->data.F32[0][0]) && isfinite( map->error->data.F32[0][0])) {
     86            *pGoodFit = true;
     87        }
    8688        return true;
    8789    }
     
    8991    if (Nx == 1) {
    9092        bool status;
    91         status = psImageMapFit1DinY (goodFit, map, mask, maskValue, x, y, f, df);
     93        status = psImageMapFit1DinY (pGoodFit, map, mask, maskValue, x, y, f, df);
    9294        return status;
    9395    }
    9496    if (Ny == 1) {
    9597        bool status;
    96         status = psImageMapFit1DinX (goodFit, map, mask, maskValue, x, y, f, df);
     98        status = psImageMapFit1DinX (pGoodFit, map, mask, maskValue, x, y, f, df);
    9799        return status;
    98100    }
     
    339341    psFree (Empty);
    340342
    341     *goodFit = true;
     343    *pGoodFit = true;
    342344    return true;
    343345}
    344346
    345347// measure residuals on each pass and clip outliers based on stats
    346 bool psImageMapClipFit(bool *goodFit, psImageMap *map, psStats *stats, psVector *inMask, psVectorMaskType maskValue,
     348bool psImageMapClipFit(bool *pGoodFit, psImageMap *map, psStats *stats, psVector *inMask, psVectorMaskType maskValue,
    347349                       const psVector *x, const psVector *y, const psVector *f, const psVector *df)
    348350{
     
    354356    psAssert(f, "impossible");
    355357
    356     *goodFit = false;
     358    *pGoodFit = false;
    357359
    358360    // the user supplies one of various stats option pairs,
     
    398400        psTrace("psLib.imageops", 6, "Loop iteration %d.  Calling psImageMapFit()\n", N);
    399401        psS32 Nkeep = 0;
    400         if (!psImageMapFit(goodFit, map, mask, maskValue, x, y, f, df)) {
     402        if (!psImageMapFit(pGoodFit, map, mask, maskValue, x, y, f, df)) {
    401403            psError(PS_ERR_UNKNOWN, false, "Could not fit image map.\n");
    402404            psFree(resid);
     
    404406            return false;
    405407        }
    406         if (!goodFit) {
     408        if (!*pGoodFit) {
    407409            psWarning ("bad fit to image map, try something else");
    408410            return true;
     
    463465    psFree(resid);
    464466    if (!inMask) psFree (mask);
    465     *goodFit = true; // XXX probably don't need to set this (set by psImageMapFit)
     467    *pGoodFit = true; // XXX probably don't need to set this (set by psImageMapFit)
    466468    return true;
    467469}
    468470
    469471// map defines the output image dimensions and scaling.
    470 bool psImageMapFit1DinY(bool *goodFit, psImageMap *map, const psVector *mask, psVectorMaskType maskValue,
     472bool psImageMapFit1DinY(bool *pGoodFit, psImageMap *map, const psVector *mask, psVectorMaskType maskValue,
    471473                        const psVector *x, const psVector *y, const psVector *f, const psVector *df)
    472474{
     
    474476    assert (map->binning->nXruff == 1);
    475477
    476     *goodFit = false;
     478    *pGoodFit = false;
    477479
    478480    // dimensions of the output map image
     
    613615    psFree (Empty);
    614616
    615     *goodFit = true;
     617    *pGoodFit = true;
    616618    return true;
    617619}
    618620
    619621// map defines the output image dimensions and scaling.
    620 bool psImageMapFit1DinX(bool *goodFit, psImageMap *map, const psVector *mask, psVectorMaskType maskValue,
     622bool psImageMapFit1DinX(bool *pGoodFit, psImageMap *map, const psVector *mask, psVectorMaskType maskValue,
    621623                        const psVector *x, const psVector *y, const psVector *f, const psVector *df)
    622624{
     
    624626    assert (map->binning->nYruff == 1);
    625627
    626     *goodFit = false;
     628    *pGoodFit = false;
    627629
    628630    // dimensions of the output map image
     
    763765    psFree (Empty);
    764766
    765     *goodFit = true;
     767    *pGoodFit = true;
    766768    return true;
    767769}
Note: See TracChangeset for help on using the changeset viewer.