IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Dec 30, 2005, 6:32:45 PM (20 years ago)
Author:
eugene
Message:

first pass on testing

File:
1 edited

Legend:

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

    r5860 r5862  
    1 # include "ppImage.h"
     1# include "ppMerge.h"
    22
    33// XXX EAM : optionally choose the mask image based on the detrend database
     
    2626    }
    2727
    28     // how do we calculate the merge stack?
    29     options->mergeStats = NULL;
    30     psString stat = psMetadataLookupStr(NULL, config->recipe, "MERGE.STAT");
    31     if (! strcasecmp(stat, "MEAN")) {
    32       options->mergeStats = psStatsAlloc(PS_STAT_SAMPLE_MEAN);
    33     } else if (! strcasecmp(stat, "MEDIAN")) {
    34       options->mergeStats = psStatsAlloc(PS_STAT_SAMPLE_MEDIAN);
    35     } else {
    36       psErrorStackPrint(stderr, "MERGE.STAT (%s) is not one of MEAN, MEDIAN: assuming MEAN\n", stat);
    37       options->mergeStats = psStatsAlloc(PS_STAT_SAMPLE_MEAN);
    38     }
    39 
    40     // mask - recipe options
     28    // global pixel mask
     29    options->doMask = false;
    4130    if (psMetadataLookupBool(NULL, config->recipe, "MASK")) {
    4231        data->mask->filename = psMetadataLookupStr(NULL, config->arguments, "-mask");
     
    4938    }
    5039
     40    // how do we calculate the merge stack?
     41    psStatsOptions mergeStats = 0;
     42    psString stat = psMetadataLookupStr(NULL, config->recipe, "MERGE.STAT");
     43    if (! strcasecmp(stat, "MEAN")) {
     44        mergeStats = PS_STAT_SAMPLE_MEAN;
     45    } else if (! strcasecmp(stat, "MEDIAN")) {
     46        mergeStats = PS_STAT_SAMPLE_MEDIAN;
     47    } else {
     48        psAbort ("merge", "MERGE.STAT (%s) is not one of MEAN, MEDIAN\n", stat);
     49    }
     50    options->combineParams = pmCombineParamsAlloc (mergeStats);
     51
     52    // other merge stack options
     53    options->applyZeroScale = psMetadataLookupBool(NULL, config->recipe, "MERGE.RESCALE");
     54
     55    int nKeep = psMetadataLookupS32(&status, config->recipe, "MERGE.NKEEP");
     56    if (status && nKeep > 0) {
     57        options->combineParams->nKeep = nKeep;
     58    }
     59
     60    float fracHigh = psMetadataLookupF32(&status, config->recipe, "MERGE.FRAC.HIGH");
     61    if (status) {
     62        options->combineParams->fracHigh = fracHigh;
     63    }
     64
     65    float fracLow = psMetadataLookupF32(&status, config->recipe, "MERGE.FRAC.LOW");
     66    if (status) {
     67        options->combineParams->fracLow = fracLow;
     68    }
     69
     70    // XXX need to set the masking value somehow...
     71
     72    // gain and readnoise come from camera parameters and depend on chip/cell
     73    // XXX drop these from the options structure?
     74    options->gain = 1.0;
     75    options->readnoise = 0.0;
     76
    5177    return true;
    5278}
Note: See TracChangeset for help on using the changeset viewer.