IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jan 28, 2009, 5:24:09 PM (18 years ago)
Author:
Paul Price
Message:

Convering 'weight' to 'variance' where appropriate. Mostly just propagating changes from psModules. Fixed some mask types as well.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/pap_branch_20090128/ppMerge/src/ppMergeCamera.c

    r18967 r21219  
    8282{
    8383    bool haveMasks = false;             // Do we have masks?
    84     bool haveWeights = false;           // Do we have weight maps?
     84    bool haveVariances = false;           // Do we have variance maps?
    8585
    8686    ppMergeType type = psMetadataLookupS32(NULL, config->arguments, "TYPE"); // Type of frame
     
    108108        bool mdok;
    109109        psString mask = psMetadataLookupStr(&mdok, input, "MASK"); // Name of mask
    110         psString weight = psMetadataLookupStr(&mdok, input, "WEIGHT"); // Name of weight map
     110        psString variance = psMetadataLookupStr(&mdok, input, "VARIANCE"); // Name of variance map
    111111
    112112        // Add the image file
     
    150150        }
    151151
    152         // Optionally add the weight file
    153         if (weight && strlen(weight) > 0) {
    154             haveWeights = true;
    155             psArray *weightFiles = psArrayAlloc(1); // Array of filenames for this FPA
    156             weightFiles->data[0] = psMemIncrRefCounter(weight);
    157             psMetadataAddArray(config->arguments, PS_LIST_TAIL, "WEIGHT.FILENAMES", PS_META_REPLACE,
    158                                "Filenames of weight files", weightFiles);
    159             psFree(weightFiles);
     152        // Optionally add the variance file
     153        if (variance && strlen(variance) > 0) {
     154            haveVariances = true;
     155            psArray *varianceFiles = psArrayAlloc(1); // Array of filenames for this FPA
     156            varianceFiles->data[0] = psMemIncrRefCounter(variance);
     157            psMetadataAddArray(config->arguments, PS_LIST_TAIL, "VARIANCE.FILENAMES", PS_META_REPLACE,
     158                               "Filenames of variance files", varianceFiles);
     159            psFree(varianceFiles);
    160160
    161161            bool status;
    162             pmFPAfile *weightFile = pmFPAfileBindFromArgs(&status, imageFile, config, "PPMERGE.INPUT.WEIGHT",
    163                                                           "WEIGHT.FILENAMES");
     162            pmFPAfile *varianceFile = pmFPAfileBindFromArgs(&status, imageFile, config,
     163                                                            "PPMERGE.INPUT.VARIANCE", "VARIANCE.FILENAMES");
    164164            if (!status) {
    165                 psError(PS_ERR_UNKNOWN, false, "Unable to define file from weight %d (%s)", numFiles, weight);
    166                 return false;
    167             }
    168             if (weightFile->type != PM_FPA_FILE_WEIGHT) {
    169                 psError(PS_ERR_IO, true, "PPMERGE.INPUT.WEIGHT is not of type WEIGHT");
    170                 return false;
    171             }
    172             haveWeights = true;
     165                psError(PS_ERR_UNKNOWN, false, "Unable to define file from variance %d (%s)",
     166                        numFiles, variance);
     167                return false;
     168            }
     169            if (varianceFile->type != PM_FPA_FILE_VARIANCE) {
     170                psError(PS_ERR_IO, true, "PPMERGE.INPUT.VARIANCE is not of type VARIANCE");
     171                return false;
     172            }
     173            haveVariances = true;
    173174        }
    174175
     
    180181        psMetadataRemoveKey(config->arguments, "MASK.FILENAMES");
    181182    }
    182     if (psMetadataLookup(config->arguments, "WEIGHT.FILENAMES")) {
    183         psMetadataRemoveKey(config->arguments, "WEIGHT.FILENAMES");
     183    if (psMetadataLookup(config->arguments, "VARIANCE.FILENAMES")) {
     184        psMetadataRemoveKey(config->arguments, "VARIANCE.FILENAMES");
    184185    }
    185186    if (psMetadataLookup(config->arguments, "PSF.FILENAMES")) {
     
    189190    psMetadataAddS32(config->arguments, PS_LIST_TAIL, "INPUTS.NUM", 0, "Number of input files", numFiles);
    190191    psMetadataAddBool(config->arguments, PS_LIST_TAIL, "INPUTS.MASKS", 0, "Got input masks?", haveMasks);
    191     psMetadataAddBool(config->arguments, PS_LIST_TAIL, "INPUTS.WEIGHTS", 0,
    192                       "Got input weights?", haveWeights);
     192    psMetadataAddBool(config->arguments, PS_LIST_TAIL, "INPUTS.VARIANCES", 0,
     193                      "Got input variances?", haveVariances);
    193194
    194195
Note: See TracChangeset for help on using the changeset viewer.