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/stacConfig.c

    r3660 r3666  
    66#include "pslib.h"
    77#include "stac.h"
     8#include "stacConfig.h"
    89
    910stacConfig *stacConfigAlloc(void)
     
    2122    config->starMapFile = NULL;
    2223    config->aper = 3.0;
    23     config->outnx = 512;
    24     config->outny = 512;
    25     config->saturated = NULL;           // Saturations; will fill this in later, when we know how many images
    26     config->bad = NULL;                 // Bad levels; will fill this in later, when we know how many images
     24    config->outnx = 0;
     25    config->outny = 0;
     26    config->saturated = 65535.0;        // Saturation level
     27    config->bad = 0.0;                  // Bad level
    2728    config->reject = 3.0;
    2829    config->frac = 0.5;
     
    4041        psFree(config->inputs);
    4142    }
    42     if (config->saturated) {
    43         psFree(config->saturated);
    44     }
    45     if (config->bad) {
    46         psFree(config->bad);
    47     }
    4843    // Free everything
    4944    psFree(config);
     
    5752    stacConfig *config = stacConfigAlloc(); // Configuration values
    5853    const char *programName = argv[0];  // Program name
    59 
    60     float saturated = 65535.0;          // Saturation level
    61     float bad = 0.0;                    // Bad level
    6254
    6355    /* Variables for getopt */
     
    9688            break;
    9789          case 's':
    98             if (sscanf(optarg, "%f", &saturated) != 1) {
     90            if (sscanf(optarg, "%f", &config->saturated) != 1) {
    9991                help(programName);
    10092                exit(EXIT_FAILURE);
     
    10294            break;
    10395          case 'b':
    104             if (sscanf(optarg, "%f", &bad) != 1) {
     96            if (sscanf(optarg, "%f", &config->bad) != 1) {
    10597                help(programName);
    10698                exit(EXIT_FAILURE);
     
    170162    }
    171163
    172     // Create the saturation and bad vectors
    173     config->saturated = psVectorAlloc(argc-1, PS_TYPE_F32);
    174     config->bad = psVectorAlloc(argc-1, PS_TYPE_F32);
    175     for (int i = 0; i < argc - 1; i++) {
    176         ((psVector*)config->saturated)->data.F32[i] = saturated;
    177         ((psVector*)config->bad)->data.F32[i] = bad;
    178     }
    179 
    180164    // Debugging output
    181165    psTrace("stac.config", 8, "Parsed command line for configuration\n");
Note: See TracChangeset for help on using the changeset viewer.