Changeset 16404 for branches/pap_branch_080207/ppStack/src/ppStackReadout.c
- Timestamp:
- Feb 11, 2008, 6:12:19 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/pap_branch_080207/ppStack/src/ppStackReadout.c
r16382 r16404 10 10 #include "ppStack.h" 11 11 12 13 #define ARRAY_BUFFER 16 // Number to add to array at a time 12 14 #define WCS_TOLERANCE 0.001 // Tolerance for WCS 13 15 … … 26 28 psMaskType maskBad = psMetadataLookupU8(NULL, config->arguments, "MASK.BAD"); // Value to mask 27 29 psMaskType maskBlank = psMetadataLookupU8(NULL, config->arguments, "MASK.BLANK"); // Mask for blank reg. 28 //float threshold = psMetadataLookupF32(NULL, config->arguments, "THRESHOLD.MASK"); // Threshold for mask deconvolution30 float threshold = psMetadataLookupF32(NULL, config->arguments, "THRESHOLD.MASK"); // Threshold for mask deconvolution 29 31 30 32 int num = readouts->n; // Number of inputs … … 49 51 weighting = 1.0; 50 52 } 51 52 #if 053 // I don't think 'scale' is needed, since the convolution matches the scales54 float scale = psMetadataLookupF32(&mdok, fpa->analysis, "PPSTACK.SCALE"); // Rel. scale55 if (!mdok || !isfinite(scale)) {56 psWarning("No SCALE supplied for image %d --- set to unity.", i);57 scale = 1.0;58 }59 #endif60 53 61 54 float exposure = psMetadataLookupF32(NULL, ro->parent->concepts, "CELL.EXPOSURE"); // Exposure time … … 135 128 #endif 136 129 137 138 139 // XXX THIS NEEDS WORK140 #if 0141 130 for (int i = 0; i < num; i++) { 142 131 pmStackData *data = stack->data[i]; // Data for this image 143 132 pmReadout *readout = data->readout; // Readout for this image 144 145 146 // XXX Need some other mechanism to get the subtraction kernel147 148 133 149 134 // Extract the regions and solutions used in the image matching … … 151 136 { 152 137 psMetadataIterator *iter = psMetadataIteratorAlloc(readout->analysis, PS_LIST_HEAD, 153 "^SUBTRACTION.REGION$"); // Iterator138 PM_SUBTRACTION_ANALYSIS_REGION); // Iterator 154 139 psMetadataItem *item = NULL;// Item from iteration 155 140 while ((item = psMetadataGetAndIncrement(iter))) { … … 159 144 psFree(iter); 160 145 } 161 psArray * solutions = psArrayAllocEmpty(ARRAY_BUFFER); // Array of solutions146 psArray *kernels = psArrayAllocEmpty(ARRAY_BUFFER); // Array of kernels 162 147 { 163 148 psMetadataIterator *iter = psMetadataIteratorAlloc(readout->analysis, PS_LIST_HEAD, 164 "^SUBTRACTION.SOLUTION$"); // Iterator149 PM_SUBTRACTION_ANALYSIS_KERNEL); // Iterator 165 150 psMetadataItem *item = NULL;// Item from iteration 166 151 while ((item = psMetadataGetAndIncrement(iter))) { 167 152 assert(item->type == PS_DATA_VECTOR); 168 solutions = psArrayAdd(solutions, ARRAY_BUFFER, item->data.V);153 kernels = psArrayAdd(kernels, ARRAY_BUFFER, item->data.V); 169 154 } 170 155 psFree(iter); 171 156 } 172 assert(regions->n == solutions->n); 173 174 pmSubtractionKernels *kernels = psMetadataLookupPtr(NULL, readout->analysis, 175 "SUBTRACTION.KERNEL"); // Kernels 176 177 psPixels *reject = pmStackReject(data->pixels, threshold, regions, 178 solutions, kernels); // List of pixels to reject 157 assert(regions->n == kernels->n); 158 159 psPixels *reject = pmStackReject(data->pixels, threshold, regions, kernels); // Pixels to reject 179 160 psFree(data->pixels); 180 161 data->pixels = reject; 181 162 182 psFree( solutions);163 psFree(kernels); 183 164 psFree(regions); 184 165 } 185 #endif186 187 166 188 167 #ifdef REJECTION_FILES
Note:
See TracChangeset
for help on using the changeset viewer.
