IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Aug 20, 2010, 1:14:11 PM (16 years ago)
Author:
eugene
Message:

Many changes:

  • psphot-related issues

1) added a new feature to psLib/src/fft/psImageFFT to allow for a pre-FFTed kernel generated for a specific image dimension which can then be applied to an arbitrary number of images for convolution -- this avoids the kernel FFT for every image convolution.
2) updated the psMinimizeLMM to include 2 levels of tolerance: minTol and maxTol: if the minimization reaches minTol, it stops. if it only reaches maxTol within maxIter, it stops and is considered successful, if it fails to reach maxTol, then it fails. This allows us to accept fits that are actually acceptable (within error) even if they are not as close as ideally possible.
3) add new stat: psfWeightNotPoor (vs psfWeightNotBad) : the first gives the fraction of psf-weighted unmasked pixels considering any mask bits (except the internal 'mark' bit), while the former considers only 'bad' mask bits -- these are written to QF_PSF and QF_PSF_PERFECT in the CMF files.
4) define user-set parameters for max and min valid flux in the linear fit analysis: Note this was the cause of the non-negative fluxes in forced photometry -- the min limit was hard-wired to 0.0.
5) significance image is now constructed as (image + (image/1000)2) / sqrt(variance) so that bright sources have well-defined peaks (other wise, they become somewhat flat-topped as image = sqrt(variance), leading to ill-defined peaks).
6) modification of the visualization functions to accept facility and level values akin to psTrace
7) modification of the source fitting APIs to allow thread- and source- independent fit options (iterations, tolerances, etc)
8) use Kron magnitude as test for source size (CR vs EXT) instead of PSF-based aperture
9) set a min systematic error in the aperture mags when used for size classification significance
10) threaded the psf-convolved model (PCM) fitting process (extended source fits)
11) for extended sources, adjust the radius based on the footprint and re-calculate moments for guess; save the psf-based moments for output in psf table
12) for Sersic fitting, choose the best index with a grid search using only a few iterations; iterate fully on the selected value.
13) same for Sersic fitting using the PCM fitting process
14) fixed a bug in which the PSF candidate stars which failed in the psf fitting were not correctly unmarked as being PSF stars
15) define galaxy fit radius based on sky stdev (global, not local)
16) move the PCM code to psModules
17) save and report the raw aperture mag in addition to the curve-of-growth corrected one (PS1_V3)
18) save and report the Kron parameters and higher-order moments
19) some psModule header reorganization for code clarity
20) fixed a bug in which the diff stats were counting 'marked' pixels (outside area of interest) as 'masked'.
21) save the radial profile aperture sizes in the headers
22) better guess for Sersic parameters based on moments (requires setting the functional form so that the scale length is right)

  • ppSub-related:

1) ensure masked pixels are NANed in output diff image
2) add code to flag detections if they have bright positive neighbors (+ output of these in PS1_DV2)
3) define separate penalties for each image (based on their fwhm values) (this requires the penalties to be calculated later in the code).
4) define separate apertures for each image for flux normalization
5) choose aperture based on curve-of-growth (was based on fixed fraction of full aperture flux, and thus noisy)
6) some fine tuning of the penalty factor (this still seems arbitrary, and results are somewhat sensitive to the right value)

Location:
trunk/psModules
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/psModules

    • Property svn:mergeinfo deleted
  • trunk/psModules/src/objects/pmSourceFitModel.h

    r21183 r29004  
    1919    PM_SOURCE_FIT_EXT,
    2020    PM_SOURCE_FIT_PSF_AND_SKY,
    21     PM_SOURCE_FIT_EXT_AND_SKY
     21    PM_SOURCE_FIT_EXT_AND_SKY,
     22    PM_SOURCE_FIT_INDEX,
     23    PM_SOURCE_FIT_NO_INDEX,
    2224} pmSourceFitMode;
    2325
    24 bool pmSourceFitModelInit(
    25     float nIter,   ///< max number of allowed iterations
    26     float tol,      ///< convergence criterion
    27     float weight,      ///< use this weight for constant-weight fits
    28     bool poissonErrors   // use poisson errors for fits?
    29 );
     26typedef struct {
     27    pmSourceFitMode mode;               ///< optionally fit all or a subset of parameters
     28    float nIter;                        ///< max number of allowed iterations
     29    float minTol;                       ///< convergence criterion
     30    float maxTol;                       ///< convergence criterion
     31    float maxChisqDOF;                  ///< convergence criterion
     32    float weight;                       ///< use this weight for constant-weight fits
     33    bool poissonErrors;                 ///< use poisson errors for fits?
     34} pmSourceFitOptions;
     35
     36// the pmSourceFitOptions structure is used to control details of the fitting process
     37pmSourceFitOptions *pmSourceFitOptionsAlloc(void);
     38
     39// bool pmSourceFitModelInit(
     40//     pmSourceFitMode mode,            ///< what parameter set should be fitted?
     41//     float nIter,                     ///< max number of allowed iterations
     42//     float tol,                               ///< convergence criterion
     43//     float weight,                    ///< use this weight for constant-weight fits
     44//     bool poissonErrors                       ///< use poisson errors for fits?
     45// );
    3046
    3147/** pmSourceFitModel()
     
    3854 */
    3955bool pmSourceFitModel(
    40     pmSource *source,   ///< The input pmSource
    41     pmModel *model,   ///< model to be fitted
    42     pmSourceFitMode mode,  ///< define parameters to be fitted
     56    pmSource *source,                   ///< The input pmSource
     57    pmModel *model,                     ///< model to be fitted
     58    pmSourceFitOptions *options,        ///< define parameters to be fitted
    4359    psImageMaskType maskVal             ///< Value to mask
    4460);
    4561
    46 
    47 // initialize data for a group of object models
    48 bool pmSourceFitSetInit (pmModelType type);
    49 
    50 // clear data for a group of object models
    51 void pmSourceFitSetClear (void);
    52 
    53 // function used to set limits for a group of models
    54 bool pmSourceFitSet_CheckLimits (psMinConstraintMode mode, int nParam, float *params, float *betas);
    55 
    56 // function used to fit a group of object models
    57 psF32 pmSourceFitSet_Function(psVector *deriv,
    58                               const psVector *params,
    59                               const psVector *x);
    60 
    61 /** pmSourceFitSet()
    62  *
    63  * Fit the requested model to the specified source. The starting guess for the model is given
    64  * by the input source.model parameter values. The pixels of interest are specified by the
    65  * source.pixels and source.mask entries. This function calls psMinimizeLMChi2() on the image
    66  * data. The function returns TRUE on success or FALSE on failure.
    67  *
    68  */
    69 bool pmSourceFitSet(
    70     pmSource *source,   ///< The input pmSource
    71     psArray *modelSet,   ///< model to be fitted
    72     pmSourceFitMode mode,  ///< define parameters to be fitted
    73     psImageMaskType maskVal             ///< Vale to mask
    74 
    75 );
     62// // initialize data for a group of object models
     63// bool pmSourceFitSetInit (pmModelType type);
     64//
     65// // clear data for a group of object models
     66// void pmSourceFitSetClear (void);
     67//
     68// // function used to set limits for a group of models
     69// bool pmSourceFitSet_CheckLimits (psMinConstraintMode mode, int nParam, float *params, float *betas);
     70//
     71// // function used to fit a group of object models
     72// psF32 pmSourceFitSet_Function(psVector *deriv,
     73//                               const psVector *params,
     74//                               const psVector *x);
     75//
     76// /** pmSourceFitSet()
     77//  *
     78//  * Fit the requested model to the specified source. The starting guess for the model is given
     79//  * by the input source.model parameter values. The pixels of interest are specified by the
     80//  * source.pixels and source.mask entries. This function calls psMinimizeLMChi2() on the image
     81//  * data. The function returns TRUE on success or FALSE on failure.
     82//  *
     83//  */
     84// bool pmSourceFitSet(
     85//     pmSource *source,   ///< The input pmSource
     86//     psArray *modelSet,   ///< model to be fitted
     87//     pmSourceFitMode mode,  ///< define parameters to be fitted
     88//     psImageMaskType maskVal          ///< Vale to mask
     89//
     90// );
    7691
    7792/// @}
Note: See TracChangeset for help on using the changeset viewer.