Changeset 3666 for trunk/stac/src/stacRejection.c
- Timestamp:
- Apr 5, 2005, 11:51:26 AM (21 years ago)
- File:
-
- 1 edited
-
trunk/stac/src/stacRejection.c (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/stac/src/stacRejection.c
r3387 r3666 48 48 psArray *maps, // Maps from input to transformed image 49 49 psArray *inverseMaps, // Maps from transformed to input image 50 stacConfig *config // Configuration 50 float frac, // Fraction of pixel rejected before looking more carefully 51 float grad, // Gradient limit for rejection 52 psArray *names // Names of original images (only for writing out when TESTING) 51 53 ) 52 54 { … … 58 60 assert(inputs->n == maps->n); 59 61 assert(inputs->n == inverseMaps->n); 62 assert(!names || names->n == inputs->n); 60 63 61 64 for (int i = 0; i < nImages; i++) { … … 93 96 FILE *crs = NULL; // File for outputting details of rejected pixels 94 97 char crfile[MAXCHAR]; // Filename 95 sprintf(crfile,"%s.cr", config->inputs->data[i]);98 sprintf(crfile,"%s.cr",names->data[i]); 96 99 if ((crs = fopen(crfile, "w")) == NULL) { 97 100 fprintf(stderr, "Unable to open file for detailed output, %s\n"); … … 119 122 #endif 120 123 121 if (maskVal > config->frac) {124 if (maskVal > frac) { 122 125 // Calculate mean gradient on other images 123 126 float meanGrads = 0.0; … … 147 150 #endif 148 151 149 if (stacGradient(inputs->data[i], x, y) < config->grad * meanGrads) {152 if (stacGradient(inputs->data[i], x, y) < grad * meanGrads) { 150 153 mask->data.U8[y][x] = 1; 151 154 nBad++; … … 182 185 char rejmapName[MAXCHAR]; // Filename of rejection image 183 186 char gradName[MAXCHAR]; // Filename of gradient image 184 sprintf(maskName, "%s.mask",config->inputs->data[i]);185 sprintf(rejmapName, "%s.rejmap",config->inputs->data[i]);186 sprintf(gradName, "%s.grad",config->inputs->data[i]);187 sprintf(maskName, "%s.mask", names->data[i]); 188 sprintf(rejmapName, "%s.rejmap", names->data[i]); 189 sprintf(gradName, "%s.grad", names->data[i]); 187 190 188 191 psFits *maskFile = psFitsAlloc(maskName);
Note:
See TracChangeset
for help on using the changeset viewer.
