IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 21219


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

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

Location:
branches/pap_branch_20090128/ppMerge/src
Files:
7 edited

Legend:

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

    r19360 r21219  
    1111            "\tIMAGE(STR):     Image filename\n"
    1212            "\tMASK(STR):      Mask filename\n"
    13             "\tWEIGHT(STR)     Weight map filename\n"
    14             "where MASK and WEIGHT are optional.",
     13            "\tVARIANCE(STR)   Variance map filename\n"
     14            "where MASK and VARIANCE are optional.",
    1515            program);
    1616    fprintf(stderr, "\n");
     
    127127    psMetadataAddF32(arguments, PS_LIST_TAIL, "-frachigh", 0, "Fraction of low pixels to discard", NAN);
    128128    psMetadataAddS32(arguments, PS_LIST_TAIL, "-nkeep",    0, "Minimum number of pixels in stack to keep", 0);
    129     psMetadataAddBool(arguments, PS_LIST_TAIL, "-weights", 0, "Use image weights in combination?", false);
     129    psMetadataAddBool(arguments, PS_LIST_TAIL, "-variances", 0, "Use image variances in combination?", false);
    130130
    131131    // XXX EAM : not clear this should be allowed on the command line.
     
    272272    VALUE_ARG_RECIPE_FLOAT("-frachigh", "FRACHIGH", F32);
    273273    VALUE_ARG_RECIPE_INT("-nkeep",      "NKEEP",    S32, 0);
    274     VALUE_ARG_RECIPE_BOOL("-weights",   "WEIGHTS");
     274    VALUE_ARG_RECIPE_BOOL("-variances", "VARIANCES");
    275275
    276276    // XXX we do not supply this on the command line
  • 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
  • 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        }
  • branches/pap_branch_20090128/ppMerge/src/ppMergeLoop_Threaded.c

    r19081 r21219  
    2424    bool mdok;                          // Status of MD lookup
    2525    bool haveMasks = psMetadataLookupBool(&mdok, arguments, "INPUTS.MASKS"); // Do we have masks?
    26     bool haveWeights = psMetadataLookupBool(&mdok, arguments, "INPUTS.WEIGHTS"); // Do we have weights?
     26    bool haveVariances = psMetadataLookupBool(&mdok, arguments, "INPUTS.VARIANCES"); // Do we have variances?
    2727
    2828    psArray *inputs = ppMergeFileDataLevel(config, "PPMERGE.INPUT", PM_FPA_LEVEL_READOUT); // Input images
    29     psArray *masks = NULL, *weights = NULL; // Input masks and weights
     29    psArray *masks = NULL, *variances = NULL; // Input masks and variances
    3030    if (haveMasks) {
    3131        masks = ppMergeFileDataLevel(config, "PPMERGE.INPUT.MASK", PM_FPA_LEVEL_READOUT);
    3232    }
    33     if (haveWeights) {
    34         weights = ppMergeFileDataLevel(config, "PPMERGE.INPUT.WEIGHT", PM_FPA_LEVEL_READOUT);
     33    if (haveVariances) {
     34        variances = ppMergeFileDataLevel(config, "PPMERGE.INPUT.VARIANCE", PM_FPA_LEVEL_READOUT);
    3535    }
    3636
     
    4545    int nKeep = psMetadataLookupS32(NULL, arguments, "NKEEP"); // Minimum number of values to keep
    4646    psStatsOptions combineStat = psMetadataLookupS32(NULL, arguments, "COMBINE"); // Combination statistic
    47     bool useWeights = psMetadataLookupBool(NULL, arguments, "WEIGHTS"); // Use weights?
     47    bool useVariances = psMetadataLookupBool(NULL, arguments, "VARIANCES"); // Use variances?
    4848
    4949    // Fringe parameters
     
    5454
    5555    // set the mask and mark bit values based on the named masks
    56     psMaskType maskVal;
    57     psMaskType markVal;
     56    psImageMaskType maskVal, markVal;
    5857    if (!pmConfigMaskSetBits (&maskVal, &markVal, config)) {
    5958        psError (PS_ERR_UNKNOWN, true, "Unable to define the mask bit values");
     
    6968    combination->iter = iter;
    7069    combination->rej = rej;
    71     combination->weights = useWeights;
     70    combination->variances = useVariances;
    7271
    7372    psMetadata *stats = NULL;           // Statistics for output
     
    421420    psFree(inputs);
    422421    psFree(masks);
    423     psFree(weights);
     422    psFree(variances);
    424423    psFree(stats);
    425424    return true;
     
    430429    psFree(inputs);
    431430    psFree(masks);
    432     psFree(weights);
     431    psFree(variances);
    433432    psFree(stats);
    434433    return false;
  • branches/pap_branch_20090128/ppMerge/src/ppMergeMask.c

    r18756 r21219  
    2626    float smoothScale = psMetadataLookupF32(&mdok, config->arguments, "MASK.SMOOTH.SCALE"); // Radius to grow mask
    2727
    28     psMaskType markVal;
    29     psMaskType maskValRaw;
    30     if (!pmConfigMaskSetBits (&maskValRaw, &markVal, config)) {
    31         psError (PS_ERR_UNKNOWN, true, "Unable to define the mask bit values");
    32         return false;
     28    psImageMaskType markVal, maskValRaw;
     29    if (!pmConfigMaskSetBits(&maskValRaw, &markVal, config)) {
     30        psError (PS_ERR_UNKNOWN, true, "Unable to define the mask bit values");
     31        return false;
    3332    }
    3433
     
    3635    psMaskType maskValOut = pmConfigMaskGet (maskOutName, config);
    3736    if (!maskValOut) {
    38         psError (PS_ERR_UNKNOWN, true, "Undefined output mask bit value");
    39         return false;
    40     }
    41    
     37        psError (PS_ERR_UNKNOWN, true, "Undefined output mask bit value");
     38        return false;
     39    }
     40
    4241    psStats *statistics = psStatsAlloc(meanStat | stdevStat); // Statistics for background
    4342
     
    4544    pmChip *outChip = pmFPAfileThisChip(config->files, view, outName); // Output chip
    4645    psFree(outName);
    47    
     46
    4847    int numCells = 1;
    4948    if (chipStats) {
    50         // count the number of active cells for this chip:
    51         numCells = 0;
    52         for (int i = 0; i < outChip->cells->n; i++) {
    53             pmCell *cell = outChip->cells->data[i];
    54             if (!cell->process) continue;
    55             numCells ++;
    56         }
     49        // count the number of active cells for this chip:
     50        numCells = 0;
     51        for (int i = 0; i < outChip->cells->n; i++) {
     52            pmCell *cell = outChip->cells->data[i];
     53            if (!cell->process) continue;
     54            numCells ++;
     55        }
    5756    }
    5857
     
    7372        while ((inCell = pmFPAviewNextCell(inView, inFPA, 1))) {
    7473
    75             // the output FPA structure carries the information about which cells to process
     74            // the output FPA structure carries the information about which cells to process
    7675            pmCell *outCell = pmFPAfileThisCell(config->files, inView, "PPMERGE.OUTPUT.MASK"); // Output cell
    77             if (!outCell->process) continue;
     76            if (!outCell->process) continue;
    7877
    7978            pmHDU *hdu = pmHDUFromCell(inCell); // HDU for cell
     
    138137                int y = pixel / numCols;
    139138                if (mask && (mask->data.PS_TYPE_MASK_DATA[y][x] & maskValRaw)) continue;
    140                 if (outMask && (outMask->data.PS_TYPE_MASK_DATA[y][x] & maskValOut)) continue;
    141                 if (!isfinite(image->data.F32[y][x])) continue;
     139                if (outMask && (outMask->data.PS_TYPE_MASK_DATA[y][x] & maskValOut)) continue;
     140                if (!isfinite(image->data.F32[y][x])) continue;
    142141
    143142                values->data.F32[valueIndex++] = image->data.F32[y][x];
     
    153152                }
    154153
    155                 float mean = psStatsGetValue(statistics, meanStat);
    156                 float stdev = psStatsGetValue(statistics, stdevStat);
    157 
    158                 // this function increments the count for each suspect pixel in each input plane
    159                 // maskValRaw is used to test for valid input pixels
     154                float mean = psStatsGetValue(statistics, meanStat);
     155                float stdev = psStatsGetValue(statistics, stdevStat);
     156
     157                // this function increments the count for each suspect pixel in each input plane
     158                // maskValRaw is used to test for valid input pixels
    160159                if (!pmMaskFlagSuspectPixels(outRO, readout, mean, stdev, maskSuspect, maskValRaw)) {
    161160                    psError(PS_ERR_UNKNOWN, false, "Unable to find suspect values in file %d", i);
     
    186185            while ((inCell = pmFPAviewNextCell(inView, inFPA, 1))) {
    187186
    188                 // the output FPA structure carries the information about which cells to process
    189                 pmCell *outCell = pmFPAfileThisCell(config->files, inView, "PPMERGE.OUTPUT.MASK"); // Output cell
    190                 if (!outCell->process) continue;
     187                // the output FPA structure carries the information about which cells to process
     188                pmCell *outCell = pmFPAfileThisCell(config->files, inView, "PPMERGE.OUTPUT.MASK"); // Output cell
     189                if (!outCell->process) continue;
    191190
    192191                pmHDU *hdu = pmHDUFromCell(inCell); // HDU for cell
     
    198197                pmReadout *outRO = pmFPAfileThisReadout(config->files, inView, "PPMERGE.OUTPUT.MASK");
    199198
    200                 float mean = psStatsGetValue(statistics, meanStat);
    201                 float stdev = psStatsGetValue(statistics, stdevStat);
    202 
    203                 if (!pmMaskFlagSuspectPixels(outRO, readout, mean, stdev, maskSuspect, maskValRaw)) {
     199                float mean = psStatsGetValue(statistics, meanStat);
     200                float stdev = psStatsGetValue(statistics, stdevStat);
     201
     202                if (!pmMaskFlagSuspectPixels(outRO, readout, mean, stdev, maskSuspect, maskValRaw)) {
    204203                    psError(PS_ERR_UNKNOWN, false, "Unable to find suspect values in file %d", i);
    205204                    goto MERGE_MASK_ERROR;
     
    231230    while ((outCell = pmFPAviewNextCell(outView, outFPA, 1))) {
    232231
    233         // skip inactive cells
    234         if (!outCell->process) continue;
     232        // skip inactive cells
     233        if (!outCell->process) continue;
    235234
    236235        pmHDU *hdu = pmHDUFromCell(outCell); // HDU for cell
     
    242241        pmReadout *outRO = outCell->readouts->data[0]; // Output readout
    243242
    244         if (smoothSuspect) {
    245             // XXX test output of suspect pixel image
    246             psImage *suspects = psMetadataLookupPtr(NULL, outRO->analysis, PM_MASK_ANALYSIS_SUSPECT); // Suspect img
    247             assert (suspects);
    248             psImageSmooth (suspects, smoothScale, 3); // extend smoothing region to 3-sigma
    249         }
    250 
    251         // set the bad pixels to the value 'maskVal'
     243        if (smoothSuspect) {
     244            // XXX test output of suspect pixel image
     245            psImage *suspects = psMetadataLookupPtr(NULL, outRO->analysis, PM_MASK_ANALYSIS_SUSPECT); // Suspect img
     246            assert (suspects);
     247            psImageSmooth (suspects, smoothScale, 3); // extend smoothing region to 3-sigma
     248        }
     249
     250        // set the bad pixels to the value 'maskVal'
    252251        if (!pmMaskIdentifyBadPixels(outRO, maskValOut, maskBad, maskMode)) {
    253252            psError(PS_ERR_UNKNOWN, false, "Unable to mask bad pixels");
     
    343342    int numFiles = psMetadataLookupS32(NULL, config->arguments, "INPUTS.NUM"); // Number of inputs
    344343    bool haveMasks = psMetadataLookupBool(&mdok, config->arguments, "INPUTS.MASKS"); // Do we have masks?
    345     bool haveWeights = psMetadataLookupBool(&mdok, config->arguments, "INPUTS.WEIGHTS"); // Do we have weights?
     344    bool haveVariances = psMetadataLookupBool(&mdok, config->arguments, "INPUTS.VARIANCES"); // Got variances?
    346345    int iter = psMetadataLookupS32(NULL, config->arguments, "ITER"); // Number of rejection iterations
    347346
     
    363362        psFree(masks);
    364363    }
    365     if (haveWeights) {
    366         psArray *weights = ppMergeFileDataLevel(config, "PPMERGE.INPUT.WEIGHT", PM_FPA_LEVEL_READOUT);
    367         psFree(weights);
     364    if (haveVariances) {
     365        psArray *variances = ppMergeFileDataLevel(config, "PPMERGE.INPUT.VARIANCE", PM_FPA_LEVEL_READOUT);
     366        psFree(variances);
    368367    }
    369368
     
    405404        }
    406405
    407         if (outChip->data_exists) {
    408             psList *inChips = psListAlloc(NULL);
    409             for (int i=0; i < numFiles; i++) {
    410                 pmFPAfile *file = pmFPAfileSelectSingle(config->files, "PPMERGE.INPUT", i); // Input file
    411                 pmChip *chip = pmFPAviewThisChip(view, file->fpa);
    412                 psListAdd(inChips, PS_LIST_TAIL, chip);
    413             }
    414 
    415             // XXX I need to call pmConfigMaskWriteHeader for the PHU somewhere, after it is created!
    416 
    417             if (!pmConceptsAverageChips(outChip, inChips, true)) {
    418                 psError(PS_ERR_UNKNOWN, false, "Unable to average Chip concepts.");
    419                 psFree(inChips);
    420                 goto PPMERGE_MASK_ERROR;
    421             }
    422             psFree(inChips);
    423         }
     406        if (outChip->data_exists) {
     407            psList *inChips = psListAlloc(NULL);
     408            for (int i=0; i < numFiles; i++) {
     409                pmFPAfile *file = pmFPAfileSelectSingle(config->files, "PPMERGE.INPUT", i); // Input file
     410                pmChip *chip = pmFPAviewThisChip(view, file->fpa);
     411                psListAdd(inChips, PS_LIST_TAIL, chip);
     412            }
     413
     414            // XXX I need to call pmConfigMaskWriteHeader for the PHU somewhere, after it is created!
     415
     416            if (!pmConceptsAverageChips(outChip, inChips, true)) {
     417                psError(PS_ERR_UNKNOWN, false, "Unable to average Chip concepts.");
     418                psFree(inChips);
     419                goto PPMERGE_MASK_ERROR;
     420            }
     421            psFree(inChips);
     422        }
    424423        if (!pmFPAfileIOChecks(config, view, PM_FPA_AFTER)) {
    425424            goto PPMERGE_MASK_ERROR;
  • branches/pap_branch_20090128/ppMerge/src/ppMergeReadChunk.c

    r19014 r21219  
    99    bool mdok;
    1010    bool haveMasks = psMetadataLookupBool(&mdok, config->arguments, "INPUTS.MASKS"); // Do we have masks?
    11     bool haveWeights = psMetadataLookupBool(&mdok, config->arguments, "INPUTS.WEIGHTS");// Do we have weights?
     11    bool haveVariances = psMetadataLookupBool(&mdok, config->arguments,
     12                                              "INPUTS.VARIANCES");// Do we have variances?
    1213    int rows = psMetadataLookupS32(NULL, config->arguments, "ROWS"); // Number of rows to read per chunk
    1314
     
    4041                // override the recorded last scan
    4142                inRO->thisImageScan  = fileGroup->firstScan;
    42                 inRO->thisWeightScan = fileGroup->firstScan;
     43                inRO->thisVarianceScan = fileGroup->firstScan;
    4344                inRO->thisMaskScan   = fileGroup->firstScan;
    4445                inRO->forceScan      = true;
     
    6970                }
    7071
    71                 if (haveWeights && pmReadoutMoreWeight(inRO, file->fits, 0, rows, config)) {
     72                if (haveVariances && pmReadoutMoreVariance(inRO, file->fits, 0, rows, config)) {
    7273                    keepReading = true;
    73                     pmFPAfile *file = pmFPAfileSelectSingle(config->files, "PPMERGE.INPUT.WEIGHT", i);
    74                     if (!pmReadoutReadChunkWeight(inRO, file->fits, 0, rows, 0, config)) {
    75                         psError(PS_ERR_IO, false, "Unable to read chunk %d for file PPMERGE.INPUT.WEIGHT %d",
     74                    pmFPAfile *file = pmFPAfileSelectSingle(config->files, "PPMERGE.INPUT.VARIANCE", i);
     75                    if (!pmReadoutReadChunkVariance(inRO, file->fits, 0, rows, 0, config)) {
     76                        psError(PS_ERR_IO, false,
     77                                "Unable to read chunk %d for file PPMERGE.INPUT.VARIANCE %d",
    7678                                numChunk, i);
    7779                        *status = false;
  • branches/pap_branch_20090128/ppMerge/src/ppMergeScaleZero.c

    r18930 r21219  
    4343        pmFPAfileActivate(config->files, false, NULL);
    4444        psArray *files = ppMergeFileActivateSingle(config, PPMERGE_FILES_INPUT, true, i); // Activated files
    45         pmFPAfile *input = files->data[0]; // Representative file; should be the image (not mask or weight)
     45        pmFPAfile *input = files->data[0]; // Representative file; should be the image (not mask or variance)
    4646        pmFPA *fpa = input->fpa;        // FPA of interest
    4747        view = pmFPAviewAlloc(0);       // View to component of interest
Note: See TracChangeset for help on using the changeset viewer.