IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

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).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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    }
Note: See TracChangeset for help on using the changeset viewer.