IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jan 20, 2011, 11:53:03 AM (15 years ago)
Author:
eugene
Message:

moved subtractionGetStamps to pmSubtractionStamps and renamed as pmSubtractionStampsSelect; added return value to pmSubtractionStampsGetWindow to specify a size retry; if desired normalization window is too large, retry with a larger stamp size; move around structures to prevent annoying build collisions

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/ipp-20101205/psModules/src/imcombine/pmSubtractionStamps.h

    r29543 r30322  
    11#ifndef PM_SUBTRACTION_STAMPS_H
    22#define PM_SUBTRACTION_STAMPS_H
    3 
    4 #include <pslib.h>
    5 
    6 #include "pmSubtractionKernels.h"
    7 
    8 /// Status of stamp
    9 typedef enum {
    10     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
    13     PM_SUBTRACTION_STAMP_USED,          ///< Use this stamp
    14     PM_SUBTRACTION_STAMP_REJECTED,      ///< This stamp has been rejected
    15     PM_SUBTRACTION_STAMP_NONE           ///< No stamp in this region
    16 } pmSubtractionStampStatus;
    17 
    18 /// A list of stamps
    19 typedef struct {
    20     long num;                           ///< Number of stamps
    21     psArray *stamps;                    ///< The stamps
    22     psArray *regions;                   ///< Regions for each stamp
    23     psArray *x, *y;                     ///< Coordinates for possible stamps (or NULL)
    24     psArray *flux;                      ///< Fluxes for possible stamps (or NULL)
    25     int footprint;                      ///< Half-size of stamps
    26     float normFrac;                     ///< Fraction of flux in window for normalisation window
    27     float normValue;                    ///< calculated normalization
    28     float normValue2;                   ///< calculated normalization
    29     psKernel *window1;                  ///< window function generated from ensemble of stamps (input 1)
    30     psKernel *window2;                  ///< window function generated from ensemble of stamps (input 2)
    31     psKernel *window;                   ///< weighting window function (sigma = 1.1 * MAX(fwhm))
    32     float normWindow1;                  ///< Size of window for measuring normalisation
    33     float normWindow2;                  ///< Size of window for measuring normalisation
    34     float sysErr;                       ///< Systematic error
    35     float skyErr;                       ///< increase effective readnoise
    36 } pmSubtractionStampList;
    373
    384/// Allocate a list of stamps
     
    7440    );
    7541
    76 
    77 /// A stamp for image subtraction
    78 typedef struct {
    79     float x, y;                         ///< Position
    80     float flux;                         ///< Flux
    81     float xNorm, yNorm;                 ///< Normalised position
    82     psKernel *image1;                   ///< Reference image postage stamp
    83     psKernel *image2;                   ///< Input image postage stamp
    84     psKernel *weight;                   ///< Weight image (1/variance) postage stamp, or NULL
    85     psArray *convolutions1;             ///< Convolutions of image 1 for each kernel component, or NULL
    86     psArray *convolutions2;             ///< Convolutions of image 2 for each kernel component, or NULL
    87     psImage *matrix;                    ///< Least-squares matrix, or NULL
    88     psVector *vector;                   ///< Least-squares vector, or NULL
    89     double norm;                        ///< Normalisation difference
    90     double normI1;                       ///< Sum(flux) for image 1
    91     double normI2;                       ///< Sum(flux) for image 2
    92     double normSquare1;                 ///< Sum(flux^2) for image 1 (used for penalty)
    93     double normSquare2;                 ///< Sum(flux^2) for image 2 (used for penalty)
    94     pmSubtractionStampStatus status;    ///< Status of stamp
    95     psVector *MxxI1;                    ///< second moments of convolution images
    96     psVector *MyyI1;                    ///< second moments of convolution images
    97     psVector *MxxI2;                    ///< second moments of convolution images
    98     psVector *MyyI2;                    ///< second moments of convolution images
    99     double MxxI1raw;
    100     double MyyI1raw;
    101     double MxxI2raw;
    102     double MyyI2raw;
    103 } pmSubtractionStamp;
    104 
    10542/// Allocate a stamp
    10643pmSubtractionStamp *pmSubtractionStampAlloc(void);
     44
     45// find and extract the stamps
     46bool pmSubtractionStampsSelect(pmSubtractionStampList **stamps, // Stamps to read
     47                               const pmReadout *ro1, // Readout 1
     48                               const pmReadout *ro2, // Readout 2
     49                               const psImage *subMask, // Mask for subtraction, or NULL
     50                               psImage *variance,  // Variance map
     51                               const psRegion *region, // Region of interest
     52                               float thresh1,  // Threshold for stamp finding on readout 1
     53                               float thresh2,  // Threshold for stamp finding on readout 2
     54                               float stampSpacing, // Spacing between stamps
     55                               float normFrac,     // Fraction of flux in window for normalisation window
     56                               float sysError,     // Relative systematic error in images
     57                               float skyError,     // Relative systematic error in images
     58                               int size,         // Kernel half-size
     59                               int footprint,     // Convolution footprint for stamps
     60                               pmSubtractionMode mode // Mode for subtraction
     61    );
     62
    10763
    10864/// Find stamps on an image
     
    172128/// Calculate the window and normalisation window from the stamps
    173129bool pmSubtractionStampsGetWindow(
     130    bool *tryAgain,                     ///< re-try with new stamp size?
    174131    pmSubtractionStampList *stamps,     ///< List of stamps
    175132    int kernelSize                      ///< Half-size of kernel
Note: See TracChangeset for help on using the changeset viewer.