Changeset 25027 for branches/pap/ppMerge/src/ppMergeReadChunk.c
- Timestamp:
- Aug 7, 2009, 4:08:25 PM (17 years ago)
- Location:
- branches/pap
- Files:
-
- 2 edited
-
. (modified) (1 prop)
-
ppMerge/src/ppMergeReadChunk.c (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/pap
- Property svn:mergeinfo changed
-
branches/pap/ppMerge/src/ppMergeReadChunk.c
r21365 r25027 50 50 for (int i = 0; i < readouts->n; i++) { 51 51 pmReadout *inRO = readouts->data[i]; ///< Input readout 52 if (!inRO->process) continue; 52 53 53 54 // override the recorded last scan … … 56 57 inRO->thisMaskScan = fileGroup->firstScan; 57 58 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); 58 64 59 65 // Read a chunk from a file 60 66 pmFPAfile *file = pmFPAfileSelectSingle(config->files, "PPMERGE.INPUT", i); 61 67 68 int zMax = 0; 62 69 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 } 64 77 keepReading = true; 65 if (!pmReadoutReadChunk(inRO, file->fits, 0, rows, 0, config)) {78 if (!pmReadoutReadChunk(inRO, file->fits, 0, &zMax, rows, 0, config)) { 66 79 psError(PS_ERR_IO, false, "Unable to read chunk %d for file PPMERGE.INPUT %d", 67 80 numChunk, i); … … 69 82 return NULL; 70 83 } 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 } 71 90 } 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 } 72 98 73 if (haveMasks && pmReadoutMoreMask(inRO, file->fits, 0, rows, config)) {99 if (haveMasks && pmReadoutMoreMask(inRO, file->fits, 0, &zMax, rows, config)) { 74 100 keepReading = true; 75 101 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)) { 77 103 psError(PS_ERR_IO, false, "Unable to read chunk %d for file PPMERGE.INPUT.MASK %d", 78 104 numChunk, i); … … 82 108 } 83 109 84 if (haveVariances && pmReadoutMoreVariance(inRO, file->fits, 0, rows, config)) {110 if (haveVariances && pmReadoutMoreVariance(inRO, file->fits, 0, &zMax, rows, config)) { 85 111 keepReading = true; 86 112 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)) { 88 114 psError(PS_ERR_IO, false, 89 115 "Unable to read chunk %d for file PPMERGE.INPUT.VARIANCE %d", … … 93 119 } 94 120 } 121 122 // fprintf (stderr, "%lx, %lx, %lx\n", (long int) inRO->image, (long int) inRO->mask, (long int) inRO->variance); 123 95 124 if (!keepReading) { 96 125 return NULL;
Note:
See TracChangeset
for help on using the changeset viewer.
