IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Feb 1, 2009, 11:43:05 AM (17 years ago)
Author:
eugene
Message:

merging Doxygen templates added by Bill G

File:
1 edited

Legend:

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

    r21183 r21244  
     1/** @file ppMergeArguments.c
     2 *
     3 *  @brief
     4 *
     5 *  @ingroup ppMerge
     6 *
     7 *  @author IfA
     8 *  @version $Revision: 1.16 $ $Name: not supported by cvs2svn $
     9 *  @date $Date: 2009-02-01 21:43:05 $
     10 *  Copyright 2009 Institute for Astronomy, University of Hawaii
     11 */
     12
    113#include "ppMerge.h"
    214
    3 // Print usage information and die
    4 static void usage(const char *program,  // Name of the program
    5                   psMetadata *arguments // Command-line arguments
     15/**
     16 * Print usage information and die
     17 */
     18static void usage(const char *program,  ///< Name of the program
     19                  psMetadata *arguments ///< Command-line arguments
    620    )
    721{
     
    1832}
    1933
    20 // Get a float-point value from the command-line or recipe, and add it to the arguments
     34/**
     35 * Get a float-point value from the command-line or recipe, and add it to the arguments
     36 */
    2137#define VALUE_ARG_RECIPE_FLOAT(ARGNAME, RECIPENAME, TYPE) { \
    2238    ps##TYPE value = psMetadataLookup##TYPE(NULL, arguments, ARGNAME); \
     
    3349}
    3450
    35 // Get an integer value from the command-line or recipe, and add it to the arguments
     51/**
     52 * Get an integer value from the command-line or recipe, and add it to the arguments
     53 */
    3654#define VALUE_ARG_RECIPE_INT(ARGNAME, RECIPENAME, TYPE, UNSET) { \
    3755    ps##TYPE value = psMetadataLookup##TYPE(NULL, arguments, ARGNAME); \
     
    4866}
    4967
    50 // Get a boolean from the command-line or recipe, and add it to the arguments if either is set
     68/**
     69 * Get a boolean from the command-line or recipe, and add it to the arguments if either is set
     70 */
    5171#define VALUE_ARG_RECIPE_BOOL(ARGNAME, RECIPENAME) { \
    5272    bool value = (psMetadataLookupBool(NULL, arguments, ARGNAME) || \
     
    5575}
    5676
    57 // Get a statistic name from the command-line or recipe, and add the enum to the arguments
     77/**
     78 * Get a statistic name from the command-line or recipe, and add the enum to the arguments
     79 */
    5880#define VALUE_ARG_RECIPE_STAT(ARGNAME, RECIPENAME) { \
    5981    const char *stat = psMetadataLookupStr(NULL, arguments, ARGNAME); \
     
    6991}
    7092
    71 // Get a string from the command-line or recipe, and add to the arguments
     93/**
     94 * Get a string from the command-line or recipe, and add to the arguments
     95 */
    7296#define VALUE_ARG_RECIPE_STR(ARGNAME, RECIPENAME) { \
    7397    const char *str = psMetadataLookupStr(NULL, arguments, ARGNAME); \
     
    83107}
    84108
    85 // Get a string from the command-line or recipe, and add the appropriate mask value to the arguments
     109/**
     110 * Get a string from the command-line or recipe, and add the appropriate mask value to the arguments
     111 */
    86112#define VALUE_ARG_RECIPE_MASK(ARGNAME, RECIPENAME) { \
    87113    const char *str = psMetadataLookupStr(NULL, arguments, ARGNAME); \
     
    98124}
    99125
    100 // Get a string value from the command-line and add it to the target
    101 static bool valueArgStr(psMetadata *arguments, // Command-line arguments
    102                         const char *argName, // Argument name in the command-line arguments
    103                         const char *mdName, // Name for value in the metadata
    104                         psMetadata *target // Target metadata to which to add value
     126/**
     127 * Get a string value from the command-line and add it to the target
     128 */
     129static bool valueArgStr(psMetadata *arguments, ///< Command-line arguments
     130                        const char *argName, ///< Argument name in the command-line arguments
     131                        const char *mdName, ///< Name for value in the metadata
     132                        psMetadata *target ///< Target metadata to which to add value
    105133                        )
    106134{
    107     psString value = psMetadataLookupStr(NULL, arguments, argName); // Value of interest
     135    psString value = psMetadataLookupStr(NULL, arguments, argName); ///< Value of interest
    108136    if (value && strlen(value) > 0) {
    109137        return psMetadataAddStr(target, PS_LIST_TAIL, mdName, 0, NULL, value);
     
    116144    assert(config);
    117145
    118     psMetadata *arguments = psMetadataAlloc(); // Command-line arguments
     146    psMetadata *arguments = psMetadataAlloc(); ///< Command-line arguments
    119147    psMetadataAddStr(arguments, PS_LIST_TAIL, "-type", 0, "Type of calibration frame", NULL);
    120148    psMetadataAddStr(arguments, PS_LIST_TAIL, "-stats", 0, "MDC file to hold statistics ", NULL);
     
    136164    psMetadataAddStr(arguments, PS_LIST_TAIL, "-stdev",    0, "Statistic to use to measure the stdev", NULL);
    137165
    138     // Fringe construction parameters
     166    /** Fringe construction parameters */
    139167    psMetadataAddS32(arguments, PS_LIST_TAIL, "-fringe-num",     0, "Number of fringe regions", 0);
    140168    psMetadataAddS32(arguments, PS_LIST_TAIL, "-fringe-size",    0, "Half-size of fringe regions", 0);
     
    142170    psMetadataAddS32(arguments, PS_LIST_TAIL, "-fringe-ysmooth", 0, "Number of smoothing regions in y", 0);
    143171
    144     // Shutter construction parameters
     172    /** Shutter construction parameters */
    145173    psMetadataAddS32(arguments, PS_LIST_TAIL, "-shutter-size", 0, "Size for shutter measurement regions", 0);
    146174    psMetadataAddS32(arguments, PS_LIST_TAIL, "-shutter-iter", 0, "Number of iterations for shutter", 0);
    147175    psMetadataAddF32(arguments, PS_LIST_TAIL, "-shutter-rej",  0, "Rejection limit for shutter", NAN);
    148176
    149     // Mask construction parameters
     177    /** Mask construction parameters */
    150178    psMetadataAddF32(arguments, PS_LIST_TAIL, "-mask-suspect",  0, "Threshold for suspect pixels (sigma)", NAN);
    151179    psMetadataAddF32(arguments, PS_LIST_TAIL, "-mask-bad",      0, "Threshold for bad pixels (sigma)", NAN);
     
    189217    }
    190218
    191     unsigned int numBad = 0;                     // Number of bad lines
    192     psMetadata *inputs = psMetadataConfigRead(NULL, &numBad, argv[1], false); // Information about inputs
     219    unsigned int numBad = 0;                     ///< Number of bad lines
     220    psMetadata *inputs = psMetadataConfigRead(NULL, &numBad, argv[1], false); ///< Information about inputs
    193221    if (!inputs || numBad > 0) {
    194222        psError(PS_ERR_BAD_PARAMETER_VALUE, false, "Unable to cleanly read MDC file with inputs.");
     
    205233
    206234    // Set the type of calibration frame
    207     const char *typeStr = psMetadataLookupStr(NULL, arguments, "-type"); // Type of calibration
     235    const char *typeStr = psMetadataLookupStr(NULL, arguments, "-type"); ///< Type of calibration
    208236    if (!typeStr || strlen(typeStr) <= 0) {
    209237      psError(PS_ERR_UNKNOWN, false, "No -type specified.");
    210238      goto ERROR;
    211239    }
    212     ppMergeType type = PPMERGE_TYPE_UNKNOWN; // Enumerated type for frame type
     240    ppMergeType type = PPMERGE_TYPE_UNKNOWN; ///< Enumerated type for frame type
    213241    if (strcasecmp(typeStr, "BIAS") == 0) {
    214242      type = PPMERGE_TYPE_BIAS;
     
    258286    }
    259287
    260     psMetadata *recipe = psMetadataLookupMetadata(NULL, config->recipes, PPMERGE_RECIPE); // Recipe for ppSim
     288    psMetadata *recipe = psMetadataLookupMetadata(NULL, config->recipes, PPMERGE_RECIPE); ///< Recipe for ppSim
    261289    if (!recipe) {
    262290        psError(PS_ERR_UNEXPECTED_NULL, false, "Unable to find recipe %s", PPMERGE_RECIPE);
     
    264292    }
    265293
    266     // Standard combination parameters
     294    /** Standard combination parameters */
    267295    VALUE_ARG_RECIPE_INT("-rows",       "ROWS",     S32, 0);
    268296    VALUE_ARG_RECIPE_INT("-sample",     "SAMPLE",   S32, 0);
     
    281309    VALUE_ARG_RECIPE_STAT("-stdev",     "STDEV");
    282310
    283     // Fringe construction parameters
     311    /** Fringe construction parameters */
    284312    VALUE_ARG_RECIPE_INT("-fringe-num",     "FRINGE.NUM",     S32, 0);
    285313    VALUE_ARG_RECIPE_INT("-fringe-size",    "FRINGE.SIZE",    S32, 0);
     
    287315    VALUE_ARG_RECIPE_INT("-fringe-ysmooth", "FRINGE.YSMOOTH", S32, 0);
    288316
    289     // Shutter construction parameters
     317    /** Shutter construction parameters */
    290318    VALUE_ARG_RECIPE_INT("-shutter-size",  "SHUTTER.SIZE", S32, 0);
    291319
    292     // Mask construction parameters
     320    /** Mask construction parameters */
    293321    VALUE_ARG_RECIPE_FLOAT("-mask-suspect", "MASK.SUSPECT", F32);
    294322    VALUE_ARG_RECIPE_FLOAT("-mask-bad",     "MASK.BAD",     F32);
     
    300328    VALUE_ARG_RECIPE_FLOAT("-mask-smooth-scale", "MASK.SMOOTH.SCALE", F32);
    301329
    302     const char *maskModeStr = psMetadataLookupStr(NULL, arguments, "-mask-mode"); // Mode to identify bad pix
     330    const char *maskModeStr = psMetadataLookupStr(NULL, arguments, "-mask-mode"); ///< Mode to identify bad pix
    303331    if (!maskModeStr) {
    304332        maskModeStr = psMetadataLookupStr(NULL, recipe, "MASK.MODE");
     
    318346
    319347    if (type == PPMERGE_TYPE_DARK) {
    320         psMetadata *ordinates = psMetadataLookupMetadata(NULL, recipe, "DARK.ORDINATES"); // Ordinates info
    321         psArray *translated = psArrayAllocEmpty(psListLength(ordinates->list)); // Translated version
    322 
    323         psMetadataIterator *iter = psMetadataIteratorAlloc(ordinates, PS_LIST_HEAD, NULL); // Iterator
    324         psMetadataItem *item;           // Item from iteration
     348        psMetadata *ordinates = psMetadataLookupMetadata(NULL, recipe, "DARK.ORDINATES"); ///< Ordinates info
     349        psArray *translated = psArrayAllocEmpty(psListLength(ordinates->list)); ///< Translated version
     350
     351        psMetadataIterator *iter = psMetadataIteratorAlloc(ordinates, PS_LIST_HEAD, NULL); ///< Iterator
     352        psMetadataItem *item;           ///< Item from iteration
    325353        while ((item = psMetadataGetAndIncrement(iter))) {
    326             int order = 0;              // Polynomial order
    327             bool scale = false;         // Scale values?
    328             float min = NAN, max = NAN; // Minimum and maximum values for scaling
     354            int order = 0;              ///< Polynomial order
     355            bool scale = false;         ///< Scale values?
     356            float min = NAN, max = NAN; ///< Minimum and maximum values for scaling
    329357            switch (item->type) {
    330358              case PS_TYPE_S32:
     
    333361              case PS_DATA_METADATA:
    334362                order = psMetadataLookupS32(NULL, item->data.md, "ORDER");
    335                 bool mdok;                  // Status of MD lookup
     363                bool mdok;                  ///< Status of MD lookup
    336364                scale = psMetadataLookupBool(&mdok, item->data.md, "SCALE");
    337365                min = psMetadataLookupF32(&mdok, item->data.md, "MIN");
     
    361389        psMetadataAddArray(config->arguments, PS_LIST_TAIL, "DARK.ORDINATES", 0,
    362390                           "Ordinates to fit for dark", translated);
    363         psFree(translated);             // Drop reference
    364 
    365         psString darkNorm = psMetadataLookupStr(NULL, recipe, "DARK.NORM"); // Normalisation concept
     391        psFree(translated);             ///< Drop reference
     392
     393        psString darkNorm = psMetadataLookupStr(NULL, recipe, "DARK.NORM"); ///<Normalisation concept
    366394        if (darkNorm && strcmp(darkNorm, "NONE") != 0) {
    367395            psMetadataAddStr(config->arguments, PS_LIST_TAIL, "DARK.NORM", 0,
Note: See TracChangeset for help on using the changeset viewer.