IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Feb 13, 2011, 12:19:53 PM (15 years ago)
Author:
eugene
Message:

some code reorganzation (move all types into pmSubtractionTypes.h); add stage to check on different mode and order options, choosing best based on chisq of subtraction; careful with the window and the kernel sizes: if the measured kron radius is too large, allow the window to grow as needed; use the 1st radial moment measured on the stamps to set the kernel scaling; remove some cruft from the code; calling program now passes in kernel scaling options to be used when 1st radial moment is measured; new function to update the kernel description string used for kernel I/O; update the kernel description after the spatial order and direction is chosen; need to carry the kernel fwhms and spatial order to allow for update; calculate the psf-match solution errors; psf solution now uses the weights to get sensible chisq values, window is used to calculate the moments; penalty scale is now adjusted to be consistent with sensible reduced chisq; improved visualizations; use range-limiter in SVD of 1e-10; calculate chisq and moments for the solution and use in the evaluation; split out the stamp selection / convolution steps; reject sources after fitting a model to the chisq assuming non-zero systematic error

File:
1 edited

Legend:

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

    r29601 r30622  
    22#define PM_SUBTRACTION_KERNELS_H
    33
    4 #include <string.h>
    5 #include <pslib.h>
    6 
    7 /// Type of subtraction kernel
    8 typedef enum {
    9     PM_SUBTRACTION_KERNEL_NONE,         ///< Nothing --- an error
    10     PM_SUBTRACTION_KERNEL_POIS,         ///< Pan-STARRS Optimal Image Subtraction --- delta functions
    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
    15     PM_SUBTRACTION_KERNEL_SPAM,         ///< Summed Pixels for Advanced Matching --- summed delta functions
    16     PM_SUBTRACTION_KERNEL_FRIES,        ///< Fibonacci Radius Increases Excellence of Subtraction
    17     PM_SUBTRACTION_KERNEL_GUNK,         ///< Grid United with Normal Kernel --- POIS and ISIS hybrid
    18     PM_SUBTRACTION_KERNEL_RINGS,        ///< Rings Instead of the Normal Gaussian Subtraction
    19 } pmSubtractionKernelsType;
    20 
    21 /// Modes --- specifies which image to convolve
    22 typedef enum {
    23     PM_SUBTRACTION_MODE_ERR,            // Error in the mode
    24     PM_SUBTRACTION_MODE_1,              // Convolve image 1
    25     PM_SUBTRACTION_MODE_2,              // Convolve image 2
    26     PM_SUBTRACTION_MODE_UNSURE,         // Not sure yet which image to convolve so try to satisfy both
    27     PM_SUBTRACTION_MODE_DUAL,           // Dual convolution
    28 } pmSubtractionMode;
    29 
    30 /// Kernels specification
    31 typedef struct {
    32     pmSubtractionKernelsType type;      ///< Type of kernels --- allowing the use of multiple kernels
    33     psString description;               ///< Description of the kernel parameters
    34     int xMin, xMax, yMin, yMax;         ///< Bounds of image (for normalisation)
    35     long num;                           ///< Number of kernel components (not including the spatial ones)
    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)
    38     psVector *uStop, *vStop;            ///< Width of kernel element (SPAM,FRIES only)
    39     psArray *preCalc;                   ///< Array of images containing pre-calculated kernel (for ISIS, HERM or DECONV_HERM)
    40     float penalty;                      ///< Penalty for wideness
    41     psVector *penalties1;               ///< Penalty for each kernel component
    42     psVector *penalties2;               ///< Penalty for each kernel component
    43     bool havePenalties;                 ///< flag to test if we have already calculated the penalties or not.
    44     int size;                           ///< The half-size of the kernel
    45     int inner;                          ///< The size of an inner region
    46     int spatialOrder;                   ///< The spatial order of the kernels
    47     int bgOrder;                        ///< The order for the background fitting
    48     pmSubtractionMode mode;             ///< Mode for subtraction
    49     psVector *solution1, *solution2;    ///< Solution for the PSF matching
    50     // Quality information
    51     float mean, rms;                    ///< Mean and RMS of chi^2 from stamps
    52     int numStamps;                      ///< Number of good stamps
    53     float fResSigmaMean;                ///< mean fractional stdev of residuals
    54     float fResSigmaStdev;               ///< stdev of fractional stdev of residuals
    55     float fResOuterMean;                ///< mean fractional positive swing in residuals
    56     float fResOuterStdev;               ///< stdev of fractional positive swing in residuals
    57     float fResTotalMean;                ///< mean fractional negative swing in residuals
    58     float fResTotalStdev;               ///< stdev of fractional negative swing in residuals
    59     psArray *sampleStamps;              ///< array of brightest set of stamps for output visualizations
    60 } pmSubtractionKernels;
    61 
    62 // pmSubtractionKernels->preCalc is an array of pmSubtractionKernelPreCalc structures
    63 typedef struct {
    64     psVector *uCoords;                  // used by RINGS
    65     psVector *vCoords;                  // used by RINGS
    66     psVector *poly;                     // used by RINGS
    67 
    68     psVector *xKernel;                  // used by ISIS, HERM, DECONV_HERM
    69     psVector *yKernel;                  // used by ISIS, HERM, DECONV_HERM
    70     psKernel *kernel;                   // used by ISIS, HERM, DECONV_HERM
    71 } pmSubtractionKernelPreCalc;
     4// #include <string.h>
     5// #include <pslib.h>
    726
    737// Assertion to check pmSubtractionKernels
     
    16296                                                pmSubtractionKernelsType type, ///< Kernel type
    16397                                                int size, ///< Half-size of kernel
     98                                                psVector *fwhms, ///< requested kernel basis function
     99                                                psVector *orders,
    164100                                                int spatialOrder, ///< Order of spatial variations
    165101                                                float penalty, ///< Penalty for wideness
     
    303239    );
    304240
     241bool pmSubtractionKernelsMakeDescription(pmSubtractionKernels *kernels);
     242
     243
    305244/// Copy kernels
    306245///
Note: See TracChangeset for help on using the changeset viewer.