IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Nov 2, 2007, 4:28:24 PM (19 years ago)
Author:
Paul Price
Message:

Adding function pmSubtractionOrder (choice of name is probably not the best) to determine which of the two images under consideration should be convolved to match the other. Originally was doing this by solving for a RING kernel of width 1, going both ways, and comparing the deviations for each. However, when doing stacks this didn't work (convolving the wider fake Gaussian image gave smaller deviations than convolving the narrower input image), so have settled on measuring the second moments for each stamp, and using the ratio of moments between the two images to determine which is wider; this seems to work for both subtracting and stacking images. In the process, plugged a few memory leaks, and added code to support convolving either way (or both ways; this will be useful when it comes time to code the dual convolution algorithm).

File:
1 edited

Legend:

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

    r14802 r15443  
    99typedef enum {
    1010    PM_SUBTRACTION_STAMP_INIT,          ///< Initial state
     11    PM_SUBTRACTION_STAMP_FOUND,         ///< Found a suitable source for this stamp
     12    PM_SUBTRACTION_STAMP_CALCULATE,     ///< Calculate matrix and vector values for this stamp
    1113    PM_SUBTRACTION_STAMP_USED,          ///< Use this stamp
    1214    PM_SUBTRACTION_STAMP_REJECTED,      ///< This stamp has been rejected
    13     PM_SUBTRACTION_STAMP_CALCULATE,     ///< Calculate matrix and vector values for this stamp
    1415    PM_SUBTRACTION_STAMP_NONE           ///< No stamp in this region
    1516} pmSubtractionStampStatus;
     
    5455    float flux;                         ///< Flux
    5556    float xNorm, yNorm;                 ///< Normalised position
    56     psKernel *reference;                ///< Reference image postage stamp
    57     psKernel *input;                    ///< Input image postage stamp
     57    psKernel *image1;                   ///< Reference image postage stamp
     58    psKernel *image2;                   ///< Input image postage stamp
    5859    psKernel *weight;                   ///< Weight image postage stamp
    59     psArray *convolutions;              ///< Convolutions of the reference for each kernel component
     60    psArray *convolutions1;             ///< Convolutions of image 1 for each kernel component
     61    psArray *convolutions2;             ///< Convolutions of image 2 for each kernel component
    6062    psImage *matrix;                    ///< Associated matrix
    6163    psVector *vector;                   ///< Assoicated vector
     
    7274                                                const psRegion *region, ///< Region to search, or NULL
    7375                                                float threshold, ///< Threshold for stamps in the image
    74                                                 float spacing ///< Rough spacing for stamps
     76                                                float spacing, ///< Rough spacing for stamps
     77                                                pmSubtractionMode mode ///< Mode for subtraction
    7578    );
    7679
    7780/// Set stamps based on a list of x,y
    78 ///
    79 /// We may optionally apply an exclusion zone around each star --- this is important when we're convolving to
    80 /// a specified PSF; less so when we're only trying to get a good subtraction.
    8181pmSubtractionStampList *pmSubtractionStampsSet(const psVector *x, ///< x coordinates for each stamp
    8282                                               const psVector *y, ///< y coordinates for each stamp
     
    8686                                               const psRegion *region, ///< Region to search, or NULL
    8787                                               float spacing, ///< Rough spacing for stamps
    88                                                int exclusionZone ///< Exclusion zone around each star
     88                                               pmSubtractionMode mode ///< Mode for subtraction
    8989    );
    9090
    91 ///
     91/// Set stamps based on a list of sources
    9292pmSubtractionStampList *pmSubtractionStampsSetFromSources(
    93     const psArray *sources, ///< Sources for each stamp
    94     const psImage *subMask, ///< Mask, or NULL
    95     const psRegion *region, ///< Region to search, or NULL
    96     float spacing, ///< Rough spacing for stamps
    97     int exclusionZone ///< Exclusion zone around each star
     93    const psArray *sources,             ///< Sources for each stamp
     94    const psImage *subMask,             ///< Mask, or NULL
     95    const psRegion *region,             ///< Region to search, or NULL
     96    float spacing,                      ///< Rough spacing for stamps
     97    pmSubtractionMode mode              ///< Mode for subtraction
     98    );
     99
     100/// Set stamps based on values in a file
     101pmSubtractionStampList *pmSubtractionStampsSetFromFile(
     102    const char *filename,               ///< Filename of file containing x,y (or x,y,flux) on each line
     103    const psImage *subMask,             ///< Mask, or NULL
     104    const psRegion *region,             ///< Region to search, or NULL
     105    float spacing,                      ///< Rough spacing for stamps
     106    pmSubtractionMode mode              ///< Mode for subtraction
    98107    );
    99108
     
    107116    );
    108117
    109 /// Generate target for stamps based on list
    110 bool pmSubtractionStampsGenerate(pmSubtractionStampList *stamps, ///< Stamps
    111                                  float fwhm, ///< FWHM for each stamp
    112                                  int footprint, ///< Stamp footprint size
    113                                  int size ///< Kernel half-size
    114     );
    115 
    116118#endif
Note: See TracChangeset for help on using the changeset viewer.