IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Mar 31, 2008, 3:46:38 PM (18 years ago)
Author:
Paul Price
Message:

Adding renormalisation of variance maps.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ppStack/src/ppStackArguments.c

    r17006 r17255  
    8383}
    8484
     85// Get a statistic name from the command-line or recipe, and add the enum to the arguments
     86#define VALUE_ARG_RECIPE_STAT(ARGNAME, RECIPENAME) { \
     87    const char *stat = psMetadataLookupStr(NULL, arguments, ARGNAME); \
     88    if (!stat) { \
     89        stat = psMetadataLookupStr(NULL, recipe, RECIPENAME); \
     90        if (!stat) { \
     91            psError(PS_ERR_BAD_PARAMETER_VALUE, false, "Unable to find %s in recipe %s", \
     92                    RECIPENAME, PPSTACK_RECIPE); \
     93            goto ERROR; \
     94        } \
     95    } \
     96    psMetadataAddS32(config->arguments, PS_LIST_TAIL, RECIPENAME, 0, NULL, psStatsOptionFromString(stat)); \
     97}
     98
    8599// Get a string value from the command-line and add it to the target
    86100static bool valueArgStr(psMetadata *arguments, // Command-line arguments
     
    141155    psMetadataAddBool(arguments, PS_LIST_TAIL, "-variance", 0, "Use variance for rejection?", false);
    142156    psMetadataAddBool(arguments, PS_LIST_TAIL, "-safe", 0, "Play safe with small numbers of pixels to combine?", false);
     157    psMetadataAddBool(arguments, PS_LIST_TAIL, "-renorm", 0, "Renormalise variance maps?", false);
     158    psMetadataAddStr(arguments, PS_LIST_TAIL, "-renorm-mean", 0, "Statistic for mean in renormalisation", NULL);
     159    psMetadataAddStr(arguments, PS_LIST_TAIL, "-renorm-stdev", 0, "Statistic for stdev in renormalisation", NULL);
     160    psMetadataAddS32(arguments, PS_LIST_TAIL, "-renorm-width", 0, "Width of renormalisation boxes", 0);
    143161    psMetadataAddStr(arguments, PS_LIST_TAIL, "-temp-image", 0, "Suffix for temporary images", NULL);
    144162    psMetadataAddStr(arguments, PS_LIST_TAIL, "-temp-mask", 0, "Suffix for temporary masks", NULL);
     
    208226    }
    209227
     228    if (psMetadataLookupBool(NULL, arguments, "-renorm") ||
     229        psMetadataLookupBool(NULL, recipe, "RENORM")) {
     230        psMetadataAddBool(config->arguments, PS_LIST_TAIL, "RENORM", 0, "Renormalise variance maps?", true);
     231    }
     232    VALUE_ARG_RECIPE_INT("-renorm-width", "RENORM.WIDTH", S32, 0);
     233    VALUE_ARG_RECIPE_STAT("-renorm-mean", "RENORM.MEAN");
     234    VALUE_ARG_RECIPE_STAT("-renorm-stdev", "RENORM.STDEV");
     235
    210236    valueArgRecipeStr(arguments, recipe, "-temp-image",  "TEMP.IMAGE",  config->arguments);
    211237    valueArgRecipeStr(arguments, recipe, "-temp-mask",   "TEMP.MASK",   config->arguments);
     
    218244    }
    219245
    220 
    221246    psTrace("ppStack", 1, "Done reading command-line arguments\n");
    222247    psFree(arguments);
     
    227252    return false;
    228253}
    229 
    230 
Note: See TracChangeset for help on using the changeset viewer.