IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Feb 10, 2010, 7:34:39 PM (16 years ago)
Author:
eugene
Message:

updates from eam_branches/20091201 (substantially changes to the kernel matching code; updates to pmDetection container, added pmPattern, etc)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/psModules/src/imcombine/pmSubtractionKernels.h

    r26157 r26893  
    1010    PM_SUBTRACTION_KERNEL_POIS,         ///< Pan-STARRS Optimal Image Subtraction --- delta functions
    1111    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
    1215    PM_SUBTRACTION_KERNEL_SPAM,         ///< Summed Pixels for Advanced Matching --- summed delta functions
    1316    PM_SUBTRACTION_KERNEL_FRIES,        ///< Fibonacci Radius Increases Excellence of Subtraction
     
    2932    pmSubtractionKernelsType type;      ///< Type of kernels --- allowing the use of multiple kernels
    3033    psString description;               ///< Description of the kernel parameters
     34    int xMin, xMax, yMin, yMax;         ///< Bounds of image (for normalisation)
    3135    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)
    3438    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)
    3640    float penalty;                      ///< Penalty for wideness
    3741    psVector *penalties;                ///< Penalty for each kernel component
     
    4145    int bgOrder;                        ///< The order for the background fitting
    4246    pmSubtractionMode mode;             ///< Mode for subtraction
    43     int numCols, numRows;               ///< Size of image (for normalisation), or zero to use image provided
    4447    psVector *solution1, *solution2;    ///< Solution for the PSF matching
    4548    // Quality information
    4649    float mean, rms;                    ///< Mean and RMS of chi^2 from stamps
    4750    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
    4858} pmSubtractionKernels;
     59
     60// pmSubtractionKernels->preCalc is an array of pmSubtractionKernelPreCalc structures
     61typedef 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;
    4970
    5071// Assertion to check pmSubtractionKernels
     
    6485        PS_ASSERT_VECTOR_SIZE((KERNELS)->widths, (KERNELS)->num, RETURNVALUE); \
    6586    } \
     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) { \
     98        PS_ASSERT_VECTOR_NON_NULL((KERNELS)->widths, RETURNVALUE); \
     99        PS_ASSERT_VECTOR_TYPE((KERNELS)->widths, PS_TYPE_F32, RETURNVALUE); \
     100        PS_ASSERT_VECTOR_SIZE((KERNELS)->widths, (KERNELS)->num, RETURNVALUE); \
     101    } \
    66102    if ((KERNELS)->uStop || (KERNELS)->vStop) { \
    67103        PS_ASSERT_VECTOR_NON_NULL((KERNELS)->uStop, RETURNVALUE); \
     
    99135}
    100136
     137// Generate 1D convolution kernel for ISIS
     138psVector *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)
     144psVector *pmSubtractionKernelHERM(float sigma, // Gaussian width
     145                                       int order, // Polynomial order
     146                                       int size // Kernel half-size
     147    );
     148
    101149/// Generate a delta-function grid for subtraction kernels (like the POIS kernel)
    102150bool p_pmSubtractionKernelsAddGrid(pmSubtractionKernels *kernels, ///< The subtraction kernels to append to
     
    114162                                                int spatialOrder, ///< Order of spatial variations
    115163                                                float penalty, ///< Penalty for wideness
     164                                                psRegion bounds,       ///< Bounds for validity
    116165                                                pmSubtractionMode mode ///< Mode for subtraction
    117166    );
     167
     168/// Allocator for pre-calculated kernel data structure
     169pmSubtractionKernelPreCalc *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
    118177
    119178/// Generate POIS kernels
     
    121180                                               int spatialOrder, ///< Order of spatial variations
    122181                                               float penalty, ///< Penalty for wideness
     182                                               psRegion bounds,       ///< Bounds for validity
    123183                                               pmSubtractionMode mode ///< Mode for subtraction
    124184    );
     
    130190                                                    const psVector *orders, ///< Polynomial order of gaussians
    131191                                                    float penalty, ///< Penalty for wideness
     192                                                    psRegion bounds,       ///< Bounds for validity
    132193                                                    pmSubtractionMode mode ///< Mode for subtraction
    133194    );
     
    139200                                               const psVector *orders, ///< Polynomial order of gaussians
    140201                                               float penalty, ///< Penalty for wideness
     202                                               psRegion bounds,       ///< Bounds for validity
    141203                                               pmSubtractionMode mode ///< Mode for subtraction
    142204                                               );
     205
     206/// Generate ISIS + RADIAL_HERM kernels
     207pmSubtractionKernels *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
     217pmSubtractionKernels *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
     227pmSubtractionKernels *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    );
    143235
    144236/// Generate SPAM kernels
     
    148240                                               int binning, ///< Kernel binning factor
    149241                                               float penalty, ///< Penalty for wideness
     242                                               psRegion bounds,       ///< Bounds for validity
    150243                                               pmSubtractionMode mode ///< Mode for subtraction
    151244    );
     
    156249                                                int inner, ///< Inner radius to preserve unbinned
    157250                                                float penalty, ///< Penalty for wideness
     251                                                psRegion bounds,       ///< Bounds for validity
    158252                                                pmSubtractionMode mode ///< Mode for subtraction
    159253    );
     
    166260                                               int inner, ///< Inner radius containing grid of delta functions
    167261                                               float penalty, ///< Penalty for wideness
     262                                               psRegion bounds,       ///< Bounds for validity
    168263                                               pmSubtractionMode mode ///< Mode for subtraction
    169264    );
     
    175270                                                int ringsOrder, ///< Polynomial order
    176271                                                float penalty, ///< Penalty for wideness
     272                                                psRegion bounds,       ///< Bounds for validity
    177273                                                pmSubtractionMode mode ///< Mode for subtraction
    178274    );
     
    189285                                                   int ringsOrder, ///< Polynomial order for RINGS
    190286                                                   float penalty, ///< Penalty for wideness
     287                                                   psRegion bounds,       ///< Bounds for validity
    191288                                                   pmSubtractionMode mode ///< Mode for subtraction
    192289    );
     
    196293    const char *description,            ///< Description of kernel
    197294    int bgOrder,                        ///< Polynomial order for background fitting
     295    psRegion bounds,                    ///< Bounds for validity
    198296    pmSubtractionMode mode              ///< Mode for subtraction
    199297    );
Note: See TracChangeset for help on using the changeset viewer.