IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Feb 28, 2022, 2:52:56 PM (4 years ago)
Author:
eugene
Message:

plug a memory leak in FITS table I/O; fix error in PSF fit map scale calculation; add options to use reweighted errors in non-linear source fitting; change concept for source size parameter guess from using the KRON radius to a size based on the second moments

Location:
trunk/psModules
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/psModules

  • trunk/psModules/src/objects/pmModelUtils.c

    r36859 r42093  
    179179// Reff says if this is a model which uses R_eff (like exp or dev) instead of Sigma
    180180// set the parameter values SXX, SXY, SYY
    181 bool pmModelSetShape (float *Sxx, float *Sxy, float *Syy, pmMoments *moments, bool useReff) {
     181// Scale allows some models to increase the guess size relative to Mxx,Myy
     182bool pmModelSetShape (float *Sxx, float *Sxy, float *Syy, pmMoments *moments, bool useReff, float Scale) {
    182183
    183184    psEllipseMoments emoments;
     
    190191
    191192    if (!isfinite(axes.major)) return false;
    192     if (axes.major == 0) return false;
    193193    if (!isfinite(axes.minor)) return false;
    194194    if (!isfinite(axes.theta)) return false;
    195     if (axes.major == 0) return false;
    196 
     195
     196    // set a lower limit to avoid absurd solutions..
     197    // NOTE: I should set the lower limit based on the PSF size, if known
     198    float Rmajor = PS_MAX(1.0, Scale * axes.major);
     199    float Rminor = Rmajor * (axes.minor / axes.major);
     200    axes.major = Rmajor;
     201    axes.minor = Rminor;
     202
     203    // EAM 2022.02.05 : Mrf is often much too large, disable this for now
    197204    // Mxx, Mxy, Myy define the elliptical shape, but Mrf defines the width
    198     float scale = (isfinite(moments->Mrf) && (moments->Mrf > 0.0)) ? moments->Mrf / axes.major : 1.0;
    199     axes.major *= scale;
    200     axes.minor *= scale;
     205    // float scale = (isfinite(moments->Mrf) && (moments->Mrf > 0.0)) ? moments->Mrf / axes.major : 1.0;
     206    // axes.major *= scale;
     207    // axes.minor *= scale;
    201208
    202209    pmModelAxesToParams (Sxx, Sxy, Syy, axes, useReff);
Note: See TracChangeset for help on using the changeset viewer.