IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 6495


Ignore:
Timestamp:
Feb 24, 2006, 6:32:38 PM (20 years ago)
Author:
eugene
Message:

added profile enabling, some attempts at optimization

Location:
trunk/psphot
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/psphot/configure.ac

    r6310 r6495  
    2424)
    2525
     26dnl handle profiler building
     27AC_ARG_ENABLE(profile,
     28  [AS_HELP_STRING(--enable-profile,enable compiler profiler information inclusion)],
     29  [AC_MSG_RESULT(compile optimization enabled)
     30   CFLAGS="${CFLAGS=} -pg"]
     31)
     32
    2633AC_CHECK_LIB(jpeg,jpeg_CreateCompress,[],[AC_MSG_ERROR([jpeg library not found.])])
    2734PKG_CHECK_MODULES(PSLIB, pslib >= 0.9.0)
  • trunk/psphot/src/pmModelFitSet.c

    r6481 r6495  
    3838    psF32 *dPAR = oneDeriv->data.F32;
    3939
     40    psF32 *pars = params->data.F32;
     41    psF32 *dpars = (deriv == NULL) ? NULL : deriv->data.F32;
     42
    4043    int nSrc = (params->n - 1) / (nPar - 1);
    4144
    42     model = params->data.F32[0];
    43 
    44     PAR[0] = params->data.F32[0];
     45    PAR[0] = model = pars[0];
    4546    for (int i = 0; i < nSrc; i++) {
     47        int nOff = i*nPar - i;
    4648        for (int n = 1; n < nPar; n++) {
    47             PAR[n] = params->data.F32[i*nPar - i + n];
     49            PAR[n] = pars[nOff + n];
    4850        }
    49         value = mFunc (oneDeriv, onePar, x);
     51        if (deriv == NULL) {
     52            value = mFunc (NULL, onePar, x);
     53        } else {
     54            value = mFunc (oneDeriv, onePar, x);
     55            for (int n = 1; n < nPar; n++) {
     56                dpars[nOff + n] = dPAR[n];
     57            }
     58        }
    5059        model += value;
    51         for (int n = 1; n < nPar; n++) {
    52             deriv->data.F32[i*nPar - i + n] = dPAR[n];
    53         }
    5460    }
    55     deriv->data.F32[0] = dPAR[0]*2.0;
     61    if (deriv != NULL) {
     62        dpars[0] = dPAR[0]*2.0;
     63    }
    5664    return (model);
    5765}
  • trunk/psphot/src/psphotApResid.c

    r6379 r6495  
    1111
    1212    psTimerStart ("psphot");
     13
     14    // S/N limit to perform full non-linear fits
     15    float FIT_SN_LIM = psMetadataLookupF32 (&status, config, "FULL_FIT_SN_LIM");
    1316
    1417    // measure the aperture loss as a function of radius for PSF
     
    3740        if (source->mode &  PM_SOURCE_POOR) continue;
    3841
     42        // XXX tune independently?
     43        if (source->moments->SN < 2*FIT_SN_LIM) continue;
     44
    3945        // get uncorrected magnitudes in scaled apertures
    4046        model = pmSourceMagnitudes (source, NULL, 0);
  • trunk/psphot/src/psphotBlendFit.c

    r6481 r6495  
    44bool psphotBlendFit (pmReadout *readout, psMetadata *config, psArray *sources, pmPSF *psf) {
    55
     6    int Nfit = 0;
    67    bool status;
    78
     
    4546        // replace object in image
    4647        pmSourceAddModel (source->pixels, source->mask, source->modelPSF, false, false);
     48        Nfit ++;
    4749
    4850        psTrace ("psphot.blend", 5, "trying source at %f, %f\n", source->moments->x, source->moments->y);
     
    6062    }
    6163
    62     psLogMsg ("psphot", 3, "fit PSF models: %f sec for %d objects\n", psTimerMark ("psphot"), sources->n);
     64    psLogMsg ("psphot", 3, "fit PSF models: %f sec for %d objects (%d total)\n", psTimerMark ("psphot"), Nfit, sources->n);
    6365    return (true);
    6466}
  • trunk/psphot/src/psphotFindPeaks.c

    r6481 r6495  
    2222    psImageSmooth (smooth_wt, SIGMA, NSIGMA);
    2323    psLogMsg ("psphot", 4, "smooth weight: %f sec\n", psTimerMark ("psphot"));
     24
     25    // psphotSaveImage (NULL, smooth_im, "smooth.fits");
    2426
    2527    psTimerStart ("psphot");
  • trunk/psphot/src/psphotMagnitudes.c

    r6117 r6495  
    7676    bool status;
    7777
     78    psTimerStart ("psphot");
     79
    7880    float RADIUS = psMetadataLookupF32 (&status, config, "AP_RADIUS");
    7981    for (int i = 0; i < sources->n; i++) {
     
    8183        pmSourceMagnitudes (source, psf, RADIUS);
    8284    }   
     85
     86    psLogMsg ("psphot.magnitudes", 4, "measure magnitudes : %f sec for %d objects\n", psTimerMark ("psphot"), sources->n);
    8387    return true;
    8488}
  • trunk/psphot/src/psphotOutput.c

    r6481 r6495  
    175175
    176176    bool status;
    177     char *outputFile;
     177    char *outputFile = NULL;
    178178
    179179    psMetadata *header = pmReadoutGetHeader (readout);
  • trunk/psphot/src/psphotSourceStats.c

    r6427 r6495  
    2626        // allocate image, weight, mask arrays for each peak (square of radius OUTER)
    2727        psphotDefinePixels (source, readout, source->peak->x, source->peak->y, OUTER);
     28
     29        // XXX skip faint sources?
    2830
    2931        // measure a local sky value
Note: See TracChangeset for help on using the changeset viewer.