Changeset 14582 for trunk/psModules/src/imcombine/pmSubtractionMatch.c
- Timestamp:
- Aug 21, 2007, 9:58:39 AM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/psModules/src/imcombine/pmSubtractionMatch.c
r14580 r14582 44 44 45 45 46 bool pmSubtractionMatch(pmReadout *convolved, 47 const pmReadout *reference, 48 const pmReadout *input, 49 int footprint, 50 float regionSize, 51 float stampSpacing, 52 float threshold, 53 psString stampsName, 54 float targetWidth, 55 pmSubtractionKernelsType type, 56 int size, 57 int order, 58 const psVector *isisWidths, 59 const psVector *isisOrders, 60 int inner, 61 int ringsOrder, 62 int binning, 63 int iter, 64 float rej, 65 psMaskType maskBad, 66 psMaskType maskBlank 67 ) 46 bool pmSubtractionMatch(pmReadout *convolved, const pmReadout *reference, const pmReadout *input, 47 int footprint, float regionSize, float stampSpacing, float threshold, 48 psString stampsName, float targetWidth, pmSubtractionKernelsType type, 49 int size, int order, const psVector *isisWidths, const psVector *isisOrders, 50 int inner, int ringsOrder, int binning, int iter, float rej, psMaskType maskBad, 51 psMaskType maskBlank) 68 52 { 69 53 PS_ASSERT_PTR_NON_NULL(convolved, false); … … 164 148 pmSubtractionKernels *kernels = pmSubtractionKernelsGenerate(type, size, order, isisWidths, isisOrders, 165 149 inner, binning, ringsOrder); 166 psMetadataAddStr(convolved->analysis, PS_LIST_TAIL, "SUBTRACTION. DESCRIPTION", 0,150 psMetadataAddStr(convolved->analysis, PS_LIST_TAIL, "SUBTRACTION.KERNEL.DESCRIPTION", 0, 167 151 "Subtraction kernel description", kernels->description); 168 152 psArray *stamps = NULL; // Stamps for matching PSF … … 175 159 float xRegionSize = 0, yRegionSize = 0; // Size of iso-kernel regions 176 160 psRegion *region = NULL; // Iso-kernel region 161 psString regionString = NULL; // String for region 177 162 if (isfinite(regionSize) || regionSize == 0.0) { 178 163 xRegions = numCols / regionSize + 1; … … 191 176 *region = psRegionSet((int)(i * xRegionSize), (int)((i + 1) * xRegionSize), 192 177 (int)(j * yRegionSize), (int)((j + 1) * yRegionSize)); 193 psString string = psRegionToString(*region); 178 psFree(regionString); 179 regionString = psRegionToString(*region); 194 180 psTrace("psModules.imcombine", 3, "Iso-kernel region: %s out of %d,%d\n", 195 string, numCols, numRows); 196 psFree(string); 181 regionString, numCols, numRows); 197 182 } 198 183 … … 267 252 goto ERROR; 268 253 } 269 psLogMsg("psModules.imcombine", PS_LOG_INFO, "%d stamps rejected on iteration %d.", numRejected, k); 254 psLogMsg("psModules.imcombine", PS_LOG_INFO, "%d stamps rejected on iteration %d.", 255 numRejected, k); 270 256 271 257 memCheck(" reject stamps"); … … 312 298 } 313 299 314 psString comment = NULL;// Comment for metadata 315 psString regionString = psRegionToString(*region); // String for region 300 psString comment = NULL; // Comment for metadata 316 301 psStringAppend(&comment, "Subtraction kernel for region %s", regionString); 317 psFree(regionString); 318 psMetadataAddPtr(convolved->analysis, PS_LIST_TAIL, "SUBTRACTION.KERNEL", 302 psMetadataAddPtr(convolved->analysis, PS_LIST_TAIL, "SUBTRACTION.KERNEL.IMAGE", 319 303 PS_META_DUPLICATE_OK, comment, convKernels); 320 304 psFree(comment); … … 351 335 } 352 336 337 { 338 psString comment = NULL; // Comment for metadata 339 psStringAppend(&comment, "Subtraction solution for region %s", regionString); 340 psMetadataAddVector(convolved->analysis, PS_LIST_TAIL, "SUBTRACTION.SOLUTION", 341 PS_META_DUPLICATE_OK, comment, solution); 342 psFree(comment); 343 } 344 353 345 psFree(solution); 354 346 solution = NULL; 347 348 // There is data in the readout now 349 convolved->data_exists = true; 350 convolved->parent->data_exists = true; 351 convolved->parent->parent->data_exists = true; 355 352 } 356 353 } 357 354 psFree(kernels); 355 kernels = NULL; 358 356 359 357 psFree(region); 360 358 region = NULL; 359 psFree(regionString); 360 regionString = NULL; 361 361 psFree(subMask); 362 362 subMask = NULL; 363 363 364 364 if (!pmSubtractionBorder(convolved->image, convolved->weight, convolved->mask, kernels, maskBlank)) { 365 psError(PS_ERR_UNKNOWN, false, "Unable to set border regionof convolved image.");365 psError(PS_ERR_UNKNOWN, false, "Unable to set border of convolved image."); 366 366 goto ERROR; 367 367 } … … 374 374 ERROR: 375 375 psFree(region); 376 psFree(regionString); 376 377 psFree(subMask); 377 378 psFree(kernels);
Note:
See TracChangeset
for help on using the changeset viewer.
