Changeset 15756 for trunk/psModules/src/imcombine/pmSubtraction.h
- Timestamp:
- Dec 6, 2007, 3:57:15 PM (18 years ago)
- File:
-
- 1 edited
-
trunk/psModules/src/imcombine/pmSubtraction.h (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psModules/src/imcombine/pmSubtraction.h
r15562 r15756 6 6 * @author GLG, MHPCC 7 7 * 8 * @version $Revision: 1.2 1$ $Name: not supported by cvs2svn $9 * @date $Date: 2007-1 1-10 01:09:20$8 * @version $Revision: 1.22 $ $Name: not supported by cvs2svn $ 9 * @date $Date: 2007-12-07 01:57:15 $ 10 10 * Copyright 2004-207 Institute for Astronomy, University of Hawaii 11 11 */ … … 37 37 } pmSubtractionMasks; 38 38 39 /// Generate a mask for use in the subtraction process 40 psImage *pmSubtractionMask(const psImage *refMask, ///< Mask for the reference image (will be convolved) 41 const psImage *inMask, ///< Mask for the input image, or NULL 42 psMaskType maskVal, ///< Value to mask out 43 int size, ///< Half-size of the kernel (pmSubtractionKernels.size) 44 int footprint, ///< Half-size of the kernel footprint 45 float badFrac, ///< Maximum fraction of bad input pixels to accept 46 bool useFFT ///< Use FFT to do convolution? 47 ); 39 40 /// Number of terms in a polynomial 41 #define PM_SUBTRACTION_POLYTERMS(ORDER) (((ORDER) + 1) * ((ORDER) + 2) / 2) 42 43 /// Set the indices for the normalisation and background terms 44 #define PM_SUBTRACTION_INDICES(NORM,BG,KERNELS) { \ 45 int numSpatial = PM_SUBTRACTION_POLYTERMS((KERNELS)->spatialOrder); /* Number of spatial terms */ \ 46 NORM = (KERNELS)->num * numSpatial; \ 47 BG = NORM + 1; \ 48 } 49 50 /// Return the index for the start of the normalisation terms 51 #define PM_SUBTRACTION_INDEX_NORM(KERNELS) \ 52 ((KERNELS)->num * PM_SUBTRACTION_POLYTERMS((KERNELS)->spatialOrder)) 53 54 /// Return the index for the start of the background terms 55 #define PM_SUBTRACTION_INDEX_BG(KERNELS) \ 56 (((KERNELS)->num * PM_SUBTRACTION_POLYTERMS((KERNELS)->spatialOrder)) + 1) 57 48 58 49 59 /// Convolve the reference stamp with the kernel components 50 60 bool pmSubtractionConvolveStamp(pmSubtractionStamp *stamp, ///< Stamp to convolve 51 61 const pmSubtractionKernels *kernels, ///< Kernel parameters 52 int footprint, ///< Half-size of region over which to calculate equation 53 pmSubtractionMode mode ///< Mode for subtraction (which to convolve) 54 ); 55 56 /// Calculate the least-squares equation to match the image quality 57 bool pmSubtractionCalculateEquation(pmSubtractionStampList *stamps, ///< Stamps 58 const pmSubtractionKernels *kernels, ///< Kernel parameters 59 int footprint, ///< Half-size of region over which to calculate equation 60 pmSubtractionMode mode ///< Mode for subtraction (which to convolve) 61 ); 62 63 /// Solve the least-squares equation to match the image quality 64 psVector *pmSubtractionSolveEquation(psVector *solution, ///< Solution vector, or NULL 65 const pmSubtractionStampList *stamps ///< Stamps 66 ); 67 68 /// Calculate deviations 69 psVector *pmSubtractionCalculateDeviations(pmSubtractionStampList *stamps, ///< Stamps 70 const psVector *solution, ///< Solution vector 71 int footprint, ///< Half-size of stamp 72 const pmSubtractionKernels *kernels, ///< Kernel parameters 73 pmSubtractionMode mode ///< Mode for subtraction 62 int footprint ///< Half-size of region over which to calculate equation 74 63 ); 75 64 … … 83 72 84 73 /// Generate an image of the convolution kernel 85 psImage *pmSubtractionKernelImage(const p sVector *solution, ///< Solution vector86 const pmSubtractionKernels *kernels, ///< Kernel parameters87 float x, float y ///< Normalised position [-1,1] for which to generate image74 psImage *pmSubtractionKernelImage(const pmSubtractionKernels *kernels, ///< Kernel parameters 75 float x, float y,///< Normalised position [-1,1] for which to generate image 76 bool wantDual ///< Calculate for the dual kernel? 88 77 ); 89 78 … … 95 84 96 85 /// Convolve image in preparation for subtraction 97 bool pmSubtractionConvolve(pmReadout *out, ///< Output image 86 bool pmSubtractionConvolve(pmReadout *out1, ///< Output image 1 87 pmReadout *out2, ///< Output image 2 (DUAL mode only) 98 88 const pmReadout *ro1, // Input image 1 99 89 const pmReadout *ro2, // Input image 2 … … 101 91 psMaskType blank, ///< Mask value for blank regions 102 92 const psRegion *region, ///< Region to convolve (or NULL) 103 const psVector *solution, ///< The solution vector104 93 const pmSubtractionKernels *kernels, ///< Kernel parameters 105 pmSubtractionMode mode, ///< Mode for subtraction106 94 bool useFFT ///< Use Fast Fourier Transform for the convolution? 107 );108 109 /// Mark the non-convolved part of the image as blank110 bool pmSubtractionBorder(psImage *image,///< Image111 psImage *weight, ///< Weight map (or NULL)112 psImage *mask, ///< Mask (or NULL)113 int size, ///< Kernel half-size114 psMaskType blank ///< Mask value for blank regions115 95 ); 116 96 … … 122 102 ); 123 103 104 /// Given (normalised) coordinates (x,y), generate a matrix where the elements (i,j) are x^i * y^j 105 psImage *p_pmSubtractionPolynomial(psImage *output, ///< Output matrix, or NULL 106 int spatialOrder, ///< Maximum spatial polynomial order 107 float x, float y ///< Normalised position of interest, [-1,1] 108 ); 109 124 110 /// @} 125 111 #endif
Note:
See TracChangeset
for help on using the changeset viewer.
