Changeset 14911
- Timestamp:
- Sep 20, 2007, 9:21:13 AM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branch_20070830/psModules/src/objects/pmTrend2D.c
r14778 r14911 3 3 * @author EAM, IfA 4 4 * 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 $ 7 7 * 8 8 * Copyright 2004 Institute for Astronomy, University of Hawaii … … 30 30 pmTrend2D *pmTrend2DAlloc (pmTrend2DMode mode, psImage *image, int nXtrend, int nYtrend, psStats *stats) 31 31 { 32 assert (image); 33 assert (stats); 34 32 35 pmTrend2D *trend = (pmTrend2D *) psAlloc(sizeof(pmTrend2D)); 33 36 psMemSetDeallocator(trend, (psFreeFunc) pmTrend2DFree); … … 50 53 // binning defines the map scale relationship 51 54 psImageBinning *binning = psImageBinningAlloc(); 55 binning->nXruff = nXtrend; 56 binning->nYruff = nYtrend; 52 57 binning->nXfine = image->numCols; 53 58 binning->nYfine = image->numRows; 54 binning->nXruff = nXtrend;55 binning->nYruff = nYtrend;56 59 57 60 trend->map = psImageMapAlloc (image, binning, stats); … … 104 107 } 105 108 106 bool pmTrend2DFit (pmTrend2D *trend, psVector * x, psVector *y, psVector *f, psVector *df) {109 bool pmTrend2DFit (pmTrend2D *trend, psVector *mask, psMaskType maskVal, psVector *x, psVector *y, psVector *f, psVector *df) { 107 110 108 111 bool status; 109 110 psVector *mask = psVectorAlloc (x->n, PS_TYPE_MASK);111 112 112 113 switch (trend->mode) { 113 114 case PM_TREND_POLY_ORD: 114 115 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); 116 117 // we can use the API here which adjusts the polynomial order based on the number 117 118 // of points in the image, and potentially based on the fractional range of the … … 121 122 case PM_TREND_MAP: 122 123 // 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); 124 126 break; 125 127 … … 127 129 psAbort ("error"); 128 130 } 129 psFree (mask);130 131 return status; 131 132 }
Note:
See TracChangeset
for help on using the changeset viewer.
