IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
May 4, 2006, 3:53:10 PM (20 years ago)
Author:
Paul Price
Message:

Code compiles now. Not yet tested.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ppMerge/src/ppMergeOptions.c

    r7061 r7067  
    22#include <pslib.h>
    33#include <psmodules.h>
     4
     5#include "ppMerge.h"
     6#include "ppMergeOptions.h"
    47
    58//////////////////////////////////////////////////////////////////////////////////////////////////////////////
     
    710//////////////////////////////////////////////////////////////////////////////////////////////////////////////
    811
    9 #if 0
    1012// Free function
    1113static void mergeOptionsFree(ppMergeOptions *options // Options to free
    1214    )
    1315{
     16    psFree(options->combine);
    1417}
    15 #endif
    1618
    1719// Allocator
     
    1921{
    2022    ppMergeOptions *options = psAlloc(sizeof(ppMergeOptions)); // The options, to return
    21     // psMemSetDeallocator(options, (psFreeFunc)mergeOptionsFree);
     23    psMemSetDeallocator(options, (psFreeFunc)mergeOptionsFree);
    2224
    2325    options->rows = 0;
     
    2931    options->background = PS_STAT_SAMPLE_MEDIAN;
    3032    options->onOff = 0;
    31     options->combine = PS_STAT_SAMPLE_MEAN;
    32     options->ref = 3.0;
    33     options->iter = 1;
    34     options->fracHigh = 0.0;
    35     options->fracLow = 0.0;
    36     options->nKeep = 1;
    37     options->maskVal = 0xffff;
     33    options->combine = pmCombineParamsAlloc(PS_STAT_SAMPLE_MEAN);
     34    options->combine->rej = 3.0;
     35    options->combine->iter = 1;
     36    options->combine->fracHigh = 0.0;
     37    options->combine->fracLow = 0.0;
     38    options->combine->nKeep = 1;
     39    options->combine->maskVal = 0xff;
    3840
    3941    return options;
     
    8486
    8587// Parse the options
    86 ppMergeOptions *ppMergeOptionsParse(ppConfig *config // Configuration
     88ppMergeOptions *ppMergeOptionsParse(pmConfig *config // Configuration
    8789    )
    8890{
    8991    ppMergeOptions *options = ppMergeOptionsAlloc(); // The merge options
    9092
     93    bool mdok = true;                   // Status of MD lookup
     94    psMetadata *recipe = psMetadataLookupMD(&mdok, config->recipes, RECIPENAME); // Recipe information
     95    if (!mdok || !recipe) {
     96        psError(PS_ERR_IO, true, "Unable to find recipe %s", RECIPENAME);
     97        exit(EXIT_FAILURE);
     98    }
     99
    91100    // First, deal with the recipe.  These are parameters that will typically be constant for a camera.
    92     OPTION_PARSE(options->rows,         config->recipe, "ROWS",      U16 );
    93     OPTION_PARSE(options->minElectrons, config->recipe, "ELECTRONS", F32 );
    94     OPTION_PARSE(options->sample,       config->recipe, "SAMPLE",    S32 );
    95     OPTION_PARSE(options->rej,          config->recipe, "REJ",       F32 );
    96     OPTION_PARSE(options->iter,         config->recipe, "ITER",      S32 );
    97     OPTION_PARSE(options->fracHigh,     config->recipe, "FRACHIGH",  F32 );
    98     OPTION_PARSE(options->fracLow,      config->recipe, "FRACLOW",   F32 );
    99     OPTION_PARSE(options->nKeep,        config->recipe, "NKEEP",     S32 );
    100     OPTION_PARSE(options->maskVal,      config->recipe, "MASKVAL",   U8  );
    101     options->combine = parseStat(config->recipe, "COMBINE");
    102     options->background = parseStat(config->recipe, "BACKGROUND");
     101    OPTION_PARSE(options->rows,              recipe, "ROWS",      U16 );
     102    OPTION_PARSE(options->minElectrons,      recipe, "ELECTRONS", F32 );
     103    OPTION_PARSE(options->sample,            recipe, "SAMPLE",    S32 );
     104    OPTION_PARSE(options->combine->rej,      recipe, "REJ",       F32 );
     105    OPTION_PARSE(options->combine->iter,     recipe, "ITER",      S32 );
     106    OPTION_PARSE(options->combine->fracHigh, recipe, "FRACHIGH",  F32 );
     107    OPTION_PARSE(options->combine->fracLow,  recipe, "FRACLOW",   F32 );
     108    OPTION_PARSE(options->combine->nKeep,    recipe, "NKEEP",     S32 );
     109    OPTION_PARSE(options->combine->maskVal,  recipe, "MASKVAL",   U8  );
     110    options->combine->combine = parseStat(recipe, "COMBINE");
     111    options->background       = parseStat(recipe, "BACKGROUND");
    103112
    104113    // Now the command-line options.  These are parameters that depend on what type of frame is being combined
     
    127136
    128137    // Or you can set them individually
    129     OPTION_PARSE(options->zero,    config->recipe, "-zero",    Bool);
    130     OPTION_PARSE(options->scale,   config->recipe, "-scale",   Bool);
    131     OPTION_PARSE(options->exptime, config->recipe, "-exptime", Bool);
     138    OPTION_PARSE(options->zero,    config->arguments, "-zero",    Bool);
     139    OPTION_PARSE(options->scale,   config->arguments, "-scale",   Bool);
     140    OPTION_PARSE(options->exptime, config->arguments, "-exptime", Bool);
    132141
    133142    // Number of on/off images
    134     OPTION_PARSE(options->onoff, config->recipe, "-onoff", S32);
     143    OPTION_PARSE(options->onOff, config->arguments, "-onoff", S32);
    135144
    136145    return options;
Note: See TracChangeset for help on using the changeset viewer.