IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Oct 9, 2013, 4:14:19 PM (13 years ago)
Author:
eugene
Message:

merge from trunk

Location:
branches/eam_branches/ipp-20130904/psphot
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/ipp-20130904/psphot

  • branches/eam_branches/ipp-20130904/psphot/src

  • branches/eam_branches/ipp-20130904/psphot/src/psphotExtendedSourceAnalysis.c

    r34404 r36198  
    11# include "psphotInternal.h"
     2void psphotRadialProfileShowSkips ();
    23
    34// measure the elliptical radial profile and use this to measure the petrosian parameters for the sources
     
    3334}
    3435
     36/*** for the moment, this test code : it is not thread safe ***/
     37int    Nall = 0;
     38int  Nskip1 = 0;
     39int  Nskip2 = 0;
     40int  Nskip3 = 0;
     41int  Nskip4 = 0;
     42int  Nskip5 = 0;
     43int  Nskip6 = 0;
     44int  Nskip7 = 0;
     45int  Nskip8 = 0;
     46int  Nskip9 = 0;
     47int Nskip10 = 0;
     48int Nskip11 = 0;
     49int Nskip12 = 0;
     50int Nskip13 = 0;
     51int Nskip14 = 0;
     52
     53# define SKIP(VALUE) { VALUE++; continue; }
     54
    3555// aperture-like measurements for extended sources
    3656bool psphotExtendedSourceAnalysisReadout (pmConfig *config, const pmFPAview *view, const char *filerule, int index, psMetadata *recipe) {
    3757
    3858    bool status;
     59    int NfaintEXT = 0;
     60    int NfaintPSF = 0;
     61
    3962    int Next = 0;
    4063    int Npetro = 0;
     
    108131            PS_ARRAY_ADD_SCALAR(job->args, 0, PS_TYPE_S32); // this is used as a return value for Npetro
    109132            PS_ARRAY_ADD_SCALAR(job->args, 0, PS_TYPE_S32); // this is used as a return value for Nannuli
     133            PS_ARRAY_ADD_SCALAR(job->args, 0, PS_TYPE_S32); // this is used as a return value for NfaintEXT
     134            PS_ARRAY_ADD_SCALAR(job->args, 0, PS_TYPE_S32); // this is used as a return value for NfaintPSF
    110135
    111136// set this to 0 to run without threading
    112 # if (1)           
     137# if (0)           
    113138            if (!psThreadJobAddPending(job)) {
    114139                psError(PS_ERR_UNKNOWN, false, "Unable to guess model.");
     
    129154            scalar = job->args->data[7];
    130155            Nannuli += scalar->data.S32;
     156            scalar = job->args->data[8];
     157            NfaintEXT += scalar->data.S32;
     158            scalar = job->args->data[9];
     159            NfaintPSF += scalar->data.S32;
    131160            psFree(job);
    132161# endif
     
    153182                scalar = job->args->data[7];
    154183                Nannuli += scalar->data.S32;
     184                scalar = job->args->data[8];
     185                NfaintEXT += scalar->data.S32;
     186                scalar = job->args->data[9];
     187                NfaintPSF += scalar->data.S32;
    155188            }
    156189            psFree(job);
     
    163196    psLogMsg ("psphot", PS_LOG_INFO, "  %d petrosian\n", Npetro);
    164197    psLogMsg ("psphot", PS_LOG_INFO, "  %d annuli\n", Nannuli);
     198    psLogMsg ("psphot", PS_LOG_INFO, "  skipped: %d EXT, %d PSF\n", NfaintEXT, NfaintPSF);
     199
     200    fprintf (stderr, "ext analysis skipped @ 1  : %d\n", Nskip1);
     201    fprintf (stderr, "ext analysis skipped @ 2  : %d\n", Nskip2);
     202    fprintf (stderr, "ext analysis skipped @ 3  : %d\n", Nskip3);
     203    fprintf (stderr, "ext analysis skipped @ 4  : %d\n", Nskip4);
     204    fprintf (stderr, "ext analysis skipped @ 5  : %d\n", Nskip5);
     205    fprintf (stderr, "ext analysis skipped @ 6  : %d\n", Nskip6);
     206    fprintf (stderr, "ext analysis skipped @ 7  : %d\n", Nskip7);
     207    fprintf (stderr, "ext analysis skipped @ 8  : %d\n", Nskip8);
     208    fprintf (stderr, "ext analysis skipped @ 9  : %d\n", Nskip9);
     209    fprintf (stderr, "ext analysis skipped @ 10 : %d\n", Nskip10);
     210    fprintf (stderr, "ext analysis skipped @ 11 : %d\n", Nskip11);
     211    fprintf (stderr, "ext analysis skipped @ 12 : %d\n", Nskip12);
     212    fprintf (stderr, "ext analysis skipped @ 13 : %d\n", Nskip13);
     213    fprintf (stderr, "ext analysis skipped @ 14 : %d\n", Nskip14);
     214
     215    psphotRadialProfileShowSkips ();
    165216
    166217    psphotVisualShowResidualImage (readout, false);
     
    177228
    178229    bool status;
     230
     231    int NfaintEXT = 0;
     232    int NfaintPSF = 0;
    179233
    180234    int Next = 0;
     
    207261        pmSource *source = sources->data[i];
    208262
     263        Nall ++;
     264
    209265        // if we have checked the source validity on the basis of the object set, then
    210266        // we either skip these tests below or we skip the source completely
    211         if (source->tmpFlags & PM_SOURCE_TMPF_PETRO_SKIP) continue;
     267        if (source->tmpFlags & PM_SOURCE_TMPF_PETRO_SKIP) SKIP (Nskip1);
    212268        if (source->tmpFlags & PM_SOURCE_TMPF_PETRO_KEEP) goto keepSource;
    213269
    214270        // skip PSF-like and non-astronomical objects
    215         if (source->type == PM_SOURCE_TYPE_DEFECT) continue;
    216         if (source->type == PM_SOURCE_TYPE_SATURATED) continue;
    217         if (source->mode & PM_SOURCE_MODE_DEFECT) continue;
    218         if (source->mode & PM_SOURCE_MODE_SATSTAR) continue;
     271        if (source->type == PM_SOURCE_TYPE_DEFECT) SKIP (Nskip2);
     272        if (source->type == PM_SOURCE_TYPE_SATURATED) SKIP (Nskip3);
     273        if (source->mode & PM_SOURCE_MODE_DEFECT) SKIP (Nskip4);
     274        if (source->mode & PM_SOURCE_MODE_SATSTAR) SKIP (Nskip5);
    219275
    220276        // skip saturated stars modeled with a radial profile
    221         if (source->mode2 & PM_SOURCE_MODE2_SATSTAR_PROFILE) continue;
     277        if (source->mode2 & PM_SOURCE_MODE2_SATSTAR_PROFILE) SKIP (Nskip6);
    222278
    223279        // optionally allow non-extended objects to get petrosians as well
    224280        if (!doPetroStars) {
    225             if (!(source->mode & PM_SOURCE_MODE_EXT_LIMIT)) continue;
    226             if (source->type == PM_SOURCE_TYPE_STAR) continue;
     281            if (!(source->mode & PM_SOURCE_MODE_EXT_LIMIT)) SKIP (Nskip7);
     282            // if (source->type == PM_SOURCE_TYPE_STAR) SKIP (Nskip8); -- XXX this might be set for input lists (instead of EXT_LIMIT)
    227283        }
    228284
     
    233289        if (source->mode & PM_SOURCE_MODE_EXT_LIMIT) {
    234290            skipSource = (source->moments->KronFlux < SN_LIM * source->moments->KronFluxErr);
     291            NfaintEXT ++;
    235292        } else {
    236293            skipSource = (sqrt(source->peak->detValue) < SN_LIM);
    237         }
    238         if (skipSource) continue;
     294            NfaintPSF ++;
     295        }
     296        if (skipSource) SKIP (Nskip9);
    239297
    240298        // limit selection by analysis region (this automatically apply
    241         if (source->peak->x < region->x0) continue;
    242         if (source->peak->y < region->y0) continue;
    243         if (source->peak->x > region->x1) continue;
    244         if (source->peak->y > region->y1) continue;
     299        if (source->peak->x < region->x0) SKIP (Nskip10);
     300        if (source->peak->y < region->y0) SKIP (Nskip11);
     301        if (source->peak->x > region->x1) SKIP (Nskip12);
     302        if (source->peak->y > region->y1) SKIP (Nskip13);
    245303
    246304    keepSource:
     
    266324                psTrace ("psphot", 5, "failed to extract radial profile for source at %7.1f, %7.1f", source->moments->Mx, source->moments->My);
    267325                pmSourceSub (source, PM_MODEL_OP_FULL, maskVal);
    268                 continue;
     326                SKIP (Nskip14);
    269327            }
    270328            Nannuli ++;
     
    304362    scalar->data.S32 = Nannuli;
    305363
     364    scalar = job->args->data[8];
     365    scalar->data.S32 = NfaintEXT;
     366
     367    scalar = job->args->data[9];
     368    scalar->data.S32 = NfaintPSF;
     369
    306370    return true;
    307371}
Note: See TracChangeset for help on using the changeset viewer.