IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 13901


Ignore:
Timestamp:
Jun 19, 2007, 4:49:08 PM (19 years ago)
Author:
Paul Price
Message:

Adding chip and mask output for chip-mosaicked files. Was going to make this the default output, but we only have to have it selected in the recipe. Reduced the name of the filerule down, so that it's not excessively long (e.g., PPIMAGE.OUTPUT.CHIP.MASK --> PPIMAGE.CHIP.MASK).

Location:
trunk/ppImage/src
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/ppImage/src/ppImage.c

    r13843 r13901  
    1818    if (config == NULL) {
    1919        psErrorStackPrint(stderr, "Unable to parse command-line arguments.");
     20        ppImageCleanup(config, NULL);
    2021        exit(PS_EXIT_CONFIG_ERROR);
    2122    }
     
    2627    if (options == NULL) {
    2728        psErrorStackPrint(stderr, "Unable to parse camera.");
     29        ppImageCleanup(config, options);
    2830        exit(PS_EXIT_CONFIG_ERROR);
    2931    }
     
    3234    if (!ppImageLoop(config, options)) {
    3335        psErrorStackPrint(stderr, "Unable to loop over input");
     36        ppImageCleanup(config, options);
    3437        exit(PS_EXIT_SYS_ERROR);
    3538    }
     
    6265            if (fpa->hdu->header) fprintf (stderr, "  (%d,%d) header\n", -1, -1);
    6366        } else {
    64             // fprintf (stderr, "  has no fpa data (%d,%d)\n", -1, -1);
    65         }
     67            // fprintf (stderr, "  has no fpa data (%d,%d)\n", -1, -1);
     68        }
    6669        for (int i = 0; i < fpa->chips->n; i++) {
    6770            pmChip *chip = fpa->chips->data[i];
     
    7275                if (chip->hdu->header) fprintf (stderr, "  (%d,%d) header\n", i, -1);
    7376            } else {
    74                 // fprintf (stderr, "  has no chip data (%d,%d)\n", i, -1);
    75             }
     77                // fprintf (stderr, "  has no chip data (%d,%d)\n", i, -1);
     78            }
    7679            for (int j = 0; j < chip->cells->n; j++) {
    7780                pmCell *cell = chip->cells->data[j];
     
    8285                    if (cell->hdu->header) fprintf (stderr, "  (%d,%d) header\n", i, j);
    8386                } else {
    84                     // fprintf (stderr, "  has no cell data (%d,%d)\n", i, j);
    85                 }
    86                 for (int k = 0; k < cell->readouts->n; k++) {
    87                     pmReadout *readout = cell->readouts->data[k];
    88                     if (readout) {
    89                         if (readout->image) fprintf (stderr, "  (%d,%d,%d) image\n", i, j, k);
    90                         if (readout->weight) fprintf (stderr, "  (%d,%d,%d) weight\n", i, j, k);
    91                         if (readout->mask) fprintf (stderr, "  (%d,%d,%d) masks\n", i, j, k);
    92                     }
    93                 }
     87                    // fprintf (stderr, "  has no cell data (%d,%d)\n", i, j);
     88                }
     89                for (int k = 0; k < cell->readouts->n; k++) {
     90                    pmReadout *readout = cell->readouts->data[k];
     91                    if (readout) {
     92                        if (readout->image) fprintf (stderr, "  (%d,%d,%d) image\n", i, j, k);
     93                        if (readout->weight) fprintf (stderr, "  (%d,%d,%d) weight\n", i, j, k);
     94                        if (readout->mask) fprintf (stderr, "  (%d,%d,%d) masks\n", i, j, k);
     95                    }
     96                }
    9497            }
    9598        }
  • trunk/ppImage/src/ppImage.h

    r13562 r13901  
    4848bool ppImageAddstar (pmConfig *config);
    4949
    50 bool ppImageMosaicChip (pmConfig *config, const pmFPAview *view, char *outFile, char *inFile);
    51 bool ppImageMosaicFPA (pmConfig *config, char *outFile, char *inFile);
     50bool ppImageMosaicChip (pmConfig *config, const ppImageOptions *options, const pmFPAview *view,
     51                        const char *outFile, const char *inFile);
     52bool ppImageMosaicFPA (pmConfig *config, const ppImageOptions *options,
     53                       const char *outFile, const char *inFile);
    5254
    5355void ppImageFileCheck (pmConfig *config);
  • trunk/ppImage/src/ppImageLoop.c

    r13837 r13901  
    2727            return false;
    2828        }
    29         stats = psMetadataAlloc();
     29        stats = psMetadataAlloc();
    3030        psFree(resolved);
    3131    }
     
    3434    if (!status) {
    3535        psErrorStackPrint(stderr, "Can't find input data!\n");
    36         exit(EXIT_FAILURE);
     36        ppImageCleanup(config, options);
     37        exit(PS_EXIT_PROG_ERROR);
    3738    }
    3839
     
    4243    // files associated with the science image
    4344    if (!pmFPAfileIOChecks(config, view, PM_FPA_BEFORE)) {
    44         psFree (view);
     45        psFree (view);
    4546        return false;
    4647    }
     
    5354
    5455        if (!pmFPAfileIOChecks(config, view, PM_FPA_BEFORE)) {
    55             psFree (view);
     56            psFree (view);
    5657            return false;
    5758        }
     
    6364            }
    6465            if (!pmFPAfileIOChecks(config, view, PM_FPA_BEFORE)) {
    65                 psFree (view);
     66                psFree (view);
    6667                return false;
    6768            }
     
    7879            while ((readout = pmFPAviewNextReadout (view, input->fpa, 1)) != NULL) {
    7980                if (!pmFPAfileIOChecks(config, view, PM_FPA_BEFORE)) {
    80                     psFree (view);
     81                    psFree (view);
    8182                    return false;
    8283                }
     
    8889                if (!ppImageDetrendReadout(config, options, view)) {
    8990                    psError(PS_ERR_UNKNOWN, false, "Unable to detrend readout.\n");
    90                     psFree (view);
     91                    psFree (view);
    9192                    return false;
    9293                }
     
    99100            pmChip *fringe = pmFPAfileThisChip(config->files, view, "PPIMAGE.FRINGE");
    100101            if (!ppImageDetrendFringeSolve(chip, fringe, options)) {
    101                 psFree (view);
     102                psFree (view);
    102103                return false;
    103104            }
     
    116117                pmCell *fringeCell = pmFPAfileThisCell(config->files, view, "PPIMAGE.FRINGE");
    117118                if (!ppImageDetrendFringeGenerate(cell, fringeCell)) {
    118                     psFree (view);
     119                    psFree (view);
    119120                    return false;
    120121                }
     
    127128                if (!mdok || !output) {
    128129                    psError(PS_ERR_UNEXPECTED_NULL, true, "Unable to find file PPIMAGE.OUTPUT.\n");
    129                     psFree (view);
    130                     return false;
    131                 }
    132 
    133                 if (!ppStats(stats, 
    134                              output->fpa,
    135                              view,
    136                              options->satMask | options->badMask | options->maskValue,
    137                              config)) {
     130                    psFree (view);
     131                    return false;
     132                }
     133
     134                if (!ppStats(stats,
     135                             output->fpa,
     136                             view,
     137                             options->satMask | options->badMask | options->maskValue,
     138                             config)) {
    138139                    psError(PS_ERR_UNEXPECTED_NULL, true, "Unable to generate stats for image.\n");
    139                     psFree (stats);
    140                     psFree (view);
    141                     return false;
    142                 }
    143             }
    144            
     140                    psFree (stats);
     141                    psFree (view);
     142                    return false;
     143                }
     144            }
     145
    145146            // Add MD5 information for cell
    146147            pmHDU *hdu = pmHDUFromCell(cell); // HDU that owns the cell
     
    162163        }
    163164
    164         if (!ppImageMosaicChip(config, view, "PPIMAGE.OUTPUT.CHIP", "PPIMAGE.OUTPUT")) {
     165        if (!ppImageMosaicChip(config, options, view, "PPIMAGE.CHIP", "PPIMAGE.OUTPUT")) {
    165166            psError(PS_ERR_UNKNOWN, false, "Unable to mosaic chip.\n");
    166             psFree (view);
     167            psFree (view);
    167168            return false;
    168169        }
    169170        if (!ppImageRebinChip(config, view, "PPIMAGE.BIN1")) {
    170171            psError(PS_ERR_UNKNOWN, false, "Unable to bin chip.\n");
    171             psFree (view);
     172            psFree (view);
    172173            return false;
    173174        }
    174175        if (!ppImageRebinChip(config, view, "PPIMAGE.BIN2")) {
    175176            psError(PS_ERR_UNKNOWN, false, "Unable to bin chip.\n");
    176             psFree (view);
     177            psFree (view);
    177178            return false;
    178179        }
     
    181182        if (options->doPhotom) {
    182183            if (!ppImagePhotom(config, view)) {
    183                 psError(PS_ERR_UNKNOWN, false, "error running photometry.\n");
    184                 psFree (view);
    185                 return false;
    186             }
     184                psError(PS_ERR_UNKNOWN, false, "error running photometry.\n");
     185                psFree (view);
     186                return false;
     187            }
    187188        }
    188189
     
    195196
    196197            if (!pmFPAfileIOChecks(config, view, PM_FPA_AFTER)) {
    197                 psFree(view);
     198                psFree(view);
    198199                return false;
    199200            }
     
    202203        // Close chip
    203204        if (!pmFPAfileIOChecks(config, view, PM_FPA_AFTER)) {
    204             psFree(view);
     205            psFree(view);
    205206            return false;
    206207        }
     
    221222
    222223    // XXX an optional full-scale FPA mosaic could happen here
    223     // it would require us to NOT free PPIMAGE.OUTPUT.CHIP until here
    224     // ppImageMosaicFPA (config, "PPIMAGE.OUTPUT.FPA", "PPIMAGE.OUTPUT.CHIP");
    225     ppImageMosaicFPA(config, "PPIMAGE.OUTPUT.FPA1", "PPIMAGE.BIN1");
    226     ppImageMosaicFPA(config, "PPIMAGE.OUTPUT.FPA2", "PPIMAGE.BIN2");
     224    // it would require us to NOT free PPIMAGE.CHIP until here
     225    // ppImageMosaicFPA (config, "PPIMAGE.OUTPUT.FPA", "PPIMAGE.CHIP");
     226    ppImageMosaicFPA(config, options, "PPIMAGE.OUTPUT.FPA1", "PPIMAGE.BIN1");
     227    ppImageMosaicFPA(config, options, "PPIMAGE.OUTPUT.FPA2", "PPIMAGE.BIN2");
    227228
    228229    // we perform astrometry on all chips after sources have been detected
    229230    if (options->doAstromChip || options->doAstromMosaic) {
    230231        if (!ppImageAstrom(config)) {
    231             psError(PS_ERR_UNKNOWN, false, "error running astrometry.\n");
    232             psFree(view);
    233             return false;
    234         }
     232            psError(PS_ERR_UNKNOWN, false, "error running astrometry.\n");
     233            psFree(view);
     234            return false;
     235        }
    235236    }
    236237
    237238    // Close FPA
    238239    if (!pmFPAfileIOChecks(config, view, PM_FPA_AFTER)) {
    239         psFree(view);
     240        psFree(view);
    240241        return false;
    241242    }
  • trunk/ppImage/src/ppImageMosaic.c

    r12818 r13901  
    55#include "ppImage.h"
    66
    7 bool ppImageMosaicChip(pmConfig *config, const pmFPAview *view, char *outFile, char *inFile)
     7bool ppImageMosaicChip(pmConfig *config, const ppImageOptions *options, const pmFPAview *view,
     8                       const char *outFile, const char *inFile)
    89{
    910    bool status;                        // Status of MD lookup
     
    3132            in->name, out->name, in->xBin, in->yBin, out->xBin, out->yBin);
    3233
    33     // XXX mosaic the chip, making a deep copy.  this has the side effect of making the 
     34    // XXX mosaic the chip, making a deep copy.  this has the side effect of making the
    3435    // output image products pure trimmed images, but also increases the memory footprint.
    35     status = pmChipMosaic(outChip, inChip, true);
     36    status = pmChipMosaic(outChip, inChip, true, options->blankMask);
    3637    return status;
    3738}
    3839
    39 bool ppImageMosaicFPA (pmConfig *config, char *outFile, char *inFile)
     40bool ppImageMosaicFPA (pmConfig *config, const ppImageOptions *options, const char *outFile,
     41                       const char *inFile)
    4042{
    4143    bool status;                        // Status of MD lookup
     
    7274    psTrace ("pmFPAMosaic", 5, "mosaic fpa %s to %s (xbin,ybin: %d,%d to %d,%d)\n",
    7375             in->name, out->name, in->xBin, in->yBin, out->xBin, out->yBin);
    74     return pmFPAMosaic(out->fpa, in->fpa, false);
     76    return pmFPAMosaic(out->fpa, in->fpa, false, options->blankMask);
    7577}
  • trunk/ppImage/src/ppImageOptions.c

    r13761 r13901  
    2828    options->badMask    = 0x00;         // Bad pixels
    2929    options->flatMask   = 0x00;         // Bad flat pixels
     30    options->blankMask  = 0x00;         // Blank (no data, cell gap) pixels
    3031
    3132    options->doNonLin   = false;        // Non-linearity correction
     
    147148
    148149        // What method do we use to measure the overscan statistics?
    149         // XXX allow user to specify psStats types by name
     150        // XXX allow user to specify psStats types by name
    150151        psStats *overscanStats = NULL;  // Statistics for overscan
    151152        psString stat = psMetadataLookupStr(NULL, recipe, "OVERSCAN.STAT");
     
    175176    options->badMask = pmConfigMask("BAD", config);
    176177    options->flatMask = pmConfigMask("FLAT", config);
    177 
     178    options->blankMask = pmConfigMask("BLANK", config);
    178179
    179180    options->doBias = psMetadataLookupBool(NULL, recipe, "BIAS");
  • trunk/ppImage/src/ppImageOptions.h

    r13593 r13901  
    99    psMaskType badMask;                 // Mask value to give bad pixels
    1010    psMaskType flatMask;                // Mask value to give bad flat pixels
     11    psMaskType blankMask;               // Mask value to give blank pixels
    1112
    1213    bool doBias;                        // Bias subtraction
  • trunk/ppImage/src/ppImageParseCamera.c

    r13844 r13901  
    2424    pmFPAfile *inputMask = pmFPAfileBindFromArgs(&status, input, config, "PPIMAGE.INPUT.MASK", "INPUT.MASK");
    2525    if (!status) {
    26         psError (PS_ERR_UNKNOWN, false, "failed to load find definition");
    27         return NULL;
     26        psError (PS_ERR_UNKNOWN, false, "failed to load find definition");
     27        return NULL;
    2828    }
    2929    if (inputMask && inputMask->type != PM_FPA_FILE_MASK) {
     
    3434    pmFPAfile *inputWeight = pmFPAfileBindFromArgs(&status, input, config, "PPIMAGE.INPUT.WEIGHT", "INPUT.WEIGHT");
    3535    if (!status) {
    36         psError (PS_ERR_UNKNOWN, false, "failed to load find definition");
    37         return NULL;
     36        psError (PS_ERR_UNKNOWN, false, "failed to load find definition");
     37        return NULL;
    3838    }
    3939    if (inputWeight && inputWeight->type != PM_FPA_FILE_WEIGHT) {
     
    5252    // not all input or output images are used in a given recipe
    5353    if (options->doBias) {
    54         if (!ppImageDefineFile (config, input->fpa, "PPIMAGE.BIAS", "BIAS", PM_FPA_FILE_IMAGE, PM_DETREND_TYPE_BIAS)) {
    55             psError (PS_ERR_IO, false, "Can't find a bias image source");
    56             psFree (options);
    57             return NULL;
    58         }
     54        if (!ppImageDefineFile (config, input->fpa, "PPIMAGE.BIAS", "BIAS", PM_FPA_FILE_IMAGE, PM_DETREND_TYPE_BIAS)) {
     55            psError (PS_ERR_IO, false, "Can't find a bias image source");
     56            psFree (options);
     57            return NULL;
     58        }
    5959    }
    6060    if (options->doDark) {
    61         if (!ppImageDefineFile (config, input->fpa, "PPIMAGE.DARK", "DARK", PM_FPA_FILE_IMAGE, PM_DETREND_TYPE_DARK)) {
    62             psError (PS_ERR_IO, false, "Can't find a dark image source");
    63             psFree (options);
    64             return NULL;
    65         }
     61        if (!ppImageDefineFile (config, input->fpa, "PPIMAGE.DARK", "DARK", PM_FPA_FILE_IMAGE, PM_DETREND_TYPE_DARK)) {
     62            psError (PS_ERR_IO, false, "Can't find a dark image source");
     63            psFree (options);
     64            return NULL;
     65        }
    6666    }
    6767    if (options->doMask) {
    68         if (!ppImageDefineFile (config, input->fpa, "PPIMAGE.MASK", "MASK", PM_FPA_FILE_MASK, PM_DETREND_TYPE_MASK)) {
    69             psError (PS_ERR_IO, false, "Can't find a mask image source");
    70             psFree (options);
    71             return NULL;
    72         }
     68        if (!ppImageDefineFile (config, input->fpa, "PPIMAGE.MASK", "MASK", PM_FPA_FILE_MASK, PM_DETREND_TYPE_MASK)) {
     69            psError (PS_ERR_IO, false, "Can't find a mask image source");
     70            psFree (options);
     71            return NULL;
     72        }
    7373    }
    7474    if (options->doShutter) {
    75         if (!ppImageDefineFile (config, input->fpa, "PPIMAGE.SHUTTER", "SHUTTER", PM_FPA_FILE_IMAGE, PM_DETREND_TYPE_SHUTTER)) {
    76             psError (PS_ERR_IO, false, "Can't find a flat image source");
    77             psFree (options);
    78             return NULL;
    79         }
     75        if (!ppImageDefineFile (config, input->fpa, "PPIMAGE.SHUTTER", "SHUTTER", PM_FPA_FILE_IMAGE, PM_DETREND_TYPE_SHUTTER)) {
     76            psError (PS_ERR_IO, false, "Can't find a flat image source");
     77            psFree (options);
     78            return NULL;
     79        }
    8080    }
    8181
    8282    if (options->doFlat) {
    83         if (!ppImageDefineFile (config, input->fpa, "PPIMAGE.FLAT", "FLAT", PM_FPA_FILE_IMAGE, PM_DETREND_TYPE_FLAT)) {
    84             psError (PS_ERR_IO, false, "Can't find a shutter image source");
    85             psFree (options);
    86             return NULL;
    87         }
     83        if (!ppImageDefineFile (config, input->fpa, "PPIMAGE.FLAT", "FLAT", PM_FPA_FILE_IMAGE, PM_DETREND_TYPE_FLAT)) {
     84            psError (PS_ERR_IO, false, "Can't find a shutter image source");
     85            psFree (options);
     86            return NULL;
     87        }
    8888    }
    8989
     
    136136skip_fringe:
    137137    if (options->doFringe) {
    138         if (!ppImageDefineFile (config, input->fpa, "PPIMAGE.FRINGE", "FRINGE", PM_FPA_FILE_FRINGE, PM_DETREND_TYPE_FRINGE)) {
    139             psError (PS_ERR_IO, false, "Can't find a fringe image source");
    140             return NULL;
    141         }
     138        if (!ppImageDefineFile (config, input->fpa, "PPIMAGE.FRINGE", "FRINGE", PM_FPA_FILE_FRINGE, PM_DETREND_TYPE_FRINGE)) {
     139            psError (PS_ERR_IO, false, "Can't find a fringe image source");
     140            return NULL;
     141        }
    142142    }
    143143
     
    178178
    179179    // XXX should these be bound explicitly to the output->fpa rather than the input->fpa?
    180     pmFPAfile *byChip = pmFPAfileDefineChipMosaic(config, input->fpa, "PPIMAGE.OUTPUT.CHIP");
    181     if (!byChip) {
    182         psError(PS_ERR_IO, false, _("Unable to generate new file from PPIMAGE.OUTPUT.CHIP"));
    183         psFree(options);
    184         return NULL;
    185     }
    186     if (byChip->type != PM_FPA_FILE_IMAGE) {
    187         psError(PS_ERR_IO, true, "PPIMAGE.OUTPUT.CHIP is not of type IMAGE");
    188         psFree(options);
    189         return NULL;
    190     }
     180    pmFPAfile *chipImage = pmFPAfileDefineChipMosaic(config, input->fpa, "PPIMAGE.CHIP");
     181    if (!chipImage) {
     182        psError(PS_ERR_IO, false, _("Unable to generate new file from PPIMAGE.CHIP"));
     183        psFree(options);
     184        return NULL;
     185    }
     186    if (chipImage->type != PM_FPA_FILE_IMAGE) {
     187        psError(PS_ERR_IO, true, "PPIMAGE.CHIP is not of type IMAGE");
     188        psFree(options);
     189        return NULL;
     190    }
     191    pmFPAfile *chipMask = pmFPAfileDefineOutput(config, chipImage->fpa, "PPIMAGE.CHIP.MASK");
     192    if (!chipMask) {
     193        psError(PS_ERR_IO, false, _("Unable to generate output file from PPIMAGE.CHIP.MASK"));
     194        psFree(options);
     195        return NULL;
     196    }
     197    if (chipMask->type != PM_FPA_FILE_MASK) {
     198        psError(PS_ERR_IO, true, "PPIMAGE.CHIP.MASK is not of type MASK");
     199        psFree(options);
     200        return NULL;
     201    }
     202    pmFPAfile *chipWeight = pmFPAfileDefineOutput(config, chipImage->fpa, "PPIMAGE.CHIP.WEIGHT");
     203    if (!chipWeight) {
     204        psError(PS_ERR_IO, false, _("Unable to generate output file from PPIMAGE.CHIP.WEIGHT"));
     205        psFree(options);
     206        return NULL;
     207    }
     208    if (chipWeight->type != PM_FPA_FILE_WEIGHT) {
     209        psError(PS_ERR_IO, true, "PPIMAGE.CHIP.WEIGHT is not of type WEIGHT");
     210        psFree(options);
     211        return NULL;
     212    }
     213
    191214    pmFPAfile *byFPA1 = pmFPAfileDefineFPAMosaic(config, input->fpa, "PPIMAGE.OUTPUT.FPA1");
    192215    if (!byFPA1) {
     
    215238    // we create a copy of the mosaicked image for psphot so we can write out a clean image
    216239    if (options->doPhotom) {
    217         pmFPAfile *psphotInput = pmFPAfileDefineFromFPA (config, byChip->fpa, 1, 1, "PSPHOT.INPUT");
     240        pmFPAfile *psphotInput = pmFPAfileDefineFromFPA (config, chipImage->fpa, 1, 1, "PSPHOT.INPUT");
    218241        PS_ASSERT (psphotInput, false);
    219242
     
    251274
    252275    // save any of these files?
    253     output->save = options->BaseFITS;
    254     byChip->save = options->ChipFITS;
     276    output->save = outMask->save = outWeight->save = options->BaseFITS;
     277    chipImage->save = chipMask->save = chipWeight->save = options->ChipFITS;
    255278    byFPA1->save = options->FPA1FITS;
    256279    byFPA2->save = options->FPA2FITS;
    257280
    258     // output is used as a carrier: input to byChip -> require the data to remain at the CHIP level
     281    // output is used as a carrier: input to chipImage -> require the data to remain at the CHIP level
    259282    output->freeLevel = PS_MIN (output->freeLevel, PM_FPA_LEVEL_CHIP);
    260283    output->dataLevel = output->freeLevel;
     
    267290    outWeight->dataLevel = output->dataLevel;
    268291
     292    // Ditto for the chip-mosaicked version
     293    chipMask->freeLevel   = chipImage->freeLevel;
     294    chipWeight->freeLevel = chipImage->freeLevel;
     295    chipMask->dataLevel   = chipImage->dataLevel;
     296    chipWeight->dataLevel = chipImage->dataLevel;
     297
    269298    // the input data is the same as the output data : force the free levels to match
    270299    input->freeLevel = PS_MIN (output->freeLevel, input->freeLevel);
    271300
    272301    // define the binned target files (which may just be carriers for some camera configurations)
    273     pmFPAfile *bin1 = pmFPAfileDefineFromFPA (config, byChip->fpa, options->xBin1, options->yBin1, "PPIMAGE.BIN1");
     302    pmFPAfile *bin1 = pmFPAfileDefineFromFPA (config, chipImage->fpa, options->xBin1, options->yBin1, "PPIMAGE.BIN1");
    274303    if (!bin1) {
    275304        psError(PS_ERR_IO, false, _("Unable to generate new file from PPIMAGE.BIN1"));
     
    283312    }
    284313
    285     pmFPAfile *bin2 = pmFPAfileDefineFromFPA (config, byChip->fpa, options->xBin2, options->yBin2, "PPIMAGE.BIN2");
     314    pmFPAfile *bin2 = pmFPAfileDefineFromFPA (config, chipImage->fpa, options->xBin2, options->yBin2, "PPIMAGE.BIN2");
    286315    if (!bin2) {
    287316        psError(PS_ERR_IO, false, _("Unable to generate new file from PPIMAGE.BIN2"));
     
    354383        outMask->save = false;
    355384        outWeight->save = false;
     385        chipMask->save = false;
     386        chipWeight->save = false;
    356387    }
    357388
  • trunk/ppImage/src/ppImagePhotom.c

    r13838 r13901  
    1717    pmFPAfile *input = psMetadataLookupPtr (&status, config->files, "PSPHOT.INPUT");
    1818    if (!status) {
    19         psError(PSPHOT_ERR_CONFIG, false, "PSPHOT.INPUT I/O file is not defined");
    20         return false;
     19        psError(PSPHOT_ERR_CONFIG, false, "PSPHOT.INPUT I/O file is not defined");
     20        return false;
    2121    }
    2222
     
    2828    // iterate over the cells and readout for this chip
    2929    while ((cell = pmFPAviewNextCell (view, input->fpa, 1)) != NULL) {
    30         psLogMsg ("ppImagePhotom", 4, "Cell %d: %x %x\n", view->cell, cell->file_exists, cell->process);
    31         if (! cell->process || ! cell->file_exists) { continue; }
     30        psLogMsg ("ppImagePhotom", 4, "Cell %d: %x %x\n", view->cell, cell->file_exists, cell->process);
     31        if (! cell->process || ! cell->file_exists) { continue; }
    3232
    33         // process each of the readouts
    34         while ((readout = pmFPAviewNextReadout (view, input->fpa, 1)) != NULL) {
    35             if (! readout->data_exists) { continue; }
     33        // process each of the readouts
     34        while ((readout = pmFPAviewNextReadout (view, input->fpa, 1)) != NULL) {
     35            if (! readout->data_exists) { continue; }
    3636
    37             // run the actual photometry analysis
    38             if (!psphotReadout (config, view)) {
    39                 psError(psErrorCodeLast(), false, "failure in psphotReadout for chip %d, cell %d, readout %d\n", view->chip, view->cell, view->readout);
    40                 return false;
    41             }
    42         }
     37            // run the actual photometry analysis
     38            if (!psphotReadout (config, view)) {
     39                psError(psErrorCodeLast(), false, "failure in psphotReadout for chip %d, cell %d, readout %d\n", view->chip, view->cell, view->readout);
     40                return false;
     41            }
     42        }
    4343    }
    4444
    45     // the PSPHOT.INPUT file is a temporary file used to carry PPIMAGE.OUTPUT.CHIP to psphotReadout
     45    // the PSPHOT.INPUT file is a temporary file used to carry PPIMAGE.CHIP to psphotReadout
    4646    // XXX not sure that this is needed...
    4747    pmFPAfileActivate (config->files, false, "PSPHOT.INPUT");
Note: See TracChangeset for help on using the changeset viewer.