IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
May 26, 2009, 1:59:32 PM (17 years ago)
Author:
beaumont
Message:

merged with trunk

Location:
branches/cnb_branches/cnb_branch_20090301
Files:
17 edited
4 copied

Legend:

Unmodified
Added
Removed
  • branches/cnb_branches/cnb_branch_20090301

  • branches/cnb_branches/cnb_branch_20090301/ppImage

  • branches/cnb_branches/cnb_branch_20090301/ppImage/src

    • Property svn:ignore
      •  

        old new  
        99stamp-h1
        1010.libs
         11ppImageVersionDefinitions.h
  • branches/cnb_branches/cnb_branch_20090301/ppImage/src/Makefile.am

    r23352 r24244  
    44        ppImage.h
    55
    6 #PPIMAGE_VERSION=`if [ -e ../../VERSION ]; then cat ../../VERSION; else svnversion; fi`
    7 #PPIMAGE_BRANCH=`if [ -e ../../BRANCH ]; then cat ../../BRANCH; else svn info | sed -n -e '/URL:/ h' -e '/Repository Root:/ { x; H; x; s|Repository Root: \(.*\)\nURL: \1\(.*\)|\2| ; s|^/|| ; s|/[a-zA-Z]*/src.*|| ; p }'; fi`
    8 #PPIMAGE_SOURCE=`if [ -e ../../SOURCE ]; then cat ../../SOURCE; else svn info | sed -n -e 's/Repository UUID: // p'; fi`
     6if HAVE_SVNVERSION
     7PPIMAGE_VERSION=`$(SVNVERSION) ..`
     8else
     9PPIMAGE_VERSION="UNKNOWN"
     10endif
     11
     12if HAVE_SVN
     13PPIMAGE_BRANCH=`$(SVN) info .. | $(SED) -n -e '/URL:/ h' -e '/Repository Root:/ { x; H; x; s|Repository Root: \(.*\)\nURL: \1\(.*\)|\2| ; s|^/|| ; s|/[a-zA-Z]*/src.*|| ; p }'`
     14PPIMAGE_SOURCE=`$(SVN) info | $(SED) -n -e 's/Repository UUID: // p'`
     15else
     16PPIMAGE_BRANCH="UNKNOWN"
     17PPIMAGE_SOURCE="UNKNOWN"
     18endif
    919
    1020# Force recompilation of ppImageVersion.c, since it gets the version information
    11 # ppImageVersion.c: FORCE
    12 #       touch ppImageVersion.c
    13 # FORCE: ;
     21ppImageVersion.c: ppImageVersionDefinitions.h
     22ppImageVersionDefinitions.h: ppImageVersionDefinitions.h.in FORCE
     23        -$(RM) ppImageVersionDefinitions.h
     24        $(SED) -e "s|@PPIMAGE_VERSION@|\"$(PPIMAGE_VERSION)\"|" -e "s|@PPIMAGE_BRANCH@|\"$(PPIMAGE_BRANCH)\"|" -e "s|@PPIMAGE_SOURCE@|\"$(PPIMAGE_SOURCE)\"|" ppImageVersionDefinitions.h.in > ppImageVersionDefinitions.h
     25FORCE: ;
    1426
    15 ppImage_CFLAGS = $(PPIMAGE_CFLAGS) $(PPSTATS_CFLAGS) $(PSASTRO_CFLAGS) $(PSPHOT_CFLAGS) $(PSMODULE_CFLAGS) $(PSLIB_CFLAGS) -DPPIMAGE_VERSION=$(SVN_VERSION) -DPPIMAGE_BRANCH=$(SVN_BRANCH) -DPPIMAGE_SOURCE=$(SVN_SOURCE)
     27BUILT_SOURCES = ppImageVersionDefinitions.h
     28
     29ppImage_CFLAGS = $(PPIMAGE_CFLAGS) $(PPSTATS_CFLAGS) $(PSASTRO_CFLAGS) $(PSPHOT_CFLAGS) $(PSMODULE_CFLAGS) $(PSLIB_CFLAGS)
    1630ppImage_LDFLAGS = $(PPIMAGE_LIBS) $(PSASTRO_LIBS) $(PPSTATS_LIBS) $(PSPHOT_LIBS) $(PSMODULE_LIBS) $(PSLIB_LIBS)
    1731ppImage_SOURCES = \
     
    3650        ppImageMetadataStats.c \
    3751        ppImageReplaceBackground.c \
     52        ppImageMeasureCrosstalk.c \
     53        ppImageCorrectCrosstalk.c \
    3854        ppImageDefineFile.c \
    3955        ppImageSetMaskBits.c \
     56        ppImageParityFlip.c \
     57        ppImageCheckCTE.c \
    4058        ppImageFileCheck.c \
    4159        ppImageVersion.c \
  • branches/cnb_branches/cnb_branch_20090301/ppImage/src/ppImage.h

    r23352 r24244  
    2626    bool doMaskBuild;                   // Build internal mask
    2727    bool doVarianceBuild;               // Build internal variance map
     28    bool doMaskSat;                     // mask saturated pixels
     29    bool doMaskLow;                     // mask low pixels
    2830    bool doMask;                        // Mask bad pixels
    2931    bool doNonLin;                      // Non-linearity correction
     
    4042    bool doAstromMosaic;                // full-mosaic Astrometry
    4143    bool doStats;                       // call ppStats on the image
     44    bool checkCTE;                      // measure pixel-based variance
     45    bool applyParity;                   // Apply Cell parities
     46
     47    bool doCrosstalkMeasure;            // measure crosstalk signal
     48    bool doCrosstalkCorrect;            // apply crosstalk correction
    4249
    4350    // output files requested
     
    6168    psImageMaskType markValue;          // apply this bit-mask to choose masked bits
    6269    psImageMaskType satMask;            // Mask value to give saturated pixels
    63     psImageMaskType badMask;            // Mask value to give bad pixels
     70    psImageMaskType lowMask;            // Mask value to give bad pixels
    6471    psImageMaskType flatMask;           // Mask value to give bad flat pixels
     72    psImageMaskType darkMask;           // Mask value to give bad dark pixels
    6573    psImageMaskType blankMask;          // Mask value to give blank pixels
    6674
     
    8795    float remnanceThresh;               // Threshold for remnance detection
    8896
    89     char *normClass;                    // class to use for per-class normalization
     97    char *normClass;                    // class to use for per-class normalization
    9098} ppImageOptions;
    9199
     
    111119bool ppImageSetMaskBits (pmConfig *config, ppImageOptions *options);
    112120
     121// apply the cell flips to the input data before analysis
     122bool ppImageParityFlip (pmConfig *config, const ppImageOptions *options, const pmFPAview *view);
     123
    113124// Loop over the input
    114125bool ppImageLoop(pmConfig *config, ppImageOptions *options);
     
    132143bool ppImageDetrendFree(pmConfig *config, pmFPAview *view);
    133144bool ppImageFringeFree(pmConfig *config, pmFPAview *view);
     145
     146bool ppImageCheckCTE(pmConfig *config, ppImageOptions *options, pmFPAview *view);
    134147
    135148// Record which detrend file was used for the detrending
     
    143156bool ppImageRebinChip (pmConfig *config, pmFPAview *view, ppImageOptions *options, char *outName);
    144157
    145 bool ppImagePhotom (pmConfig *config, pmFPAview *view);
    146 bool ppImageAstrom (pmConfig *config);
    147 bool ppImageAddstar (pmConfig *config);
     158bool ppImagePhotom(psMetadata *stats, pmConfig *config, pmFPAview *view);
     159bool ppImageAstrom(pmConfig *config, psMetadata *stats);
     160bool ppImageAddstar(pmConfig *config);
    148161
    149162// Subtract background from the chip-mosaicked image
     
    180193
    181194
     195// measure the crosstalk signal
     196bool ppImageMeasureCrosstalk(pmConfig *config, ppImageOptions *options, pmFPAview *view);
     197
     198// correct the crosstalk signal
     199bool ppImageCorrectCrosstalk(pmConfig *config, ppImageOptions *options, pmFPAview *view);
     200
    182201// Measure fringes
    183202bool ppImageDetrendFringeMeasure(pmReadout *readout, // Readout to measure
  • branches/cnb_branches/cnb_branch_20090301/ppImage/src/ppImageAstrom.c

    r16084 r24244  
    77// this function is mostly equivalent to the top-level of psastro, with some
    88// modifications since the data has already been loaded.
    9 bool ppImageAstrom (pmConfig *config) {
     9bool ppImageAstrom (pmConfig *config, psMetadata *stats) {
    1010
    1111    bool status;
     
    2727    }
    2828
    29     if (!psastroAnalysis (config)) {
     29    if (!psastroAnalysis(config, stats)) {
    3030        psError (PSASTRO_ERR_UNKNOWN, false, "failure in psastro analysis\n");
    3131        return false;
  • branches/cnb_branches/cnb_branch_20090301/ppImage/src/ppImageCheckCTE.c

    r23594 r24244  
    6060            fineRegion = psImageBinningSetFineRegion (binning, ruffRegion);
    6161            fineRegion = psRegionForImage (image, fineRegion);
    62             if (fineRegion.x0 >= image->numCols || fineRegion.x1 >= image->numCols ||
    63                 fineRegion.y0 >= image->numRows || fineRegion.y1 >= image->numRows) {
    64                 continue;
    65             }
     62            if (fineRegion.x0 >= image->numCols) continue;
     63            if (fineRegion.y0 >= image->numRows) continue;
    6664
    6765            psImage *subset  = psImageSubset (image, fineRegion);
     
    8583            float normVariance = PS_SQR(stats->robustStdev) / cellMedian;
    8684            // float normVariance = PS_SQR(stats->sampleStdev) / cellMedian;
     85            // if (!isfinite(normVariance)) fprintf (stderr, "** normVariance is nan **\n");
    8786
    8887            // apply resulting value to the input pixels
    8988            for (int jy = fineRegion.y0; jy < fineRegion.y1; jy++) {
     89              if (jy < 0) continue;
     90              if (jy >= image->numRows) continue;
    9091              for (int jx = fineRegion.x0; jx < fineRegion.x1; jx++) {
     92                if (jx < 0) continue;
     93                if (jx >= image->numCols) continue;
    9194                image->data.F32[jy][jx] = normVariance;
    9295              }
  • branches/cnb_branches/cnb_branch_20090301/ppImage/src/ppImageDetrendReadout.c

    r23352 r24244  
    1717    // Masking on the basis of pixel value needs to be done before anything else, so the values are pristine.
    1818    if (options->doMaskBuild) {
    19         pmReadoutGenerateMask(input, options->satMask, options->badMask);
     19        psImageMaskType satMask = options->doMaskSat ? options->satMask : 0;
     20        psImageMaskType lowMask = options->doMaskLow ? options->lowMask : 0;
     21        pmReadoutGenerateMask(input, satMask, lowMask);
    2022    }
    2123    // apply the externally supplied mask to the input->mask pixels
     
    5456        if (!pmBiasSubtract(input, options->overscan, bias, oldDark, view)) {
    5557            psError(PS_ERR_UNKNOWN, false, "Unable to subtract bias.");
    56             psFree(detview);
     58            psFree(detview);
    5759            return false;
    5860        }
     
    6668
    6769    if (options->doDark && dark) {
    68         if (!pmDarkApply(input, dark, options->maskValue)) {
     70        if (!pmDarkApply(input, dark, options->darkMask)) {
    6971            psError(PS_ERR_UNKNOWN, false, "Unable to subtract dark.");
    70             psFree(detview);
     72            psFree(detview);
    7173            return false;
    7274        }
     
    7476
    7577    if (options->doRemnance) {
    76         if (!pmRemnance(input, options->maskValue, options->badMask,
     78        if (!pmRemnance(input, options->maskValue, options->lowMask,
    7779                        options->remnanceSize, options->remnanceThresh)) {
    7880            psError(PS_ERR_UNKNOWN, false, "Unable to mask remnance.");
    79             psFree(detview);
     81            psFree(detview);
    8082            return false;
    8183        }
     
    8688        pmReadout *shutter = pmFPAfileThisReadout(config->files, detview, "PPIMAGE.SHUTTER");
    8789        if (!pmShutterCorrectionApply(input, shutter, pmConfigMaskGet("FLAT", config))) {
    88             psFree(detview);
     90            psFree(detview);
    8991            return false;
    9092        }
     
    9597        pmReadout *flat = pmFPAfileThisReadout(config->files, detview, "PPIMAGE.FLAT");
    9698        if (!pmFlatField(input, flat, options->flatMask)) {
    97             psFree(detview);
     99            psFree(detview);
    98100            return false;
    99101        }
     
    117119    psMetadata *normlist = psMetadataLookupMetadata(&mdok, config->arguments, "NORMALIZATION.TABLE");
    118120    if (normlist) {
    119         pmFPAfile *inputFile = psMetadataLookupPtr(&mdok, config->files, "PPIMAGE.INPUT");
     121        pmFPAfile *inputFile = psMetadataLookupPtr(&mdok, config->files, "PPIMAGE.INPUT");
    120122
    121         // get the menu of class IDs
    122         psMetadata *menu = psMetadataLookupMetadata(&mdok, inputFile->camera, "CLASSID"); 
     123        // get the menu of class IDs
     124        psMetadata *menu = psMetadataLookupMetadata(&mdok, inputFile->camera, "CLASSID");
    123125        if (!menu) {
    124126            psError(PS_ERR_IO, false, "Unable to find CLASSID metadata in camera configuration");
    125             psFree(detview);
     127            psFree(detview);
    126128            return false;
    127129        }
    128         // get the rule for class_id for the desired class
    129         const char *rule = psMetadataLookupStr(&mdok, menu, options->normClass); 
     130        // get the rule for class_id for the desired class
     131        const char *rule = psMetadataLookupStr(&mdok, menu, options->normClass);
    130132        if (!rule) {
    131133            psError(PS_ERR_IO, false, "Unable to find NORM.CLASS value %s in CLASSID in camera configuration", options->normClass);
    132             psFree(detview);
     134            psFree(detview);
    133135            return false;
    134136        }
    135         // get the class_id from the rule
     137        // get the class_id from the rule
    136138        char *classID = pmFPAfileNameFromRule(rule, inputFile, view);
    137139        if (!classID) {
    138140            psError(PS_ERR_IO, false, "error converting CLASSID rule %s to name\n", rule);
    139             psFree(detview);
     141            psFree(detview);
    140142            return false;
    141143        }
    142144
    143         // get normalization from the class_id
    144         float norm = psMetadataLookupF32 (&mdok, normlist, classID);
     145        // get normalization from the class_id
     146        float norm = psMetadataLookupF32 (&mdok, normlist, classID);
     147        if (!mdok) {
     148            psError(PS_ERR_IO, false, "failed to find class ID %s in normalization table\n", classID);
     149            psFree(detview);
     150            return false;
     151        }
    145152
    146153        pmHDU *hdu = pmHDUFromReadout(input); // HDU of interest
     
    150157        psFree(comment);
    151158
    152         // apply the normalization
     159        // apply the normalization
    153160        psBinaryOp(input->image, input->image, "*", psScalarAlloc(norm, PS_TYPE_F32));
    154161
    155         psFree (classID);
     162        psFree (classID);
    156163    }
    157164# endif
     
    160167        pmCell *fringe = pmFPAfileThisCell(config->files, detview, "PPIMAGE.FRINGE");
    161168        if (!ppImageDetrendFringeMeasure(input, fringe, false, options)) {
    162             psFree(detview);
     169            psFree(detview);
    163170            return false;
    164171        }
  • branches/cnb_branches/cnb_branch_20090301/ppImage/src/ppImageErrorCodes.dat

    r11259 r24244  
    11#
    22# This file is used to generate ppImageErrorClasses.h
    3 #
    4 BASE = 500              First value we use; lower values belong to psLib
     3
     4BASE = 5000             First value we use; lower values belong to psLib
    55# these errors correspond to standard exit conditions
    66ARGUMENTS               Incorrect arguments
  • branches/cnb_branches/cnb_branch_20090301/ppImage/src/ppImageErrorCodes.h.in

    r11259 r24244  
    99 */
    1010typedef enum {
    11     PPIMAGE_ERR_BASE = 512,
     11    PPIMAGE_ERR_BASE = 5000,
    1212    PPIMAGE_ERR_${ErrorCode},
    1313    PPIMAGE_ERR_NERROR
  • branches/cnb_branches/cnb_branch_20090301/ppImage/src/ppImageLoop.c

    r23352 r24244  
    1313bool ppImageLoop(pmConfig *config, ppImageOptions *options)
    1414{
    15     psMetadata *stats = options->doStats ? psMetadataAlloc() : NULL; // Statistics to output
     15    psMetadata *stats = NULL;          // Statistics to output
    1616    float timeDetrend = 0;              // Amount of time spent in detrend
    1717    float timePhot = 0;                 // Amount of time spent in photometry
     18
     19    if (options->doStats) {
     20        stats = psMetadataAlloc();
     21        psMetadataAddS32(stats, PS_LIST_TAIL, "QUALITY", 0, "No problems", 0);
     22    }
    1823
    1924    bool status;                        // Status of MD lookup
     
    4651        }
    4752
     53        // crosstalk measurement needs to be done on the entire chip at once, and before
     54        // signal levels are modified by the detrending.  If crosstalk measurement is
     55        // requested, the read-level for the images is set to CHIP.
     56        if (!ppImageMeasureCrosstalk(config, options, view)) {
     57          ESCAPE("Unable to perform crosstalk correction");
     58        }
     59
     60        // crosstalk correction needs to be done on the entire chip at once, and before
     61        // signal levels are modified by the detrending.  If crosstalk correction is
     62        // requested, the read-level for the images is set to CHIP.
     63        if (!ppImageCorrectCrosstalk(config, options, view)) {
     64          ESCAPE("Unable to perform crosstalk correction");
     65        }
     66
    4867        psTimerStart(TIMER_DETREND);
    4968        pmCell *cell;                   // Cell from chip
     
    8099                }
    81100
     101                // perform the detrend analysis
     102                if (!ppImageParityFlip(config, options, view)) {
     103                    ESCAPE("Unable to detrend readout");
     104                }
     105
     106                // XXX TEST:
     107                // psphotSaveImage (NULL, readout->image, "test.image.fits");
     108
    82109                // XXX set the options->*Mask values here (after the mask images have been loaded
    83110                // and before any of the value are used)
     
    134161        psTimerStart(TIMER_PHOT);
    135162        if (options->doPhotom) {
    136             if (!ppImagePhotom(config, view)) {
     163            if (!ppImagePhotom(stats, config, view)) {
    137164                ESCAPE("error running photometry.");
    138165            }
     
    195222    // this also performs the psastro file IO
    196223    if (options->doAstromChip || options->doAstromMosaic) {
    197         if (!ppImageAstrom(config)) {
     224        if (!ppImageAstrom(config, stats)) {
    198225            ESCAPE("error running astrometry.");
    199226        }
     
    218245    psString dump_file = psMetadataLookupStr(&status, config->arguments, "DUMP_CONFIG");
    219246    if (dump_file) {
    220         pmConfigDump(config, input->fpa, dump_file);
     247        pmConfigDump(config, dump_file);
    221248    }
    222249
  • branches/cnb_branches/cnb_branch_20090301/ppImage/src/ppImageOptions.c

    r23352 r24244  
    1919    // actions which ppImage should perform
    2020    options->doMaskBuild     = false;   // Build internal mask
    21     options->doVarianceBuild   = false;   // Build internal variance
     21    options->doMaskSat       = false;   // mask saturated pixels
     22    options->doMaskLow       = false;   // mask low pixels
     23    options->doVarianceBuild = false;   // Build internal variance
    2224    options->doMask          = false;   // Mask bad pixels
    2325    options->doNonLin        = false;   // Non-linearity correction
     
    3335    options->doAstromMosaic  = false;   // Astrometry (full-mosaic)
    3436    options->doStats         = false;   // Measure and save image statistics
     37    options->applyParity     = false;   // Apply Cell parities
    3538
    3639    // output files requested
     
    5356    options->maskValue       = 0x00;    // Default mask value (used to skip / ignore pixels)
    5457    options->satMask         = 0x00;    // Saturated pixels (supplied to pmReadoutGenerateMask)
    55     options->badMask         = 0x00;    // Bad (low) pixels (supplied to pmReadoutGenerateMask)
     58    options->lowMask         = 0x00;    // out-of-bounds (low) pixels (supplied to pmReadoutGenerateMask)
    5659    options->flatMask        = 0x00;    // Bad flat pixels (supplied to pmFlatField)
     60    options->darkMask        = 0x00;    // Bad dark pixels (supplied to pmDarkApply)
    5761    options->blankMask       = 0x00;    // Blank (no data, cell gap) pixels (supplied to pmChipMosaic, pmFPAMosaic)
    5862    options->markValue       = 0x00;    // A safe bit for internal marking
     63
     64    // crosstalk options
     65    options->doCrosstalkMeasure = false;   // measure crosstalk
     66    options->doCrosstalkCorrect = false;   // correct crosstalk
    5967
    6068    // Non-linearity default options
     
    197205    // for these images, even if not required otherwise
    198206    options->doMaskBuild = psMetadataLookupBool(NULL, recipe, "MASK.BUILD");
     207    options->doMaskSat   = psMetadataLookupBool(NULL, recipe, "MASK.SATURATED");
     208    options->doMaskLow   = psMetadataLookupBool(NULL, recipe, "MASK.LOW");
    199209    options->doVarianceBuild = psMetadataLookupBool(NULL, recipe, "VARIANCE.BUILD");
    200210
    201211    // Mask recipe options (note that mask bit values are set in ppImageSetMaskBits.c)
    202212    options->doMask = psMetadataLookupBool(NULL, recipe, "MASK");
     213
     214    // Mask recipe options (note that mask bit values are set in ppImageSetMaskBits.c)
     215    options->doCrosstalkMeasure = psMetadataLookupBool(NULL, recipe, "CROSSTALK.MEASURE");
     216    options->doCrosstalkCorrect = psMetadataLookupBool(NULL, recipe, "CROSSTALK.CORRECT");
    203217
    204218    options->doBias = psMetadataLookupBool(NULL, recipe, "BIAS");
     
    214228        options->doStats = true;
    215229    }
     230
     231    options->applyParity = psMetadataLookupBool(NULL, recipe, "APPLY.CELL.PARITY");
    216232
    217233    // binned image options
  • branches/cnb_branches/cnb_branch_20090301/ppImage/src/ppImagePhotom.c

    r20410 r24244  
    66
    77// In this function, we perform the psphot analysis routine for the chip-mosaicked images
    8 bool ppImagePhotom (pmConfig *config, pmFPAview *view) {
     8bool ppImagePhotom(psMetadata *stats, pmConfig *config, pmFPAview *view) {
    99
    1010    bool status;
     
    1212    pmReadout *readout;
    1313
    14     psphotInit ();
     14    psphotInit();
    1515
    1616    // find or define a pmFPAfile PSPHOT.INPUT
     
    3737            // run the actual photometry analysis
    3838            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;
     39                // This is likely a data quality issue
     40                // XXX Split into multiple cases using error codes?
     41                psErrorStackPrint(stderr, "Unable to perform photometry on image");
     42                psWarning("Unable to perform photometry on image --- suspect bad data quality.");
     43                if (stats && psMetadataLookupS32(NULL, stats, "QUALITY") == 0) {
     44                    psMetadataAddS32(stats, PS_LIST_TAIL, "QUALITY", PS_META_REPLACE,
     45                                     "Unable to perform photometry on image", psErrorCodeLast());
     46                }
     47                psErrorClear();
     48                psphotFilesActivate(config, false);
    4149            }
    4250
    43             // we want to save the MASK as modified by psphot, but not the data or weight
    44             // free the old mask and replace with a memory copy of the new mask
    45             pmReadout *oldReadout = pmFPAviewThisReadout (view, input->src);
    46             pmReadout *newReadout = pmFPAviewThisReadout (view, input->fpa);
    47             psFree (oldReadout->mask);
    48             oldReadout->mask = psMemIncrRefCounter (newReadout->mask);
     51            // we want to save the MASK as modified by psphot, but not the data or weight
     52            // free the old mask and replace with a memory copy of the new mask
     53            pmReadout *oldReadout = pmFPAviewThisReadout(view, input->src);
     54            pmReadout *newReadout = pmFPAviewThisReadout(view, input->fpa);
     55            psFree (oldReadout->mask);
     56            oldReadout->mask = psMemIncrRefCounter(newReadout->mask);
    4957        }
    5058    }
  • branches/cnb_branches/cnb_branch_20090301/ppImage/src/ppImageReplaceBackground.c

    r23352 r24244  
    147147            if (!isfinite(value)) {
    148148                image->data.F32[y][x] = NAN;
    149                 mask->data.PS_TYPE_IMAGE_MASK_DATA[y][x] |= options->badMask;
     149                mask->data.PS_TYPE_IMAGE_MASK_DATA[y][x] |= options->lowMask;
    150150            } else {
    151151                image->data.F32[y][x] -= value;
     
    164164                if (!isfinite(value)) {
    165165                    image->data.F32[y][x] = NAN;
    166                     mask->data.PS_TYPE_IMAGE_MASK_DATA[y][x] |= options->badMask;
     166                    mask->data.PS_TYPE_IMAGE_MASK_DATA[y][x] |= options->lowMask;
    167167                } else {
    168168                    image->data.F32[y][x] -= value;
  • branches/cnb_branches/cnb_branch_20090301/ppImage/src/ppImageSetMaskBits.c

    r21364 r24244  
    1414    // at this point we know we have valid values for required entries SAT, BAD, FLAT, BLANK:
    1515
    16     // mask for non-linear flat corrections
     16    // mask for bad flat corrections
    1717    options->flatMask = pmConfigMaskGet("FLAT", config);
    1818    psAssert (options->flatMask, "flat mask not set");
     19
     20    // mask for bad dark corrections
     21    options->darkMask = pmConfigMaskGet("DARK", config);
     22    psAssert (options->darkMask, "dark mask not set");
    1923
    2024    // mask for non-existent data  (default to DETECTOR if not defined)
     
    2731
    2832    // mask for below-range data  (default to RANGE if not defined)
    29     options->badMask = pmConfigMaskGet("BAD", config);
    30     psAssert (options->badMask, "bad mask not set");
     33    options->lowMask = pmConfigMaskGet("LOW", config);
     34    if (!options->lowMask) {
     35        // look up old name for backward compatability
     36        options->lowMask = pmConfigMaskGet("BAD", config);
     37    }
     38    psAssert (options->lowMask, "low mask not set");
    3139
    3240    // save MASK and MARK on the PSPHOT recipe
  • branches/cnb_branches/cnb_branch_20090301/ppImage/src/ppImageStatsOutput.c

    r19928 r24244  
    3131    psFree(resolved);
    3232
     33    pmConfigRunFilenameAddWrite(config, "STATS", statsName);
     34
    3335    return true;
    3436}
  • branches/cnb_branches/cnb_branch_20090301/ppImage/src/ppImageVersion.c

    r23352 r24244  
    44
    55#include "ppImage.h"
     6#include "ppImageVersionDefinitions.h"
    67
    78#ifndef PPIMAGE_VERSION
     
    1516#endif
    1617
    17 #define xstr(s) str(s)
    18 #define str(s) #s
    19 
    2018psString ppImageVersion(void)
    2119{
    2220    char *value = NULL;
    23     psStringAppend(&value, "%s@%s", xstr(PPIMAGE_BRANCH), xstr(PPIMAGE_VERSION));
     21    psStringAppend(&value, "%s@%s", PPIMAGE_BRANCH, PPIMAGE_VERSION);
    2422    return value;
    2523}
     
    2725psString ppImageSource(void)
    2826{
    29     return psStringCopy (xstr(PPIMAGE_SOURCE));
     27    return psStringCopy(PPIMAGE_SOURCE);
    3028}
    3129
Note: See TracChangeset for help on using the changeset viewer.