Changeset 3610 for trunk/stac/src/stac.c
- Timestamp:
- Mar 31, 2005, 5:07:12 PM (21 years ago)
- File:
-
- 1 edited
-
trunk/stac/src/stac.c (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/stac/src/stac.c
r3435 r3610 27 27 // Set trace levels 28 28 psTraceSetLevel(".",0); 29 psTraceSetLevel(".psLib", 0); 29 30 psTraceSetLevel("stac.checkMemory",10); 30 31 psTraceSetLevel("stac.config",10); … … 38 39 psTraceSetLevel("stac.area",10); 39 40 psTraceSetLevel("stac.size",10); 41 psTraceSetLevel("stac.scales",7); 40 42 41 43 // Set logging level … … 65 67 psArray *transformed = NULL; 66 68 psArray *transformedErrors = NULL; 67 (void)stacTransform(&transformed, &transformedErrors, inputs, inverseMaps, errors, NULL, NULL, config); 69 (void)stacTransform(&transformed, &transformedErrors, inputs, inverseMaps, errors, NULL, NULL, NULL, NULL, 70 config); 68 71 69 72 psTrace("stac.time",1,"Transformation completed at %f seconds\n", getTime() - startTime); 73 74 psVector *scales = NULL; // Relative scales between images 75 psVector *offsets = NULL; // Offsets between images 76 (void)stacScales(&scales, &offsets, transformed, config); 77 // Rescale the images 78 (void)stacRescale(transformed, transformedErrors, NULL, scales, offsets); 70 79 71 80 // Combine with rejection … … 122 131 } 123 132 124 // Redo transformation with the masks 133 // Redo transformation with the masks and scales/offsets 125 134 (void)stacTransform(&transformed, &transformedErrors, inputs, inverseMaps, errors, rejectedSource, 126 combineRegion, config);135 combineRegion, scales, offsets, config); 127 136 128 137 // Combine the newly-transformed CR-free images, no rejection … … 139 148 psFree(outFile); 140 149 150 // Save shifted images 151 if (config->saveShifts) { 152 for (int i = 0; i < transformed->n; i++) { 153 char shiftName[MAXCHAR]; // Filename of shifted image 154 sprintf(shiftName, "%s.shift", config->inputs->data[i]); 155 psFits *shiftFile = psFitsAlloc(shiftName); 156 if (!psFitsWriteImage(shiftFile, NULL, transformed->data[i], 0, NULL)) { 157 psErrorStackPrint(stderr, "Unable to write image: %s\n", shiftName); 158 } 159 psTrace("stac", 1, "Shifted image %d written to %s\n", i, shiftName); 160 psFree(shiftFile); 161 } 162 } 163 141 164 // Free everything I've used 142 165 stacConfigFree(config); 166 psFree(scales); 167 psFree(offsets); 143 168 psFree(combineRegion); 144 169 psFree(regions);
Note:
See TracChangeset
for help on using the changeset viewer.
