IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jan 29, 2010, 6:02:38 PM (16 years ago)
Author:
Paul Price
Message:

Fairly extensive change to make subtractions more stable on images with limited lit area in the presence of spatial variation. Took the polynomials which were scaled over the entire image and scale them only over the lit area. Removed some fprintf statements. Fixed the problem causing the background term to always come out 1.0.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/20091201/psModules/src/imcombine/pmSubtractionKernels.h

    r26593 r26739  
    1212    PM_SUBTRACTION_KERNEL_ISIS_RADIAL,  ///< ISIS + higher-order radial Hermitians
    1313    PM_SUBTRACTION_KERNEL_HERM,         ///< Hermitian polynomial kernels
    14     PM_SUBTRACTION_KERNEL_DECONV_HERM,  ///< Deconvolved Hermitian polynomial kernels
     14    PM_SUBTRACTION_KERNEL_DECONV_HERM,  ///< Deconvolved Hermitian polynomial kernels
    1515    PM_SUBTRACTION_KERNEL_SPAM,         ///< Summed Pixels for Advanced Matching --- summed delta functions
    1616    PM_SUBTRACTION_KERNEL_FRIES,        ///< Fibonacci Radius Increases Excellence of Subtraction
     
    3232    pmSubtractionKernelsType type;      ///< Type of kernels --- allowing the use of multiple kernels
    3333    psString description;               ///< Description of the kernel parameters
     34    int xMin, xMax, yMin, yMax;         ///< Bounds of image (for normalisation)
    3435    long num;                           ///< Number of kernel components (not including the spatial ones)
    3536    psVector *u, *v;                    ///< Offset (for POIS) or polynomial order (for ISIS, HERM or DECONV_HERM)
     
    4445    int bgOrder;                        ///< The order for the background fitting
    4546    pmSubtractionMode mode;             ///< Mode for subtraction
    46     int numCols, numRows;               ///< Size of image (for normalisation), or zero to use image provided
    4747    psVector *solution1, *solution2;    ///< Solution for the PSF matching
    4848    // Quality information
    4949    float mean, rms;                    ///< Mean and RMS of chi^2 from stamps
    5050    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
     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
    5858} pmSubtractionKernels;
    5959
    6060// pmSubtractionKernels->preCalc is an array of pmSubtractionKernelPreCalc structures
    6161typedef 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
     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
    6969} pmSubtractionKernelPreCalc;
    7070
     
    162162                                                int spatialOrder, ///< Order of spatial variations
    163163                                                float penalty, ///< Penalty for wideness
     164                                                psRegion bounds,       ///< Bounds for validity
    164165                                                pmSubtractionMode mode ///< Mode for subtraction
    165166    );
     
    168169pmSubtractionKernelPreCalc *pmSubtractionKernelPreCalcAlloc(
    169170    pmSubtractionKernelsType type, ///< type of kernel to allocate (not all can be pre-calculated)
    170     int uOrder,                    ///< order in x-direction
    171     int vOrder,                    ///< order in x-direction
    172     int size,                      ///< Half-size of the kernel
    173     float sigma                    ///< sigma of gaussian kernel
     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
    174175    );
    175176
     
    179180                                               int spatialOrder, ///< Order of spatial variations
    180181                                               float penalty, ///< Penalty for wideness
     182                                               psRegion bounds,       ///< Bounds for validity
    181183                                               pmSubtractionMode mode ///< Mode for subtraction
    182184    );
     
    188190                                                    const psVector *orders, ///< Polynomial order of gaussians
    189191                                                    float penalty, ///< Penalty for wideness
     192                                                    psRegion bounds,       ///< Bounds for validity
    190193                                                    pmSubtractionMode mode ///< Mode for subtraction
    191194    );
     
    197200                                               const psVector *orders, ///< Polynomial order of gaussians
    198201                                               float penalty, ///< Penalty for wideness
     202                                               psRegion bounds,       ///< Bounds for validity
    199203                                               pmSubtractionMode mode ///< Mode for subtraction
    200204                                               );
     
    202206/// Generate ISIS + RADIAL_HERM kernels
    203207pmSubtractionKernels *pmSubtractionKernelsISIS_RADIAL(int size, ///< Half-size of the kernel
    204                                                       int spatialOrder, ///< Order of spatial variations
    205                                                       const psVector *fwhms, ///< Gaussian FWHMs
    206                                                       const psVector *orders, ///< Polynomial order of gaussians
    207                                                       float penalty, ///< Penalty for wideness
    208                                                       pmSubtractionMode mode ///< Mode for subtraction
     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
    209214                                               );
    210215
     
    215220                                               const psVector *orders, ///< order of hermitian polynomials
    216221                                               float penalty, ///< Penalty for wideness
     222                                               psRegion bounds,       ///< Bounds for validity
    217223                                               pmSubtractionMode mode ///< Mode for subtraction
    218224                                               );
     
    220226/// Generate DECONV_HERM kernels
    221227pmSubtractionKernels *pmSubtractionKernelsDECONV_HERM(int size, ///< Half-size of the kernel
    222                                                      int spatialOrder, ///< Order of spatial variations
    223                                                      const psVector *fwhms, ///< Gaussian FWHMs
    224                                                      const psVector *orders, ///< order of hermitian polynomials
    225                                                      float penalty, ///< Penalty for wideness
    226                                                      pmSubtractionMode mode ///< Mode for subtraction
     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
    227234    );
    228235
     
    233240                                               int binning, ///< Kernel binning factor
    234241                                               float penalty, ///< Penalty for wideness
     242                                               psRegion bounds,       ///< Bounds for validity
    235243                                               pmSubtractionMode mode ///< Mode for subtraction
    236244    );
     
    241249                                                int inner, ///< Inner radius to preserve unbinned
    242250                                                float penalty, ///< Penalty for wideness
     251                                                psRegion bounds,       ///< Bounds for validity
    243252                                                pmSubtractionMode mode ///< Mode for subtraction
    244253    );
     
    251260                                               int inner, ///< Inner radius containing grid of delta functions
    252261                                               float penalty, ///< Penalty for wideness
     262                                               psRegion bounds,       ///< Bounds for validity
    253263                                               pmSubtractionMode mode ///< Mode for subtraction
    254264    );
     
    260270                                                int ringsOrder, ///< Polynomial order
    261271                                                float penalty, ///< Penalty for wideness
     272                                                psRegion bounds,       ///< Bounds for validity
    262273                                                pmSubtractionMode mode ///< Mode for subtraction
    263274    );
     
    274285                                                   int ringsOrder, ///< Polynomial order for RINGS
    275286                                                   float penalty, ///< Penalty for wideness
     287                                                   psRegion bounds,       ///< Bounds for validity
    276288                                                   pmSubtractionMode mode ///< Mode for subtraction
    277289    );
     
    281293    const char *description,            ///< Description of kernel
    282294    int bgOrder,                        ///< Polynomial order for background fitting
     295    psRegion bounds,                    ///< Bounds for validity
    283296    pmSubtractionMode mode              ///< Mode for subtraction
    284297    );
Note: See TracChangeset for help on using the changeset viewer.