Changeset 13920
- Timestamp:
- Jun 20, 2007, 10:45:00 AM (19 years ago)
- Location:
- trunk/psModules/src/detrend
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/psModules/src/detrend/pmBias.c
r13810 r13920 17 17 #include "pmBias.h" 18 18 19 #define SMOOTH_NSIGMA 4.0 // Number of Gaussian sigma the smoothing kernel extends 20 21 19 22 static void overscanOptionsFree(pmOverscanOptions *options) 20 23 { … … 24 27 } 25 28 26 pmOverscanOptions *pmOverscanOptionsAlloc(bool single, pmFit fitType, unsigned int order, psStats *stat) 29 pmOverscanOptions *pmOverscanOptionsAlloc(bool single, pmFit fitType, unsigned int order, psStats *stat, 30 int boxcar, float gauss) 27 31 { 28 32 pmOverscanOptions *opts = psAlloc(sizeof(pmOverscanOptions)); … … 34 38 opts->order = order; 35 39 opts->stat = psMemIncrRefCounter(stat); 40 41 // Smoothing 42 opts->boxcar = boxcar; 43 opts->gauss = gauss; 36 44 37 45 // Outputs … … 151 159 mask->data.U8[i] = 1; 152 160 } 161 } 162 163 // Smooth the reduced vector 164 if (overscanOpts->boxcar > 0) { 165 psVector *smoothed = psVectorBoxcar(NULL, reduced, overscanOpts->boxcar); // Smoothed vector 166 psFree(reduced); 167 reduced = smoothed; 168 } 169 if (isfinite(overscanOpts->gauss) && overscanOpts->gauss > 0) { 170 if (overscanOpts->boxcar > 0) { 171 psWarning("Gaussian smoothing the boxcar smoothed overscan --- you asked for it."); 172 } 173 psVector *smoothed = psVectorSmooth(NULL, reduced, overscanOpts->gauss, SMOOTH_NSIGMA); 174 psFree(reduced); 175 reduced = smoothed; 153 176 } 154 177 -
trunk/psModules/src/detrend/pmBias.h
r13810 r13920 5 5 * @author Paul Price, IfA 6 6 * 7 * @version $Revision: 1. 5$ $Name: not supported by cvs2svn $8 * @date $Date: 2007-06- 14 02:03:29$7 * @version $Revision: 1.6 $ $Name: not supported by cvs2svn $ 8 * @date $Date: 2007-06-20 20:45:00 $ 9 9 * Copyright 2004--2006 Institute for Astronomy, University of Hawaii 10 10 */ … … 34 34 { 35 35 // Inputs 36 bool single; ///< Reduce all overscan regions to a single value? 37 pmFit fitType; ///< Type of fit to overscan 38 unsigned int order; ///< Order of polynomial, or number of spline pieces 39 psStats *stat; ///< Statistic to use when reducing the minor direction 36 bool single; ///< Reduce all overscan regions to a single value? 37 pmFit fitType; ///< Type of fit to overscan 38 unsigned int order; ///< Order of polynomial, or number of spline pieces 39 psStats *stat; ///< Statistic to use when reducing the minor direction 40 int boxcar; ///< Boxcar smoothing radius 41 float gauss; ///< Gaussian smoothing sigma 40 42 // Outputs 41 psPolynomial1D *poly; ///< Result of polynomial fit42 psSpline1D *spline; ///< Result of spline fit43 psPolynomial1D *poly; ///< Result of polynomial fit 44 psSpline1D *spline; ///< Result of spline fit 43 45 } 44 46 pmOverscanOptions; … … 46 48 /// Allocator for overscan options 47 49 pmOverscanOptions *pmOverscanOptionsAlloc(bool single, ///< Reduce all overscan regions to a single value? 48 pmFit fitType, ///< Type of fit to overscan 49 unsigned int order, ///< Order of polynomial, or number of splines 50 psStats *stat ///< Statistic to use 50 pmFit fitType, ///< Type of fit to overscan 51 unsigned int order, ///< Order of polynomial, or number of splines 52 psStats *stat, ///< Statistic to use 53 int boxcar, ///< Boxcar smoothing radius 54 float gauss ///< Gaussian smoothing sigma 51 55 ); 52 56
Note:
See TracChangeset
for help on using the changeset viewer.
