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/ppMergeFiles.c

    r20887 r21219  
    11#include "ppMerge.h"
    22
    3 const char *allFiles[] = { "PPMERGE.INPUT", "PPMERGE.INPUT.MASK", "PPMERGE.INPUT.WEIGHT",
     3const char *allFiles[] = { "PPMERGE.INPUT", "PPMERGE.INPUT.MASK", "PPMERGE.INPUT.VARIANCE",
    44                           "PPMERGE.OUTPUT", "PPMERGE.OUTPUT.COUNT", "PPMERGE.OUTPUT.SIGMA",
    55                           NULL };      // All files
    6 const char *inputFiles[] = { "PPMERGE.INPUT", "PPMERGE.INPUT.MASK", "PPMERGE.INPUT.WEIGHT",
     6const char *inputFiles[] = { "PPMERGE.INPUT", "PPMERGE.INPUT.MASK", "PPMERGE.INPUT.VARIANCE",
    77                             NULL };    // Input files
    88const char *outputFiles[] = { "PPMERGE.OUTPUT", "PPMERGE.OUTPUT.COUNT", "PPMERGE.OUTPUT.SIGMA",
     
    3737        }
    3838    }
    39     if (psMetadataLookupBool(&mdok, config->arguments, "INPUTS.WEIGHTS")) {
    40         pmFPAfile *file = pmFPAfileSelectSingle(config->files, "PPMERGE.INPUT.WEIGHT", num);
    41         if (!pmReadoutReadChunkWeight(readout, file->fits, 0, rows, 0, config)) {
    42             psError(PS_ERR_UNKNOWN, false, "Unable to read readout weight.");
     39    if (psMetadataLookupBool(&mdok, config->arguments, "INPUTS.VARIANCES")) {
     40        pmFPAfile *file = pmFPAfileSelectSingle(config->files, "PPMERGE.INPUT.VARIANCE", num);
     41        if (!pmReadoutReadChunkVariance(readout, file->fits, 0, rows, 0, config)) {
     42            psError(PS_ERR_UNKNOWN, false, "Unable to read readout variance.");
    4343            return false;
    4444        }
     
    7777        psFree(fileView);
    7878    }
    79     if (psMetadataLookupBool(&mdok, config->arguments, "INPUTS.WEIGHTS")) {
    80         pmFPAfile *weight = pmFPAfileSelectSingle(config->files, "PPMERGE.INPUT.WEIGHT", num); // Weight file
    81         pmFPAview *fileView = pmFPAviewForLevel(weight->fileLevel, view);
    82         if (!pmFPAfileOpen(weight, fileView, config)) {
    83             psError(PS_ERR_UNKNOWN, false, "Unable to open weight file %d", num);
     79    if (psMetadataLookupBool(&mdok, config->arguments, "INPUTS.VARIANCES")) {
     80        pmFPAfile *variance = pmFPAfileSelectSingle(config->files, "PPMERGE.INPUT.VARIANCE",
     81                                                    num); // Variance file
     82        pmFPAview *fileView = pmFPAviewForLevel(variance->fileLevel, view);
     83        if (!pmFPAfileOpen(variance, fileView, config)) {
     84            psError(PS_ERR_UNKNOWN, false, "Unable to open variance file %d", num);
    8485            psFree(fileView);
    8586            return false;
     
    113114    bool mdok;                          // Status of MD lookup
    114115    bool haveMasks = psMetadataLookupBool(&mdok, config->arguments, "INPUTS.MASKS"); // Do we have masks?
    115     bool haveWeights = psMetadataLookupBool(&mdok, config->arguments, "INPUTS.WEIGHTS"); // Got weights?
     116    bool haveVariances = psMetadataLookupBool(&mdok, config->arguments, "INPUTS.VARIANCES"); // Got variances?
    116117
    117118    const char **fileList = selectFiles(files); // Files to activate
     
    120121            continue;
    121122        }
    122         if (!haveWeights && strcmp(fileList[i], "PPMERGE.INPUT.WEIGHT") == 0) {
     123        if (!haveVariances && strcmp(fileList[i], "PPMERGE.INPUT.VARIANCE") == 0) {
    123124            continue;
    124125        }
     
    149150    bool mdok;                          // Status of MD lookup
    150151    bool haveMasks = psMetadataLookupBool(&mdok, config->arguments, "INPUTS.MASKS"); // Do we have masks?
    151     bool haveWeights = psMetadataLookupBool(&mdok, config->arguments, "INPUTS.WEIGHTS"); // Got weights?
     152    bool haveVariances = psMetadataLookupBool(&mdok, config->arguments, "INPUTS.VARIANCES"); // Got variances?
    152153
    153154    psList *list = psListAlloc(NULL);   // List of files
     
    157158            continue;
    158159        }
    159         if (!haveWeights && strcmp(fileList[i], "PPMERGE.INPUT.WEIGHT") == 0) {
     160        if (!haveVariances && strcmp(fileList[i], "PPMERGE.INPUT.VARIANCE") == 0) {
    160161            continue;
    161162        }
Note: See TracChangeset for help on using the changeset viewer.