IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 10270


Ignore:
Timestamp:
Nov 28, 2006, 5:06:41 PM (19 years ago)
Author:
Paul Price
Message:

Adding weights option.

Location:
trunk/ppMerge/src
Files:
2 edited

Legend:

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

    r9996 r10270  
    151151                    // Only reading and writing the first readout in each cell (plane 0)
    152152                    if (pmReadoutReadNext(stack->data[i], fits, 0, options->rows)) {
    153                         // For anything except BIAS and DARK, we want a mask
    154                         if (options->scale || options->zero || options->shutter) {
     153                        // If the mask value is set, we want to generate a mask
     154                        if (options->combine->maskVal) {
    155155                            pmReadoutSetMask(stack->data[i]);
    156156                        }
    157                         if (options->shutter) {
    158                             pmReadoutSetWeight(stack->data[i]);
     157
     158                        // If we're combining with weights, we want to generate weights.
     159                        if (options->combine->weights) {
     160
     161                            // If it's a bias or dark, set the gain to zero: noise only contributed by read
     162                            if ((!options->zero && !options->scale) || options->darktime) {
     163                                pmReadoutSetWeight(stack->data[i], false);
     164                            } else {
     165                                pmReadoutSetWeight(stack->data[i], true);
     166                            }
    159167                        }
    160168
  • trunk/ppMerge/src/ppMergeOptions.c

    r9996 r10270  
    5858    options->combine->nKeep = 1;
    5959    options->combine->maskVal = 0xff;
     60    options->combine->weights = false;
    6061
    6162    return options;
     
    6768
    6869// Parse a recipe option according to its type
    69 #define OPTION_PARSE(OPTION,MD,NAME,TYPE)                                                                    \
    70 {                                                                                                            \
    71     psMetadataItem *item = psMetadataLookup(MD, NAME);                                                       \
    72     if (item) {                                                                                              \
    73         OPTION = psMetadataItemParse##TYPE(item);                                                            \
    74     }                                                                                                        \
     70#define OPTION_PARSE(OPTION,MD,NAME,TYPE) \
     71{ \
     72    psMetadataItem *item = psMetadataLookup(MD, NAME); \
     73    if (item) { \
     74        OPTION = psMetadataItemParse##TYPE(item); \
     75    } else { \
     76        psWarning("Recipe option %s isn't specified; using default.\n", NAME); \
     77    } \
    7578}
    7679
     
    139142    OPTION_PARSE(options->combine->nKeep,    recipe, "NKEEP",          S32);
    140143    OPTION_PARSE(options->combine->maskVal,  recipe, "MASKVAL",        S32);
     144    OPTION_PARSE(options->combine->weights,  recipe, "WEIGHTS",        Bool);
    141145    OPTION_PARSE(options->fringeNum,         recipe, "FRINGE.NUM",     S32);
    142146    OPTION_PARSE(options->fringeSize,        recipe, "FRINGE.SIZE",    S32);
Note: See TracChangeset for help on using the changeset viewer.