IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jan 2, 2010, 6:13:37 PM (17 years ago)
Author:
eugene
Message:

adding window to dual convolution; fixing normalization for deconvolved-hermitians

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/20091201/psModules/src/imcombine/pmSubtractionVisual.c

    r26491 r26502  
    251251        int yPix = ySub * (2*footprint + 1 + 3) + footprint;
    252252
     253        double sum = 0.0;
    253254        for (int y = -footprint; y <= footprint; y++) {
    254255            for (int x = -footprint; x <= footprint; x++) {
    255256                output->data.F32[y + yPix][x + xPix] = kernel->kernel[y][x];
     257                sum += kernel->kernel[y][x];
    256258            }
    257259        }
     260        fprintf (stderr, "kernel %d, sum %f\n", i, sum);
    258261    }                                                   
    259262       
     
    274277
    275278    // choose the brightest stamp
    276     pmSubtractionStamp *maxStamp = stamps->stamps->data[0];
    277     float maxFlux = maxStamp->flux;
    278     for (int i = 1; i < stamps->num; i++) {
     279    pmSubtractionStamp *maxStamp = NULL;
     280    float maxFlux = NAN;
     281    for (int i = 0; i < stamps->num; i++) {
    279282        pmSubtractionStamp *stamp = stamps->stamps->data[i];
     283        if (!isfinite(stamp->flux)) continue;
     284        if (!stamp->convolutions1 && !stamp->convolutions2) continue;
     285        if (!maxStamp) {
     286            maxFlux = stamp->flux;
     287            maxStamp = stamp;
     288            continue;
     289        }
    280290        if (stamp->flux > maxFlux) {
    281291            maxFlux = stamp->flux;
    282292            maxStamp = stamp;
    283293        }
     294    }
     295
     296    if (!isfinite(maxStamp->flux)) {
     297        fprintf (stderr, "no valid stamps?\n");
    284298    }
    285299
     
    308322            int yPix = ySub * (2*footprint + 1 + 3) + footprint;
    309323           
     324            double sum = 0.0;
    310325            for (int y = -footprint; y <= footprint; y++) {
    311326                for (int x = -footprint; x <= footprint; x++) {
    312327                    output->data.F32[y + yPix][x + xPix] = kernel->kernel[y][x];
     328                    sum += kernel->kernel[y][x];
    313329                }
    314330            }
     331            fprintf (stderr, "kernel %d, sum %f\n", i, sum);
    315332        }               
    316333        pmVisualScaleImage(kapa2, output, "Image", 0, true);
     
    339356            int yPix = ySub * (2*footprint + 1 + 3) + footprint;
    340357           
     358            double sum = 0.0;
    341359            for (int y = -footprint; y <= footprint; y++) {
    342360                for (int x = -footprint; x <= footprint; x++) {
    343361                    output->data.F32[y + yPix][x + xPix] = kernel->kernel[y][x];
     362                    sum += kernel->kernel[y][x];
    344363                }
    345364            }
     365            fprintf (stderr, "kernel %d, sum %f\n", i, sum);
    346366        }               
    347367        pmVisualScaleImage(kapa2, output, "Image", 1, true);
     
    375395        overlay[Noverlay].type = KII_OVERLAY_BOX;
    376396        if ((stamp->x < 1.0) && (stamp->y < 1.0)) {
    377             fprintf (stderr, "stamp zero: %f %f\n", stamp->x, stamp->y);
     397            // fprintf (stderr, "stamp zero: %f %f\n", stamp->x, stamp->y);
    378398            continue;
    379399        }
    380400        if (!isfinite(stamp->x) && !isfinite(stamp->y)) {
    381             fprintf (stderr, "stamp nan: %f %f\n", stamp->x, stamp->y);
     401            // fprintf (stderr, "stamp nan: %f %f\n", stamp->x, stamp->y);
    382402            continue;
    383403        }
     
    409429bool pmSubtractionVisualShowFitInit(pmSubtractionStampList *stamps) {
    410430
    411     if (!pmVisualIsVisual()) return true;
     431    // if (!pmVisualIsVisual()) return true;
    412432
    413433    // generate 4 storage images large enough to hold the N stamps:
     
    446466bool pmSubtractionVisualShowFitAddStamp(psKernel *target, psKernel *source, psKernel *convolution, double background, double norm, int index) {
    447467
    448     if (!pmVisualIsVisual()) return true;
     468    // if (!pmVisualIsVisual()) return true;
    449469
    450470    double sum;
     
    517537bool pmSubtractionVisualShowFit() {
    518538
    519     if (!pmVisualIsVisual()) return true;
     539    // if (!pmVisualIsVisual()) return true;
    520540    if (!pmVisualInitWindow(&kapa1, "ppSub:Images")) return false;
    521541    if (!pmVisualInitWindow(&kapa2, "ppSub:Misc")) return false;
Note: See TracChangeset for help on using the changeset viewer.