IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Dec 17, 2010, 9:57:34 AM (16 years ago)
Author:
eugene
Message:

various modifications to psphotStack: add needed metadata to header; enable multiple PSF-matched images; work to speed up radial aperture photometry; radialAper is now an array (one element per PSF size); better feedback on extended fit skips; clarify processing: main analysis is on the input images (raw or convolved) while radial apertures is on the psf-matched images

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/ipp-20101205/psphot/src/psphotExtendedSourceFits.c

    r29936 r30101  
    1818    int num = psphotFileruleCount(config, filerule);
    1919
     20    // skip the chisq image (optionally?)
     21    int chisqNum = psMetadataLookupS32 (&status, config->arguments, "PSPHOT.CHISQ.NUM");
     22    if (!status) chisqNum = -1;
     23
    2024    // loop over the available readouts
    2125    for (int i = 0; i < num; i++) {
     26        if (i == chisqNum) continue; // skip chisq image
    2227        if (!psphotExtendedSourceFitsReadout (config, view, filerule, i, recipe)) {
    2328            psError (PSPHOT_ERR_CONFIG, false, "failed on to fit extended sources for %s entry %d", filerule, i);
     
    3742    int Nplain = 0;
    3843    int NplainPass = 0;
     44    int Nfaint = 0;
    3945
    4046    psTimerStart ("psphot.extended");
     
    4652    pmReadout *readout = pmFPAviewThisReadout(view, file->fpa);
    4753    psAssert (readout, "missing readout?");
     54
     55    psLogMsg("psphot", PS_LOG_INFO, "extended source fits for image %d", index);
     56    psphotVisualShowImage(readout);
    4857
    4958    pmDetections *detections = psMetadataLookupPtr (&status, readout->analysis, "PSPHOT.DETECTIONS");
     
    167176            PS_ARRAY_ADD_SCALAR(job->args, 0, PS_TYPE_S32); // this is used as a return value for Nplain
    168177            PS_ARRAY_ADD_SCALAR(job->args, 0, PS_TYPE_S32); // this is used as a return value for NplainPass
     178            PS_ARRAY_ADD_SCALAR(job->args, 0, PS_TYPE_S32); // this is used as a return value for Nfain
    169179
    170180            if (false && !psThreadJobAddPending(job)) {
     
    189199                scalar = job->args->data[11];
    190200                NplainPass += scalar->data.S32;
     201                scalar = job->args->data[12];
     202                Nfaint += scalar->data.S32;
    191203                psFree(job);
    192204            }
     
    217229                scalar = job->args->data[11];
    218230                NplainPass += scalar->data.S32;
     231                scalar = job->args->data[12];
     232                Nfaint += scalar->data.S32;
    219233            }
    220234            psFree(job);
     
    227241    psLogMsg ("psphot", PS_LOG_INFO, "  %d convolved models (%d passed)\n", Nconvolve, NconvolvePass);
    228242    psLogMsg ("psphot", PS_LOG_INFO, "  %d plain models (%d passed)\n", Nplain, NplainPass);
     243    psLogMsg ("psphot", PS_LOG_INFO, "  %d too faint to fit\n", Nfaint);
    229244    return true;
    230245}
     
    238253    int NconvolvePass = 0;
    239254    int Nplain = 0;
     255    int Nfaint = 0;
    240256    int NplainPass = 0;
    241257    bool savePics = false;
     
    350366          // limit selection to some SN limit
    351367          assert (source->peak); // how can a source not have a peak?
    352           if (source->peak->SN < SNlim) continue;
     368          if (source->peak->SN < SNlim) {
     369              Nfaint ++;
     370              continue;
     371          }
    353372
    354373          // check on the model type
     
    497516    scalar->data.S32 = NplainPass;
    498517
     518    scalar = job->args->data[12];
     519    scalar->data.S32 = Nfaint;
     520
    499521    return true;
    500522}
Note: See TracChangeset for help on using the changeset viewer.