IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Feb 5, 2009, 4:47:00 PM (17 years ago)
Author:
Paul Price
Message:

Merging pap_branch_20090128. Resolved a small number of conflicts. Compiles, but not tested in detail.

File:
1 edited

Legend:

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

    r21244 r21365  
    66 *
    77 *  @author IfA
    8  *  @version $Revision: 1.7 $ $Name: not supported by cvs2svn $
    9  *  @date $Date: 2009-02-01 21:43:05 $
     8 *  @version $Revision: 1.8 $ $Name: not supported by cvs2svn $
     9 *  @date $Date: 2009-02-06 02:44:31 $
    1010 *  Copyright 2009 Institute for Astronomy, University of Hawaii
    1111 */
     
    1313#include "ppMerge.h"
    1414
    15 const char *allFiles[] = { "PPMERGE.INPUT", "PPMERGE.INPUT.MASK", "PPMERGE.INPUT.WEIGHT",
     15const char *allFiles[] = { "PPMERGE.INPUT", "PPMERGE.INPUT.MASK", "PPMERGE.INPUT.VARIANCE",
    1616                           "PPMERGE.OUTPUT", "PPMERGE.OUTPUT.COUNT", "PPMERGE.OUTPUT.SIGMA",
    17                            NULL };      ///< All files
    18 const char *inputFiles[] = { "PPMERGE.INPUT", "PPMERGE.INPUT.MASK", "PPMERGE.INPUT.WEIGHT",
    19                              NULL };    ///< Input files
     17                           NULL };      // All files
     18const char *inputFiles[] = { "PPMERGE.INPUT", "PPMERGE.INPUT.MASK", "PPMERGE.INPUT.VARIANCE",
     19                             NULL };    // Input files
    2020const char *outputFiles[] = { "PPMERGE.OUTPUT", "PPMERGE.OUTPUT.COUNT", "PPMERGE.OUTPUT.SIGMA",
    2121                              NULL };   ///< Output files
     
    5151        }
    5252    }
    53     if (psMetadataLookupBool(&mdok, config->arguments, "INPUTS.WEIGHTS")) {
    54         pmFPAfile *file = pmFPAfileSelectSingle(config->files, "PPMERGE.INPUT.WEIGHT", num);
    55         if (!pmReadoutReadChunkWeight(readout, file->fits, 0, rows, 0, config)) {
    56             psError(PS_ERR_UNKNOWN, false, "Unable to read readout weight.");
     53    if (psMetadataLookupBool(&mdok, config->arguments, "INPUTS.VARIANCES")) {
     54        pmFPAfile *file = pmFPAfileSelectSingle(config->files, "PPMERGE.INPUT.VARIANCE", num);
     55        if (!pmReadoutReadChunkVariance(readout, file->fits, 0, rows, 0, config)) {
     56            psError(PS_ERR_UNKNOWN, false, "Unable to read readout variance.");
    5757            return false;
    5858        }
     
    9191        psFree(fileView);
    9292    }
    93     if (psMetadataLookupBool(&mdok, config->arguments, "INPUTS.WEIGHTS")) {
    94         pmFPAfile *weight = pmFPAfileSelectSingle(config->files, "PPMERGE.INPUT.WEIGHT", num); // Weight file
    95         pmFPAview *fileView = pmFPAviewForLevel(weight->fileLevel, view);
    96         if (!pmFPAfileOpen(weight, fileView, config)) {
    97             psError(PS_ERR_UNKNOWN, false, "Unable to open weight file %d", num);
     93    if (psMetadataLookupBool(&mdok, config->arguments, "INPUTS.VARIANCES")) {
     94        pmFPAfile *variance = pmFPAfileSelectSingle(config->files, "PPMERGE.INPUT.VARIANCE",
     95                                                    num); // Variance file
     96        pmFPAview *fileView = pmFPAviewForLevel(variance->fileLevel, view);
     97        if (!pmFPAfileOpen(variance, fileView, config)) {
     98            psError(PS_ERR_UNKNOWN, false, "Unable to open variance file %d", num);
    9899            psFree(fileView);
    99100            return false;
     
    127128    bool mdok;                          // Status of MD lookup
    128129    bool haveMasks = psMetadataLookupBool(&mdok, config->arguments, "INPUTS.MASKS"); // Do we have masks?
    129     bool haveWeights = psMetadataLookupBool(&mdok, config->arguments, "INPUTS.WEIGHTS"); // Got weights?
     130    bool haveVariances = psMetadataLookupBool(&mdok, config->arguments, "INPUTS.VARIANCES"); // Got variances?
    130131
    131132    const char **fileList = selectFiles(files); // Files to activate
     
    134135            continue;
    135136        }
    136         if (!haveWeights && strcmp(fileList[i], "PPMERGE.INPUT.WEIGHT") == 0) {
     137        if (!haveVariances && strcmp(fileList[i], "PPMERGE.INPUT.VARIANCE") == 0) {
    137138            continue;
    138139        }
     
    163164    bool mdok;                          // Status of MD lookup
    164165    bool haveMasks = psMetadataLookupBool(&mdok, config->arguments, "INPUTS.MASKS"); // Do we have masks?
    165     bool haveWeights = psMetadataLookupBool(&mdok, config->arguments, "INPUTS.WEIGHTS"); // Got weights?
     166    bool haveVariances = psMetadataLookupBool(&mdok, config->arguments, "INPUTS.VARIANCES"); // Got variances?
    166167
    167168    psList *list = psListAlloc(NULL);   // List of files
     
    171172            continue;
    172173        }
    173         if (!haveWeights && strcmp(fileList[i], "PPMERGE.INPUT.WEIGHT") == 0) {
     174        if (!haveVariances && strcmp(fileList[i], "PPMERGE.INPUT.VARIANCE") == 0) {
    174175            continue;
    175176        }
Note: See TracChangeset for help on using the changeset viewer.