IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 14993


Ignore:
Timestamp:
Sep 24, 2007, 9:10:40 AM (19 years ago)
Author:
eugene
Message:

avoid error for single row output images

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branch_20070921/psphot/src/psphotSourcePlots.c

    r13900 r14993  
    2020    int dY = 0;                         // height of row so far
    2121    int NX = 20*DX;                     // full width of output image
    22     int NY = 0;                         // total height of output image
     22    int NY = DY;                        // total height of output image so far
    2323
    24     // first, examine the PSF and SAT stars:
    25     // - determine bounding boxes for summary image
     24    // first, examine the PSF and SAT stars to set output image size:
     25    // - add stamp widths until we exceed output image width,
     26    // - then start a new row offset by max height
    2627    for (int i = 0; i < sources->n; i++) {
    2728
     
    3132        keep |= (source->mode & PM_SOURCE_MODE_PSFSTAR);
    3233        keep |= (source->mode & PM_SOURCE_MODE_SATSTAR);
    33         if (!keep) continue;
     34        if (!keep) {
     35            psTrace ("psphot", 4, "not plotting star %d: %x", i, source->mode);
     36            continue;
     37        }
    3438
    3539        // how does this subimage get placed into the output image?
     
    5761    }
    5862
     63    if (NY == 0) {
     64        psWarning ("no PSF or SAT stars to plot? skipping.\n");
     65        return false;
     66    }
     67
    5968    // allocate output image
    6069    psImage *outpos = psImageAlloc (NX, NY, PS_TYPE_F32);
    6170    psImage *outsub = psImageAlloc (NX, NY, PS_TYPE_F32);
     71
     72    psImageInit (outpos, 0.0);
     73    psImageInit (outsub, 0.0);
    6274
    6375    int Xo = 0;                         // starting corner of next box
     
    142154    psFree (outpos);
    143155    psFree (outsub);
    144     return (sources);
     156    return true;
    145157}
    146158
Note: See TracChangeset for help on using the changeset viewer.