IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Aug 7, 2009, 4:08:25 PM (17 years ago)
Author:
Paul Price
Message:

Merging trunk (r25026) to get up-to-date on old branch.

Location:
branches/pap
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/pap

  • branches/pap/ppMerge/src/ppMergeReadChunk.c

    r21365 r25027  
    5050            for (int i = 0; i < readouts->n; i++) {
    5151                pmReadout *inRO = readouts->data[i]; ///< Input readout
     52                if (!inRO->process) continue;
    5253
    5354                // override the recorded last scan
     
    5657                inRO->thisMaskScan   = fileGroup->firstScan;
    5758                inRO->forceScan      = true;
     59                // inRO->process        = true;
     60
     61                // char *cellname = psMetadataLookupStr(&mdok, inRO->parent->concepts, "CELL.NAME");
     62                // fprintf (stderr, "cell: %s, file %d, process: %d, image, mask, var: %lx, %lx, %lx -> ",
     63                //       cellname, i, inRO->process, (long int) inRO->image, (long int) inRO->mask, (long int) inRO->variance);
    5864
    5965                // Read a chunk from a file
    6066                pmFPAfile *file = pmFPAfileSelectSingle(config->files, "PPMERGE.INPUT", i);
    6167
     68                int zMax = 0;
    6269                bool keepReading = false;
    63                 if (pmReadoutMore(inRO, file->fits, 0, rows, config)) {
     70                if (pmReadoutMore(inRO, file->fits, 0, &zMax, rows, config)) {
     71                    // skip video cells
     72                    if (zMax > 1) {
     73                        psWarning ("skipping video cell (1: %ld)", (long) pthread_self());
     74                        inRO->process = false;
     75                        continue;
     76                    }
    6477                    keepReading = true;
    65                     if (!pmReadoutReadChunk(inRO, file->fits, 0, rows, 0, config)) {
     78                    if (!pmReadoutReadChunk(inRO, file->fits, 0, &zMax, rows, 0, config)) {
    6679                        psError(PS_ERR_IO, false, "Unable to read chunk %d for file PPMERGE.INPUT %d",
    6780                                numChunk, i);
     
    6982                        return NULL;
    7083                    }
     84                    // skip video cells
     85                    if (zMax > 1) {
     86                        psWarning ("skipping video cell (2: %ld)", (long) pthread_self());
     87                        inRO->process = false;
     88                        continue;
     89                    }
    7190                }
     91                // skip video cells
     92                // XXX this could be more efficient if we identified the cells to skip before calling the function...
     93                if (zMax > 1) {
     94                    psWarning ("skipping video cell (3: %ld)", (long) pthread_self());
     95                    inRO->process = false;
     96                    continue;
     97                }
    7298
    73                 if (haveMasks && pmReadoutMoreMask(inRO, file->fits, 0, rows, config)) {
     99                if (haveMasks && pmReadoutMoreMask(inRO, file->fits, 0, &zMax, rows, config)) {
    74100                    keepReading = true;
    75101                    pmFPAfile *file = pmFPAfileSelectSingle(config->files, "PPMERGE.INPUT.MASK", i);
    76                     if (!pmReadoutReadChunkMask(inRO, file->fits, 0, rows, 0, config)) {
     102                    if (!pmReadoutReadChunkMask(inRO, file->fits, 0, &zMax, rows, 0, config)) {
    77103                        psError(PS_ERR_IO, false, "Unable to read chunk %d for file PPMERGE.INPUT.MASK %d",
    78104                                numChunk, i);
     
    82108                }
    83109
    84                 if (haveVariances && pmReadoutMoreVariance(inRO, file->fits, 0, rows, config)) {
     110                if (haveVariances && pmReadoutMoreVariance(inRO, file->fits, 0, &zMax, rows, config)) {
    85111                    keepReading = true;
    86112                    pmFPAfile *file = pmFPAfileSelectSingle(config->files, "PPMERGE.INPUT.VARIANCE", i);
    87                     if (!pmReadoutReadChunkVariance(inRO, file->fits, 0, rows, 0, config)) {
     113                    if (!pmReadoutReadChunkVariance(inRO, file->fits, 0, &zMax, rows, 0, config)) {
    88114                        psError(PS_ERR_IO, false,
    89115                                "Unable to read chunk %d for file PPMERGE.INPUT.VARIANCE %d",
     
    93119                    }
    94120                }
     121
     122                // fprintf (stderr, "%lx, %lx, %lx\n", (long int) inRO->image, (long int) inRO->mask, (long int) inRO->variance);
     123
    95124                if (!keepReading) {
    96125                    return NULL;
Note: See TracChangeset for help on using the changeset viewer.