IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Apr 5, 2005, 11:51:26 AM (21 years ago)
Author:
Paul Price
Message:

Removing stac-specific configuration out of functions so that I can use them in other programs. Program appears to work as it did before.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/stac/src/stacRejection.c

    r3387 r3666  
    4848                       psArray *maps,   // Maps from input to transformed image
    4949                       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)
    5153    )
    5254{
     
    5860    assert(inputs->n == maps->n);
    5961    assert(inputs->n == inverseMaps->n);
     62    assert(!names || names->n == inputs->n);
    6063
    6164    for (int i = 0; i < nImages; i++) {
     
    9396        FILE *crs = NULL;               // File for outputting details of rejected pixels
    9497        char crfile[MAXCHAR];   // Filename
    95         sprintf(crfile,"%s.cr",config->inputs->data[i]);
     98        sprintf(crfile,"%s.cr",names->data[i]);
    9699        if ((crs = fopen(crfile, "w")) == NULL) {
    97100            fprintf(stderr, "Unable to open file for detailed output, %s\n");
     
    119122#endif
    120123
    121                     if (maskVal > config->frac) {
     124                    if (maskVal > frac) {
    122125                        // Calculate mean gradient on other images
    123126                        float meanGrads = 0.0;
     
    147150#endif
    148151
    149                         if (stacGradient(inputs->data[i], x, y) < config->grad * meanGrads) {
     152                        if (stacGradient(inputs->data[i], x, y) < grad * meanGrads) {
    150153                            mask->data.U8[y][x] = 1;
    151154                            nBad++;
     
    182185        char rejmapName[MAXCHAR];       // Filename of rejection image
    183186        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]);
    187190
    188191        psFits *maskFile = psFitsAlloc(maskName);
Note: See TracChangeset for help on using the changeset viewer.