- Timestamp:
- May 3, 2010, 8:50:52 AM (16 years ago)
- Location:
- branches/simtest_nebulous_branches
- Files:
-
- 3 edited
-
. (modified) (1 prop)
-
ppStack/src (modified) (1 prop)
-
ppStack/src/ppStackCombineInitial.c (modified) (8 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/simtest_nebulous_branches
- Property svn:mergeinfo changed
-
branches/simtest_nebulous_branches/ppStack/src
- Property svn:ignore
-
old new 10 10 stamp-h1 11 11 ppStackVersionDefinitions.h 12 ppStackErrorCodes.c 13 ppStackErrorCodes.h
-
- Property svn:ignore
-
branches/simtest_nebulous_branches/ppStack/src/ppStackCombineInitial.c
r23767 r27840 10 10 #include "ppStackLoop.h" 11 11 12 //#define TESTING // Enable test output 13 12 14 bool ppStackCombineInitial(ppStackThreadData *stack, ppStackOptions *options, pmConfig *config) 13 15 { … … 18 20 if (!options->convolve) { 19 21 // No need to do initial combination when we haven't convolved 22 // XXX either allocate inspect and rejected here, or do not require them downstream 20 23 return true; 21 24 } … … 34 37 if (!status) { 35 38 // Something went wrong 36 psError( PS_ERR_UNKNOWN, false, "Unable to read chunk %d", numChunk);39 psError(psErrorCodeLast(), false, "Unable to read chunk %d", numChunk); 37 40 return false; 38 41 } … … 54 57 55 58 if (!psThreadPoolWait(false)) { 56 psError( PS_ERR_UNKNOWN, false, "Unable to do initial combination.");59 psError(psErrorCodeLast(), false, "Unable to do initial combination."); 57 60 return false; 58 61 } … … 60 63 // Harvest the jobs, gathering the inspection lists 61 64 options->inspect = psArrayAlloc(options->num); 65 options->rejected = psArrayAlloc(options->num); 62 66 for (int i = 0; i < options->num; i++) { 63 67 if (options->inputMask->data.PS_TYPE_VECTOR_MASK_DATA[i]) { … … 65 69 } 66 70 options->inspect->data[i] = psArrayAllocEmpty(numChunk); 71 options->rejected->data[i] = psArrayAllocEmpty(numChunk); 67 72 } 68 73 psThreadJob *job; // Completed job … … 71 76 "Job has incorrect type: %s", job->type); 72 77 psArray *results = job->results; // Results of job 78 psAssert(results->n == 2, "Results array has wrong size!"); 79 psArray *inspect = results->data[0]; // Pixels to inspect 80 psArray *reject = results->data[1]; // Pixels to reject 73 81 for (int i = 0; i < options->num; i++) { 74 82 if (options->inputMask->data.PS_TYPE_VECTOR_MASK_DATA[i]) { 75 83 continue; 76 84 } 77 options->inspect->data[i] = psArrayAdd(options->inspect->data[i], 1, results->data[i]); 85 options->inspect->data[i] = psArrayAdd(options->inspect->data[i], 1, inspect->data[i]); 86 options->rejected->data[i] = psArrayAdd(options->rejected->data[i], 1, reject->data[i]); 78 87 } 79 88 psFree(job); … … 83 92 84 93 #ifdef TESTING 85 ppStackWriteImage("combined_initial.fits", NULL, outRO->image, config); 86 pmStackVisualPlotTestImage(outRO->image, "combined_initial.fits"); 94 ppStackWriteImage("combined_image_initial.fits", NULL, options->outRO->image, config); 95 ppStackWriteImage("combined_mask_initial.fits", NULL, options->outRO->mask, config); 96 ppStackWriteImage("combined_variance_initial.fits", NULL, options->outRO->variance, config); 97 98 pmStackVisualPlotTestImage(options->outRO->image, "combined_image_initial.fits"); 87 99 #endif 88 89 psFree(options->matchChi2); options->matchChi2 = NULL;90 91 100 92 101 if (options->stats) {
Note:
See TracChangeset
for help on using the changeset viewer.
