IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Dec 10, 2013, 2:55:11 PM (12 years ago)
Author:
eugene
Message:

merge changes from eam_branches/ipp-20130904

Location:
trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk

  • trunk/psModules

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

    r36085 r36375  
    135135        }
    136136
     137        if (min->isInteractive) {
     138            fprintf (stderr, "%d : ", min->iter);
     139            for (int ti = 0; ti < params->n; ti++) {
     140                fprintf (stderr, "%f  ", params->data.F32[ti]);
     141            }
     142            fprintf (stderr, " : %f\n", min->value);
     143        }
     144
    137145        char key[10]; // used for interactive responses
    138146        bool testValue = false;
     
    140148        // set a new guess for Alpha, Beta, Params
    141149        if (!psMinLM_GuessABP(Alpha, Beta, Params, alpha, beta, params, paramMask, checkLimits, lambda, &dLinear)) {
    142             if (min->isInteractive) {
     150            if (false && min->isInteractive) {
    143151                fprintf (stdout, "guess failed (singular matrix or NaN values), continue? [Y,n] ");
    144152                if (!fgets(key, 8, stdin)) {
     
    167175        }
    168176
    169         if (min->isInteractive) {
     177        if (false && min->isInteractive) {
    170178            p_psVectorPrint(psTraceGetDestination(), Params, "current parameters: ");
    171179            fprintf (stdout, "last chisq : %f\n", min->value);
     
    473481# else
    474482    if (pcm->use1Dgauss) {
    475         // do not use the threaded, mask-aware version of this code (psImageSmoothMaskPixelsThread):
    476         // * the model flux is not masked
    477         // * threading takes place above this level
    478         pcm->modelConvFlux = psImageCopy (pcm->modelConvFlux, pcm->modelFlux, pcm->modelFlux->type.type);
    479         psImageSmooth_PreAlloc_F32 (pcm->modelConvFlux, pcm->smdata);
    480         // psImageSmooth (pcm->modelConvFlux, pcm->sigma, pcm->nsigma);
     483
     484        if (USE_1D_CACHE) {
     485            // do not use the threaded, mask-aware version of this code (psImageSmoothMaskPixelsThread):
     486            // * the model flux is not masked
     487            // * threading takes place above this level
     488            pcm->modelConvFlux = psImageCopy (pcm->modelConvFlux, pcm->modelFlux, pcm->modelFlux->type.type);
     489            psImageSmoothCache_F32 (pcm->modelConvFlux, pcm->smdata);
     490        } else {
     491            pcm->modelConvFlux = psImageCopy (pcm->modelConvFlux, pcm->modelFlux, pcm->modelFlux->type.type);
     492            psImageSmooth2dCache_F32 (pcm->modelConvFlux, pcm->smdata2d);
     493        }
    481494    } else {
    482495        psImageConvolveKernel (pcm->modelConvFlux, pcm->modelFlux, NULL, 0, pcm->psfFFT);
     
    493506# else
    494507        if (pcm->use1Dgauss) {
    495             // do not use the threaded, mask-aware version of this code (psImageSmoothMaskPixelsThread):
    496             // * the model flux is not masked
    497             // * threading takes place above this level
    498             dmodelConv = psImageCopy (dmodelConv, dmodel, dmodel->type.type);
    499             psImageSmooth_PreAlloc_F32 (dmodelConv, pcm->smdata);
    500             // psImageSmooth (dmodelConv, pcm->sigma, pcm->nsigma);
     508            if (USE_1D_CACHE) {
     509                // do not use the threaded, mask-aware version of this code (psImageSmoothMaskPixelsThread):
     510                // * the model flux is not masked
     511                // * threading takes place above this level
     512                dmodelConv = psImageCopy (dmodelConv, dmodel, dmodel->type.type);
     513                psImageSmoothCache_F32 (dmodelConv, pcm->smdata);
     514            } else {
     515                dmodelConv = psImageCopy (dmodelConv, dmodel, dmodel->type.type);
     516                psImageSmooth2dCache_F32 (dmodelConv, pcm->smdata2d);
     517            }
    501518        } else {
    502519            psImageConvolveKernel (dmodelConv, dmodel, NULL, 0, pcm->psfFFT);
     
    514531
    515532        if (pcm->use1Dgauss) {
    516             // do not use the threaded, mask-aware version of this code (psImageSmoothMaskPixelsThread):
    517             // * the model flux is not masked
    518             // * threading takes place above this level
    519             dmodelConv = psImageCopy (dmodelConv, dmodel, dmodel->type.type);
    520             psImageSmooth_PreAlloc_F32 (dmodelConv, pcm->smdata);
    521             // psImageSmooth (dmodelConv, pcm->sigma, pcm->nsigma);
     533            if (USE_1D_CACHE) {
     534                // do not use the threaded, mask-aware version of this code (psImageSmoothMaskPixelsThread):
     535                // * the model flux is not masked
     536                // * threading takes place above this level
     537                dmodelConv = psImageCopy (dmodelConv, dmodel, dmodel->type.type);
     538                psImageSmoothCache_F32 (dmodelConv, pcm->smdata);
     539            } else {
     540                dmodelConv = psImageCopy (dmodelConv, dmodel, dmodel->type.type);
     541                psImageSmooth2dCache_F32 (dmodelConv, pcm->smdata2d);
     542            }
    522543        } else {
    523544            psImageConvolveFFT (dmodelConv, dmodel, NULL, 0, pcm->psf);
     
    541562    static int Npass = 0;
    542563    char name[128];
    543     snprintf (name, 128, "psf.%03d.fits", Npass); psphotSaveImage (NULL, pcm->psf->image, name);
     564    if (!pcm->use1Dgauss) {
     565      snprintf (name, 128, "psf.%03d.fits", Npass); psphotSaveImage (NULL, pcm->psf->image, name);
     566    }
    544567    snprintf (name, 128, "mod.%03d.fits", Npass); psphotSaveImage (NULL, pcm->modelFlux, name);
    545568    snprintf (name, 128, "cnv.%03d.fits", Npass); psphotSaveImage (NULL, pcm->modelConvFlux, name);
     
    579602
    580603            float ymodel  = pcm->modelConvFlux->data.F32[i][j];
    581             float yweight = 1.0 / source->variance->data.F32[i][j];
     604
     605            // XXXX note this point here:::
     606            float yweight = pcm->poissonErrors ? 1.0 / source->variance->data.F32[i][j] : 1.0;
    582607            float delta = ymodel - source->pixels->data.F32[i][j];
    583608
Note: See TracChangeset for help on using the changeset viewer.