IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Sep 10, 2007, 10:10:05 AM (19 years ago)
Author:
Paul Price
Message:

Preparing to take a (long) list of sources as candidate stamps. Changed the list of stamps from a simple array to a more complicated structure so that I can carry around a list of candidate stamps for each region of interest; when one is rejected, it is replaced by the next brightest within the same region. Optionally apply an exclusion zone around stamps, which is important when we're convolving to a specified PSF (as opposed to convolving to match an image).

File:
1 edited

Legend:

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

    r14701 r14801  
    1515} pmSubtractionStampStatus;
    1616
     17/// A list of stamps
     18typedef struct {
     19    long num;                           ///< Number of stamps
     20    psArray *stamps;                    ///< The stamps
     21    psArray *regions;                   ///< Regions for each stamp
     22    psArray *x, *y;                     ///< Coordinates for possible stamps (or NULL)
     23    psArray *flux;                      ///< Fluxes for possible stamps (or NULL)
     24} pmSubtractionStampList;
     25
     26/// Allocate a list of stamps
     27pmSubtractionStampList *pmSubtractionStampListAlloc(int numCols, // Number of columns in image
     28                                                    int numRows, // Number of rows in image
     29                                                    const psRegion *region, // Region for stamps, or NULL
     30                                                    float spacing // Rough average spacing between stamps
     31    );
     32
     33/// Assertion for stamp list to be valid
     34#define PM_ASSERT_SUBTRACTION_STAMP_LIST_NON_NULL(LIST, RETURNVALUE) { \
     35    PS_ASSERT_PTR_NON_NULL(LIST, RETURNVALUE); \
     36    PS_ASSERT_ARRAY_NON_NULL((LIST)->stamps, RETURNVALUE); \
     37    PS_ASSERT_ARRAY_NON_NULL((LIST)->regions, RETURNVALUE); \
     38    PS_ASSERT_INT_POSITIVE((LIST)->num, RETURNVALUE); \
     39    PS_ASSERT_ARRAY_SIZE((LIST)->stamps, (LIST)->num, RETURNVALUE); \
     40    PS_ASSERT_ARRAY_SIZE((LIST)->regions, (LIST)->num, RETURNVALUE); \
     41    if ((LIST)->x || (LIST)->y || (LIST)->flux) { \
     42        PS_ASSERT_ARRAY_NON_NULL((LIST)->x, RETURNVALUE); \
     43        PS_ASSERT_ARRAY_NON_NULL((LIST)->y, RETURNVALUE); \
     44        PS_ASSERT_ARRAY_NON_NULL((LIST)->flux, RETURNVALUE); \
     45        PS_ASSERT_ARRAY_SIZE((LIST)->x, (LIST)->num, RETURNVALUE); \
     46        PS_ASSERT_ARRAY_SIZE((LIST)->y, (LIST)->num, RETURNVALUE); \
     47        PS_ASSERT_ARRAY_SIZE((LIST)->flux, (LIST)->num, RETURNVALUE); \
     48    } \
     49}
     50
    1751/// A stamp for image subtraction
    1852typedef struct {
     
    2660    psImage *matrix;                    ///< Associated matrix
    2761    psVector *vector;                   ///< Assoicated vector
    28     pmSubtractionStampStatus status;    ///< Status ofstamp
     62    pmSubtractionStampStatus status;    ///< Status of stamp
    2963} pmSubtractionStamp;
    3064
     65/// Allocate a stamp
     66pmSubtractionStamp *pmSubtractionStampAlloc(void);
     67
    3168/// Find stamps on an image
    32 psArray *pmSubtractionFindStamps(psArray *stamps, ///< Output stamps, or NULL
    33                                  const psImage *image, ///< Image for which to find stamps
    34                                  const psImage *mask, ///< Mask, or NULL
    35                                  const psRegion *region, ///< Region in which to search for stamps, or NULL
    36                                  float threshold, ///< Threshold for stamps in the image
    37                                  float spacing ///< Rough spacing for stamps
     69pmSubtractionStampList *pmSubtractionFindStamps(pmSubtractionStampList *stamps, ///< Output stamps, or NULL
     70                                                const psImage *image, ///< Image for which to find stamps
     71                                                const psImage *mask, ///< Mask, or NULL
     72                                                const psRegion *region, ///< Region to search, or NULL
     73                                                float threshold, ///< Threshold for stamps in the image
     74                                                float spacing ///< Rough spacing for stamps
    3875    );
    3976
    4077/// Set stamps based on a list of x,y
    41 psArray *pmSubtractionSetStamps(const psVector *x, ///< x coordinates for each stamp
    42                                 const psVector *y, ///< y coordinates for each stamp
    43                                 const psVector *flux, ///< Flux for each stamp, or NULL
    44                                 const psImage *mask, ///< Mask, or NULL
    45                                 const psRegion *region ///< Region in which to search for stamps, or NULL
     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.
     81pmSubtractionStampList *pmSubtractionSetStamps(const psVector *x, ///< x coordinates for each stamp
     82                                               const psVector *y, ///< y coordinates for each stamp
     83                                               const psVector *flux, ///< Flux for each stamp, or NULL
     84                                               const psImage *image, ///< Image for flux of stamp
     85                                               const psImage *mask, ///< Mask, or NULL
     86                                               const psRegion *region, ///< Region to search, or NULL
     87                                               float spacing, ///< Rough spacing for stamps
     88                                               int exclusionZone // Exclusion zone around each star
    4689    );
    4790
    4891/// Extract stamps from the images
    49 bool pmSubtractionExtractStamps(psArray *stamps, ///< Stamps
     92bool pmSubtractionExtractStamps(pmSubtractionStampList *stamps, ///< Stamps
    5093                                psImage *reference, ///< Reference image
    5194                                psImage *input, ///< Input image (or NULL)
     
    5699
    57100/// Generate target for stamps based on list
    58 bool pmSubtractionGenerateStamps(psArray *stamps, ///< Stamps
     101bool pmSubtractionGenerateStamps(pmSubtractionStampList *stamps, ///< Stamps
    59102                                 float fwhm, ///< FWHM for each stamp
    60103                                 int footprint, ///< Stamp footprint size
Note: See TracChangeset for help on using the changeset viewer.