IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 33612


Ignore:
Timestamp:
Mar 25, 2012, 8:47:52 PM (14 years ago)
Author:
eugene
Message:

some tests with KRON_ITERATIONS

Location:
branches/eam_branches/ipp-20111122/psphot/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/ipp-20111122/psphot/src/psphotKronIterate.c

    r32850 r33612  
    8383    if (!status) {
    8484        MIN_KRON_RADIUS = 0.25*RADIUS;
     85    }
     86
     87    int KRON_ITERATIONS = psMetadataLookupS32 (&status, recipe, "KRON_ITERATIONS");
     88    if (!status) {
     89        KRON_ITERATIONS = 2;
    8590    }
    8691
     
    140145            PS_ARRAY_ADD_SCALAR(job->args, RADIUS,             PS_TYPE_F32);
    141146            PS_ARRAY_ADD_SCALAR(job->args, MIN_KRON_RADIUS,    PS_TYPE_F32);
     147            PS_ARRAY_ADD_SCALAR(job->args, KRON_ITERATIONS,    PS_TYPE_S32);
    142148
    143149// set this to 0 to run without threading
    144 # if (1)
     150# if (0)
    145151            if (!psThreadJobAddPending(job)) {
    146152                psError(PS_ERR_UNKNOWN, false, "Unable to guess model.");
     
    150156            if (!psphotKronIterate_Threaded(job)) {
    151157                psError(PS_ERR_UNKNOWN, false, "Unable to guess model.");
    152                 psFree(AnalysisRegion);
    153158                return false;
    154159            }
     
    188193    float RADIUS                    = PS_SCALAR_VALUE(job->args->data[5],F32);
    189194    float MIN_KRON_RADIUS           = PS_SCALAR_VALUE(job->args->data[6],F32);
     195    int KRON_ITERATIONS             = PS_SCALAR_VALUE(job->args->data[7],S32);
    190196
    191197    // XXX TEST : set iteration to 1
    192     for (int j = 0; j < 1; j++) {
     198    for (int j = 0; j < KRON_ITERATIONS; j++) {
    193199        for (int i = 0; i < sources->n; i++) {
    194200
     
    217223            // XXX float windowRadius = PS_MIN(PS_MAX(RADIUS, 4.0*source->moments->Mrf), maxWindow);
    218224
     225            // Sextractor apparently takes something like the skyRadius window, measures the moments inside that window,
     226            // then uses an elliptical outline based on the 2nd moments, but 6x the size
     227
    219228            // XXX TEST : use a window based on the radial profile numbers: max is skyRadius, min is RADIUS
    220229            // if we lack the skyRadius (eg MATCHED sources), go to the default value
    221             float maxWindow = isfinite(source->skyRadius) ? source->skyRadius : RADIUS;
    222             float windowRadius = PS_MAX(RADIUS, maxWindow);
     230            float maxWindow, windowRadius;
     231           
     232            if (j == 0) {
     233                maxWindow = isfinite(source->skyRadius) ? source->skyRadius : RADIUS;
     234                windowRadius = PS_MAX(RADIUS, maxWindow);
     235            } else {
     236                maxWindow = isfinite(source->moments->Mrf) ? 6.0*source->moments->Mrf : RADIUS;
     237                windowRadius = PS_MAX(RADIUS, maxWindow);
     238            }
    223239
    224240            // re-allocate image, weight, mask arrays for each peak with box big enough to fit BIG_RADIUS
  • branches/eam_branches/ipp-20111122/psphot/src/psphotSetThreads.c

    r32633 r33612  
    3030    psFree(task);
    3131
    32     task = psThreadTaskAlloc("PSPHOT_KRON_ITERATE", 7);
     32    task = psThreadTaskAlloc("PSPHOT_KRON_ITERATE", 8);
    3333    task->function = &psphotKronIterate_Threaded;
    3434    psThreadTaskAdd(task);
Note: See TracChangeset for help on using the changeset viewer.