IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 7204


Ignore:
Timestamp:
May 24, 2006, 6:06:28 PM (20 years ago)
Author:
Paul Price
Message:

Debugging readout combination for ppMerge. There are still problems, possibly in the combination range in pmReadoutCombine.

Location:
trunk/psModules/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/psModules/src/camera/pmFPARead.c

    r7186 r7204  
    118118    }
    119119
     120    psTrace(__func__, 5, "Reading section [%.0f:%.0f,%.0f:%.0f]\n",
     121            toRead.x0, toRead.x1, toRead.y0, toRead.y1);
    120122    psImage *image = psFitsReadImage(fits, toRead, z); // Desired pixels
     123    psTrace(__func__, 7, "Image is %dx%d\n", image->numCols, image->numRows);
    121124
    122125    // XXX: We only support F32 for now
     
    129132    if (resize) {
    130133        // For some reason, the region of interest is smaller than the number of pixels we want.
     134        psTrace(__func__, 5, "Resizing image to %.0fx%.0f\n",
     135                fullSize.x1 - fullSize.x0, fullSize.y1 - fullSize.y0);
    131136        psImage *temp = psImageAlloc(fullSize.x1 - fullSize.x0, fullSize.y1 - fullSize.y0, image->type.type);
    132137        psImageInit(temp, bad);
     
    232237    }
    233238
     239    int maxSize;                        // Number of cols,rows in image
     240    if (readdir == 1) {
     241        maxSize = PS_MIN(naxis2, trimsec->y1);
     242    } else {
     243        maxSize = PS_MIN(naxis1, trimsec->x1);
     244    }
     245
    234246    // Read the FITS image
    235247    int offset = 0;                     // The offset from the start of the image to where we are now
     
    245257        }
    246258    }
    247     if ((readdir == 1 && offset >= naxis2) || (readdir == 2 && offset > naxis1)) {
    248         // We've read everything there is
    249         return false;
    250     }
    251     int upper = offset + numScans;      // The upper limit for the pixel read
    252     if (readdir == 1 && upper > naxis2) {
    253         upper = naxis2;
    254     } else if (readdir == 2 && upper > naxis1) {
    255         upper = naxis1;
    256     }
    257 
    258     // Blow away existing data
     259
     260    // Blow away existing data.
     261    // Do this before returning, so that we're not returning data from a previous read
    259262    psFree(readout->image);
     263    readout->image = NULL;
    260264    while (readout->bias->n > 0) {
    261265        psListRemove(readout->bias, PS_LIST_HEAD);
    262266    }
     267
     268    if (offset >= maxSize) {
     269        // We've read everything there is
     270        psTrace(__func__, 7, "Read everything.\n");
     271        psFree(readout->image);
     272        return false;
     273    }
     274    int upper = PS_MIN(offset + numScans, maxSize); // The upper limit for the pixel read
     275    psTrace(__func__, 7, "offset=%d, upper = %d, image is %dx%d, trimsec [%.0f:%.0f,%.0f:%.0f]\n",
     276            offset, upper, naxis1, naxis2, trimsec->x0, trimsec->x1, trimsec->y0, trimsec->y1);
    263277
    264278    // Get the new the trim section
  • trunk/psModules/src/imcombine/pmReadoutCombine.c

    r7194 r7204  
    55 *  @author GLG, MHPCC
    66 *
    7  *  @version $Revision: 1.9 $ $Name: not supported by cvs2svn $
    8  *  @date $Date: 2006-05-24 05:08:52 $
     7 *  @version $Revision: 1.10 $ $Name: not supported by cvs2svn $
     8 *  @date $Date: 2006-05-25 04:06:28 $
    99 *
    1010 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    179179        minInputCols = PS_MIN(minInputCols, readout->col0);
    180180        maxInputCols = PS_MAX(maxInputCols, readout->col0 + readout->image->numCols);
     181        psTrace(__func__, 7, "Readout %d: offset %d,%d; size %dx%d\n", i,
     182                readout->col0, readout->row0, readout->image->numCols, readout->image->numRows);
    181183        // Bounds of input image
    182184        rowLower->data.U32[i] = readout->row0;
     
    192194    // If there's existing images, we need to extend them
    193195    long minOutputRows = (output->image || output->mask || output->weight) ?
    194                          PS_MIN(minInputRows, output->row0) : minInputRows; // Smallest row value, considering the output
     196                         PS_MIN(minInputRows, output->row0) : minInputRows;  // Smallest output row value
    195197    long minOutputCols = (output->image || output->mask || output->weight) ?
    196                          PS_MIN(minInputCols, output->col0) : minInputCols; // Smallest column value, considering the output
     198                         PS_MIN(minInputCols, output->col0) : minInputCols; // Smallest output column value
     199    psTrace(__func__, 7, "Output minimum: %d,%d\n", minOutputCols, minOutputRows);
    197200
    198201    // Update the origin
     
    267270    psMaskType maskVal = params->maskVal; // The mask value
    268271
     272    psTrace(__func__, 3, "Iterating %d --> %d, %d --> %d\n",
     273            minInputCols - output->col0, maxInputCols - output->col0,
     274            minInputRows - output->row0, maxInputRows - output->row0);
     275
    269276    for (int i = minInputRows; i < maxInputRows; i++) {
    270277        for (int j = minInputCols; j < maxInputCols; j++) {
Note: See TracChangeset for help on using the changeset viewer.