IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 14911


Ignore:
Timestamp:
Sep 20, 2007, 9:21:13 AM (19 years ago)
Author:
magnier
Message:

use psImageMapClipFit in psTrend2DFit

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branch_20070830/psModules/src/objects/pmTrend2D.c

    r14778 r14911  
    33 *  @author EAM, IfA
    44 *
    5  *  @version $Revision: 1.1.2.2 $ $Name: not supported by cvs2svn $
    6  *  @date $Date: 2007-09-07 20:24:34 $
     5 *  @version $Revision: 1.1.2.3 $ $Name: not supported by cvs2svn $
     6 *  @date $Date: 2007-09-20 19:21:13 $
    77 *
    88 *  Copyright 2004 Institute for Astronomy, University of Hawaii
     
    3030pmTrend2D *pmTrend2DAlloc (pmTrend2DMode mode, psImage *image, int nXtrend, int nYtrend, psStats *stats)
    3131{
     32    assert (image);
     33    assert (stats);
     34
    3235    pmTrend2D *trend = (pmTrend2D *) psAlloc(sizeof(pmTrend2D));
    3336    psMemSetDeallocator(trend, (psFreeFunc) pmTrend2DFree);
     
    5053          // binning defines the map scale relationship
    5154          psImageBinning *binning = psImageBinningAlloc();
     55          binning->nXruff = nXtrend;
     56          binning->nYruff = nYtrend;
    5257          binning->nXfine = image->numCols;
    5358          binning->nYfine = image->numRows;
    54           binning->nXruff = nXtrend;
    55           binning->nYruff = nYtrend;
    5659
    5760          trend->map = psImageMapAlloc (image, binning, stats);
     
    104107}
    105108
    106 bool pmTrend2DFit (pmTrend2D *trend, psVector *x, psVector *y, psVector *f, psVector *df) {
     109bool pmTrend2DFit (pmTrend2D *trend, psVector *mask, psMaskType maskVal, psVector *x, psVector *y, psVector *f, psVector *df) {
    107110
    108111    bool status;
    109 
    110     psVector *mask = psVectorAlloc (x->n, PS_TYPE_MASK);
    111112
    112113    switch (trend->mode) {
    113114      case PM_TREND_POLY_ORD:
    114115      case PM_TREND_POLY_CHEB:
    115         status = psVectorClipFitPolynomial2D (trend->poly, trend->stats, mask, 0xff, f, df, x, y);
     116        status = psVectorClipFitPolynomial2D (trend->poly, trend->stats, mask, maskVal, f, df, x, y);
    116117        // we can use the API here which adjusts the polynomial order based on the number
    117118        // of points in the image, and potentially based on the fractional range of the
     
    121122      case PM_TREND_MAP:
    122123        // XXX supply fraction from trend elements
    123         status = psImageMapGenerateScale (trend->map, x, y, f, df, 0.1);
     124        // XXX need to add the API which adjusts the scale
     125        status = psImageMapClipFit (trend->map, trend->stats, mask, maskVal, x, y, f, df);
    124126        break;
    125127
     
    127129        psAbort ("error");
    128130    }
    129     psFree (mask);
    130131    return status;
    131132}
Note: See TracChangeset for help on using the changeset viewer.