IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Sep 12, 2010, 12:38:23 PM (16 years ago)
Author:
eugene
Message:

re-scale kernels by fwhm2 to avoid excessive dynamic range; modify residual stats to be more sensible; add threshold to min significant element of SVD inversion (1e-6); adjust penalties again (still not clear what is best...)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/ipp-20100823/psModules/src/imcombine/pmSubtractionVisual.c

    r29126 r29148  
    152152
    153153/** Plot the least-squares matrix of each stamp */
    154 bool pmSubtractionVisualPlotLeastSquares (pmSubtractionStampList *stamps, bool dual) {
     154bool pmSubtractionVisualPlotLeastSquares (pmSubtractionStampList *stamps) {
    155155
    156156    if (!pmVisualTestLevel("ppsub.chisq", 1)) return true;
     
    209209    pmVisualScaleImage(kapa1, canvas32, "Least_Squares", 0, true);
    210210
     211    if (0) {
     212        static int count = 0;
     213        char filename[64];
     214        sprintf (filename, "chisq.%02d.fits", count);
     215        count ++;
     216        psFits *fits = psFitsOpen (filename, "w");
     217        psFitsWriteImage (fits, NULL, canvas32, 0, NULL);
     218        psFitsClose (fits);
     219    }
     220
    211221    pmVisualAskUser(&plotLeastSquares);
    212222    psFree(canvas);
     
    299309        if (!isfinite(stamp->flux)) continue;
    300310        if (!stamp->convolutions1 && !stamp->convolutions2) continue;
     311        fprintf (stderr, "flux: %f, maxFlux: %f  ", stamp->flux, maxFlux);
    301312        if (!maxStamp) {
    302313            maxFlux = stamp->flux;
    303314            maxStamp = stamp;
     315            fprintf (stderr, "maxStamp %d\n", i);
    304316            continue;
     317        } else {
     318            fprintf (stderr, "\n");
    305319        }
    306320        if (stamp->flux > maxFlux) {
     
    339353           
    340354            double sum = 0.0;
     355            double sum2 = 0.0;
    341356            for (int y = -footprint; y <= footprint; y++) {
    342357                for (int x = -footprint; x <= footprint; x++) {
    343358                    output->data.F32[y + yPix][x + xPix] = kernel->kernel[y][x];
    344359                    sum += kernel->kernel[y][x];
     360                    sum2 += PS_SQR(kernel->kernel[y][x]);
    345361                }
    346362            }
    347             fprintf (stderr, "kernel %d, sum %f\n", i, sum);
     363            fprintf (stderr, "kernel %d, sum %f, sum2: %e\n", i, sum, sum2);
    348364        }               
    349365        pmVisualScaleImage(kapa2, output, "Image", 0, true);
    350     }                                   
     366
     367        if (0) {
     368            psFits *fits = psFitsOpen("basis.1.fits", "w");
     369            psFitsWriteImage(fits, NULL, output, 0, NULL);
     370            psFitsClose(fits);
     371        }
     372    }
    351373       
    352374    if (maxStamp->convolutions2) {
     
    373395           
    374396            double sum = 0.0;
     397            double sum2 = 0.0;
    375398            for (int y = -footprint; y <= footprint; y++) {
    376399                for (int x = -footprint; x <= footprint; x++) {
    377400                    output->data.F32[y + yPix][x + xPix] = kernel->kernel[y][x];
    378401                    sum += kernel->kernel[y][x];
     402                    sum2 += PS_SQR(kernel->kernel[y][x]);
    379403                }
    380404            }
    381             fprintf (stderr, "kernel %d, sum %f\n", i, sum);
     405            fprintf (stderr, "kernel %d, sum %f, sum2: %e\n", i, sum, sum2);
    382406        }               
    383407        pmVisualScaleImage(kapa2, output, "Image", 1, true);
     408
     409        if (0) {
     410            psFits *fits = psFitsOpen("basis.2.fits", "w");
     411            psFitsWriteImage(fits, NULL, output, 0, NULL);
     412            psFitsClose(fits);
     413        }
    384414    }                                   
    385415       
Note: See TracChangeset for help on using the changeset viewer.