Changeset 27840 for branches/simtest_nebulous_branches/psModules/src/imcombine/pmSubtractionKernels.h
- Timestamp:
- May 3, 2010, 8:50:52 AM (16 years ago)
- Location:
- branches/simtest_nebulous_branches
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/simtest_nebulous_branches
- Property svn:mergeinfo changed
-
branches/simtest_nebulous_branches/psModules
-
Property svn:mergeinfo
set to (toggle deleted branches)
/trunk/psModules merged eligible /branches/eam_branches/stackphot.20100406/psModules 27623-27653 /branches/pap_delete/psModules 27530-27595
-
Property svn:mergeinfo
set to (toggle deleted branches)
-
branches/simtest_nebulous_branches/psModules/src/imcombine/pmSubtractionKernels.h
r20049 r27840 10 10 PM_SUBTRACTION_KERNEL_POIS, ///< Pan-STARRS Optimal Image Subtraction --- delta functions 11 11 PM_SUBTRACTION_KERNEL_ISIS, ///< Traditional kernel --- gaussians modified by polynomials 12 PM_SUBTRACTION_KERNEL_ISIS_RADIAL, ///< ISIS + higher-order radial Hermitians 13 PM_SUBTRACTION_KERNEL_HERM, ///< Hermitian polynomial kernels 14 PM_SUBTRACTION_KERNEL_DECONV_HERM, ///< Deconvolved Hermitian polynomial kernels 12 15 PM_SUBTRACTION_KERNEL_SPAM, ///< Summed Pixels for Advanced Matching --- summed delta functions 13 16 PM_SUBTRACTION_KERNEL_FRIES, ///< Fibonacci Radius Increases Excellence of Subtraction … … 29 32 pmSubtractionKernelsType type; ///< Type of kernels --- allowing the use of multiple kernels 30 33 psString description; ///< Description of the kernel parameters 34 int xMin, xMax, yMin, yMax; ///< Bounds of image (for normalisation) 31 35 long num; ///< Number of kernel components (not including the spatial ones) 32 psVector *u, *v; ///< Offset (for POIS) or polynomial order (for ISIS )33 psVector *widths; ///< Gaussian FWHMs (ISIS )36 psVector *u, *v; ///< Offset (for POIS) or polynomial order (for ISIS, HERM or DECONV_HERM) 37 psVector *widths; ///< Gaussian FWHMs (ISIS, HERM or DECONV_HERM) 34 38 psVector *uStop, *vStop; ///< Width of kernel element (SPAM,FRIES only) 35 psArray *preCalc; ///< Array of images containing pre-calculated kernel (for ISIS )39 psArray *preCalc; ///< Array of images containing pre-calculated kernel (for ISIS, HERM or DECONV_HERM) 36 40 float penalty; ///< Penalty for wideness 37 41 psVector *penalties; ///< Penalty for each kernel component … … 41 45 int bgOrder; ///< The order for the background fitting 42 46 pmSubtractionMode mode; ///< Mode for subtraction 43 int numCols, numRows; ///< Size of image (for normalisation), or zero to use image provided44 47 psVector *solution1, *solution2; ///< Solution for the PSF matching 45 48 // Quality information 46 49 float mean, rms; ///< Mean and RMS of chi^2 from stamps 47 50 int numStamps; ///< Number of good stamps 51 float fSigResMean; ///< mean fractional stdev of residuals 52 float fSigResStdev; ///< stdev of fractional stdev of residuals 53 float fMaxResMean; ///< mean fractional positive swing in residuals 54 float fMaxResStdev; ///< stdev of fractional positive swing in residuals 55 float fMinResMean; ///< mean fractional negative swing in residuals 56 float fMinResStdev; ///< stdev of fractional negative swing in residuals 57 psArray *sampleStamps; ///< array of brightest set of stamps for output visualizations 48 58 } pmSubtractionKernels; 59 60 // pmSubtractionKernels->preCalc is an array of pmSubtractionKernelPreCalc structures 61 typedef struct { 62 psVector *uCoords; // used by RINGS 63 psVector *vCoords; // used by RINGS 64 psVector *poly; // used by RINGS 65 66 psVector *xKernel; // used by ISIS, HERM, DECONV_HERM 67 psVector *yKernel; // used by ISIS, HERM, DECONV_HERM 68 psKernel *kernel; // used by ISIS, HERM, DECONV_HERM 69 } pmSubtractionKernelPreCalc; 49 70 50 71 // Assertion to check pmSubtractionKernels … … 52 73 PS_ASSERT_PTR_NON_NULL(KERNELS, RETURNVALUE); \ 53 74 PS_ASSERT_STRING_NON_EMPTY((KERNELS)->description, RETURNVALUE); \ 54 PS_ASSERT_INT_ POSITIVE((KERNELS)->num, RETURNVALUE); \75 PS_ASSERT_INT_NONNEGATIVE((KERNELS)->num, RETURNVALUE); \ 55 76 PS_ASSERT_VECTOR_NON_NULL((KERNELS)->u, RETURNVALUE); \ 56 77 PS_ASSERT_VECTOR_NON_NULL((KERNELS)->v, RETURNVALUE); \ … … 60 81 PS_ASSERT_VECTOR_SIZE((KERNELS)->v, (KERNELS)->num, RETURNVALUE); \ 61 82 if ((KERNELS)->type == PM_SUBTRACTION_KERNEL_ISIS) { \ 83 PS_ASSERT_VECTOR_NON_NULL((KERNELS)->widths, RETURNVALUE); \ 84 PS_ASSERT_VECTOR_TYPE((KERNELS)->widths, PS_TYPE_F32, RETURNVALUE); \ 85 PS_ASSERT_VECTOR_SIZE((KERNELS)->widths, (KERNELS)->num, RETURNVALUE); \ 86 } \ 87 if ((KERNELS)->type == PM_SUBTRACTION_KERNEL_ISIS_RADIAL) { \ 88 PS_ASSERT_VECTOR_NON_NULL((KERNELS)->widths, RETURNVALUE); \ 89 PS_ASSERT_VECTOR_TYPE((KERNELS)->widths, PS_TYPE_F32, RETURNVALUE); \ 90 PS_ASSERT_VECTOR_SIZE((KERNELS)->widths, (KERNELS)->num, RETURNVALUE); \ 91 } \ 92 if ((KERNELS)->type == PM_SUBTRACTION_KERNEL_HERM) { \ 93 PS_ASSERT_VECTOR_NON_NULL((KERNELS)->widths, RETURNVALUE); \ 94 PS_ASSERT_VECTOR_TYPE((KERNELS)->widths, PS_TYPE_F32, RETURNVALUE); \ 95 PS_ASSERT_VECTOR_SIZE((KERNELS)->widths, (KERNELS)->num, RETURNVALUE); \ 96 } \ 97 if ((KERNELS)->type == PM_SUBTRACTION_KERNEL_DECONV_HERM) { \ 62 98 PS_ASSERT_VECTOR_NON_NULL((KERNELS)->widths, RETURNVALUE); \ 63 99 PS_ASSERT_VECTOR_TYPE((KERNELS)->widths, PS_TYPE_F32, RETURNVALUE); \ … … 99 135 } 100 136 137 // Generate 1D convolution kernel for ISIS 138 psVector *pmSubtractionKernelISIS(float sigma, // Gaussian width 139 int order, // Polynomial order 140 int size // Kernel half-size 141 ); 142 143 // Generate 1D convolution kernel for HERM (normalized for 2D) 144 psVector *pmSubtractionKernelHERM(float sigma, // Gaussian width 145 int order, // Polynomial order 146 int size // Kernel half-size 147 ); 148 101 149 /// Generate a delta-function grid for subtraction kernels (like the POIS kernel) 102 150 bool p_pmSubtractionKernelsAddGrid(pmSubtractionKernels *kernels, ///< The subtraction kernels to append to … … 114 162 int spatialOrder, ///< Order of spatial variations 115 163 float penalty, ///< Penalty for wideness 164 psRegion bounds, ///< Bounds for validity 116 165 pmSubtractionMode mode ///< Mode for subtraction 117 166 ); 167 168 /// Allocator for pre-calculated kernel data structure 169 pmSubtractionKernelPreCalc *pmSubtractionKernelPreCalcAlloc( 170 pmSubtractionKernelsType type, ///< type of kernel to allocate (not all can be pre-calculated) 171 int uOrder, ///< order in x-direction 172 int vOrder, ///< order in x-direction 173 int size, ///< Half-size of the kernel 174 float sigma ///< sigma of gaussian kernel 175 ); 176 118 177 119 178 /// Generate POIS kernels … … 121 180 int spatialOrder, ///< Order of spatial variations 122 181 float penalty, ///< Penalty for wideness 182 psRegion bounds, ///< Bounds for validity 123 183 pmSubtractionMode mode ///< Mode for subtraction 124 184 ); … … 130 190 const psVector *orders, ///< Polynomial order of gaussians 131 191 float penalty, ///< Penalty for wideness 192 psRegion bounds, ///< Bounds for validity 132 193 pmSubtractionMode mode ///< Mode for subtraction 133 194 ); … … 139 200 const psVector *orders, ///< Polynomial order of gaussians 140 201 float penalty, ///< Penalty for wideness 202 psRegion bounds, ///< Bounds for validity 141 203 pmSubtractionMode mode ///< Mode for subtraction 142 204 ); 205 206 /// Generate ISIS + RADIAL_HERM kernels 207 pmSubtractionKernels *pmSubtractionKernelsISIS_RADIAL(int size, ///< Half-size of the kernel 208 int spatialOrder, ///< Order of spatial variations 209 const psVector *fwhms, ///< Gaussian FWHMs 210 const psVector *orders, ///< Polynomial order of gaussians 211 float penalty, ///< Penalty for wideness 212 psRegion bounds, ///< Bounds for validity 213 pmSubtractionMode mode ///< Mode for subtraction 214 ); 215 216 /// Generate HERM kernels 217 pmSubtractionKernels *pmSubtractionKernelsHERM(int size, ///< Half-size of the kernel 218 int spatialOrder, ///< Order of spatial variations 219 const psVector *fwhms, ///< Gaussian FWHMs 220 const psVector *orders, ///< order of hermitian polynomials 221 float penalty, ///< Penalty for wideness 222 psRegion bounds, ///< Bounds for validity 223 pmSubtractionMode mode ///< Mode for subtraction 224 ); 225 226 /// Generate DECONV_HERM kernels 227 pmSubtractionKernels *pmSubtractionKernelsDECONV_HERM(int size, ///< Half-size of the kernel 228 int spatialOrder, ///< Order of spatial variations 229 const psVector *fwhms, ///< Gaussian FWHMs 230 const psVector *orders, ///< order of hermitian polynomials 231 float penalty, ///< Penalty for wideness 232 psRegion bounds, ///< Bounds for validity 233 pmSubtractionMode mode ///< Mode for subtraction 234 ); 143 235 144 236 /// Generate SPAM kernels … … 148 240 int binning, ///< Kernel binning factor 149 241 float penalty, ///< Penalty for wideness 242 psRegion bounds, ///< Bounds for validity 150 243 pmSubtractionMode mode ///< Mode for subtraction 151 244 ); … … 156 249 int inner, ///< Inner radius to preserve unbinned 157 250 float penalty, ///< Penalty for wideness 251 psRegion bounds, ///< Bounds for validity 158 252 pmSubtractionMode mode ///< Mode for subtraction 159 253 ); … … 166 260 int inner, ///< Inner radius containing grid of delta functions 167 261 float penalty, ///< Penalty for wideness 262 psRegion bounds, ///< Bounds for validity 168 263 pmSubtractionMode mode ///< Mode for subtraction 169 264 ); … … 175 270 int ringsOrder, ///< Polynomial order 176 271 float penalty, ///< Penalty for wideness 272 psRegion bounds, ///< Bounds for validity 177 273 pmSubtractionMode mode ///< Mode for subtraction 178 274 ); … … 189 285 int ringsOrder, ///< Polynomial order for RINGS 190 286 float penalty, ///< Penalty for wideness 287 psRegion bounds, ///< Bounds for validity 191 288 pmSubtractionMode mode ///< Mode for subtraction 192 289 ); … … 196 293 const char *description, ///< Description of kernel 197 294 int bgOrder, ///< Polynomial order for background fitting 295 psRegion bounds, ///< Bounds for validity 198 296 pmSubtractionMode mode ///< Mode for subtraction 199 297 ); … … 203 301 ); 204 302 303 /// Copy kernels 304 /// 305 /// A deep copy is performed on the solution only; the other components are merely pointers. 306 pmSubtractionKernels *pmSubtractionKernelsCopy( 307 const pmSubtractionKernels *in // Kernels to copy 308 ); 309 205 310 206 311 #endif
Note:
See TracChangeset
for help on using the changeset viewer.
