IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 21079


Ignore:
Timestamp:
Jan 1, 2009, 7:13:00 PM (18 years ago)
Author:
eugene
Message:

convert mask references to abstract psImageMaskType and psVectorMaskType as needed

Location:
branches/eam_branch_20081230/psModules/src
Files:
53 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branch_20081230/psModules/src/astrom/pmAstrometryObjects.c

    r20801 r21079  
    88*  @author EAM, IfA
    99*
    10 *  @version $Revision: 1.42 $ $Name: not supported by cvs2svn $
    11 *  @date $Date: 2008-11-20 01:26:07 $
     10*  @version $Revision: 1.42.6.1 $ $Name: not supported by cvs2svn $
     11*  @date $Date: 2009-01-02 05:13:00 $
    1212*
    1313*  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    227227
    228228    // constant errors
    229     psVector *mask = psVectorAlloc (match->n, PS_TYPE_U8);
     229    psVector *mask = psVectorAlloc (match->n, PS_TYPE_VECTOR_MASK);
    230230    psVectorInit (mask, 0);
    231231
  • branches/eam_branch_20081230/psModules/src/camera/pmCellSquish.c

    r12696 r21079  
    1212
    1313
    14 bool pmCellSquish(pmCell *cell, psMaskType maskVal, bool useShifts)
     14bool pmCellSquish(pmCell *cell, psImageMaskType maskVal, bool useShifts)
    1515{
    1616    PS_ASSERT_PTR_NON_NULL(cell, false);
     
    116116    psImage *squishImage = psImageAlloc(numCols, numRows, PS_TYPE_F32); // Squished image
    117117    psImageInit(squishImage, 0.0);
    118     psImage *squishMask = psImageAlloc(numCols, numRows, PS_TYPE_MASK); // Squished mask
     118    psImage *squishMask = psImageAlloc(numCols, numRows, PS_TYPE_IMAGE_MASK); // Squished mask
    119119    psImageInit(squishMask, 0);
    120120
     
    159159                squishImage->data.F32[ySquish][xSquish] += image->data.F32[y][x];
    160160                if (mask) {
    161                     squishMask->data.PS_TYPE_MASK_DATA[ySquish][xSquish] |= mask->data.U8[y][x] & maskVal;
     161                    squishMask->data.PS_TYPE_IMAGE_MASK_DATA[ySquish][xSquish] |= mask->data.PS_TYPE_IMAGE_MASK_DATA[y][x] & maskVal;
    162162                }
    163163            }
  • branches/eam_branch_20081230/psModules/src/camera/pmCellSquish.h

    r12696 r21079  
    77/// already have been read) and masks.
    88bool pmCellSquish(pmCell *cell,         ///< Cell to have readouts combined
    9                   psMaskType maskVal,   ///< Value to be masked
     9                  psImageMaskType maskVal,   ///< Value to be masked
    1010                  bool useShifts        ///< Use the shifts when squishing?
    1111    );
  • branches/eam_branch_20081230/psModules/src/camera/pmFPABin.c

    r20442 r21079  
    99#include "pmFPABin.h"
    1010
    11 bool pmReadoutRebin(pmReadout *out, const pmReadout *in, psMaskType maskVal, int xBin, int yBin)
     11bool pmReadoutRebin(pmReadout *out, const pmReadout *in, psImageMaskType maskVal, int xBin, int yBin)
    1212{
    1313    PM_ASSERT_READOUT_NON_NULL(out, false);
     
    5050            for (int y = yStart; y < yStop; y++) {
    5151                for (int x = xStart; x < xStop; x++) {
    52                     if (inMask && (inMask->data.PS_TYPE_MASK_DATA[y][x] & maskVal)) {
     52                    if (inMask && (inMask->data.PS_TYPE_IMAGE_MASK_DATA[y][x] & maskVal)) {
    5353                        continue;
    5454                    }
  • branches/eam_branch_20081230/psModules/src/camera/pmFPABin.h

    r21072 r21079  
    99bool pmReadoutRebin(pmReadout *out,     ///< Output readout
    1010                    const pmReadout *in,///< Input readout
    11                     psMaskType maskVal, ///< Value to mask
     11                    psImageMaskType maskVal, ///< Value to mask
    1212                    int xBin, int yBin  ///< Binning factors in x and y
    1313    );
  • branches/eam_branch_20081230/psModules/src/camera/pmFPAMaskWeight.c

    r21072 r21079  
    4242            continue;
    4343        }
    44         masks->data[i] = psImageAlloc(image->numCols, image->numRows, PS_TYPE_U8);
     44        masks->data[i] = psImageAlloc(image->numCols, image->numRows, PS_TYPE_IMAGE_MASK);
    4545        psImageInit(masks->data[i], 0);
    4646    }
     
    9898//////////////////////////////////////////////////////////////////////////////////////////////////////////////
    9999
    100 bool pmReadoutSetMask(pmReadout *readout, psMaskType satMask, psMaskType badMask)
     100bool pmReadoutSetMask(pmReadout *readout, psImageMaskType satMask, psImageMaskType badMask)
    101101{
    102102    PS_ASSERT_PTR_NON_NULL(readout, false);
     
    124124    if (!readout->mask) {
    125125        // Generate a (throwaway) mask image, if required
    126         readout->mask = psImageAlloc(image->numCols, image->numRows, PS_TYPE_U8);
     126        readout->mask = psImageAlloc(image->numCols, image->numRows, PS_TYPE_IMAGE_MASK);
    127127    }
    128128    psImage *mask = readout->mask;      // The mask pixels
     
    131131    // Dereference pointers for speed
    132132    psF32 **imageData = image->data.F32;// The image
    133     psU8  **maskData  = mask->data.U8;  // The mask
     133    psImageMaskType **maskData = mask->data.PS_TYPE_IMAGE_MASK_DATA;  // The mask
    134134
    135135    for (int i = 0; i < image->numRows; i++) {
     
    153153// pixels.  currently, it will set mask bits if (value <= BAD) or (value >= SATURATION)
    154154// should we optionally ignore these tests?
    155 bool pmReadoutGenerateMask(pmReadout *readout, psMaskType satMask, psMaskType badMask)
     155bool pmReadoutGenerateMask(pmReadout *readout, psImageMaskType satMask, psImageMaskType badMask)
    156156{
    157157    PS_ASSERT_PTR_NON_NULL(readout, false);
     
    294294}
    295295
    296 bool pmReadoutGenerateMaskWeight(pmReadout *readout, psMaskType satMask, psMaskType badMask, bool poisson)
     296bool pmReadoutGenerateMaskWeight(pmReadout *readout, psImageMaskType satMask, psImageMaskType badMask, bool poisson)
    297297{
    298298    PS_ASSERT_PTR_NON_NULL(readout, false);
     
    306306}
    307307
    308 bool pmCellGenerateMaskWeight(pmCell *cell, psMaskType satMask, psMaskType badMask, bool poisson)
     308bool pmCellGenerateMaskWeight(pmCell *cell, psImageMaskType satMask, psImageMaskType badMask, bool poisson)
    309309{
    310310    PS_ASSERT_PTR_NON_NULL(cell, false);
     
    321321
    322322
    323 bool pmReadoutWeightRenormPixels(const pmReadout *readout, psMaskType maskVal,
     323bool pmReadoutWeightRenormPixels(const pmReadout *readout, psImageMaskType maskVal,
    324324                                 psStatsOptions meanStat, psStatsOptions stdevStat, psRandom *rng)
    325325{
     
    363363
    364364
    365 bool pmReadoutWeightRenormPhot(const pmReadout *readout, psMaskType maskVal, int num, float width,
     365bool pmReadoutWeightRenormPhot(const pmReadout *readout, psImageMaskType maskVal, int num, float width,
    366366                               psStatsOptions meanStat, psStatsOptions stdevStat, psRandom *rng)
    367367{
     
    411411    psVector *source = psVectorAlloc(num, PS_TYPE_F32); // Measurements of fake sources
    412412    psVector *guess = psVectorAlloc(num, PS_TYPE_F32); // Guess at significance
    413     psVector *photMask = psVectorAlloc(num, PS_TYPE_MASK); // Mask for fluxes
     413    psVector *photMask = psVectorAlloc(num, PS_TYPE_VECTOR_MASK); // Mask for fluxes
    414414    for (int i = 0; i < num; i++) {
    415415        // Coordinates of interest
     
    433433            float yGauss = gauss->data.F32[v]; // Value of Gaussian in y
    434434            for (int u = 0, x = xPix - size; u < fullSize; u++, x++) {
    435                 if (mask && mask->data.PS_TYPE_MASK_DATA[y][x] & maskVal) {
     435                if (mask && mask->data.PS_TYPE_IMAGE_MASK_DATA[y][x] & maskVal) {
    436436                    continue;
    437437                }
     
    453453        }
    454454
    455         photMask->data.PS_TYPE_MASK_DATA[i] = ((isfinite(sumNoise) && isfinite(sumSource) &&
     455        photMask->data.PS_TYPE_VECTOR_MASK_DATA[i] = ((isfinite(sumNoise) && isfinite(sumSource) &&
    456456                                                isfinite(sumWeight) && sumGauss > 0 && sumGauss2 > 0) ?
    457457                                               0 : 0xFF);
     
    493493        ratio->data.F32[i] = measuredSig / guess->data.F32[i];
    494494        if (guess->data.F32[i] <= 0.0 || source->data.F32[i] <= 0.0 || !isfinite(ratio->data.F32[i])) {
    495             photMask->data.PS_TYPE_MASK_DATA[i] = 0xFF;
     495            photMask->data.PS_TYPE_VECTOR_MASK_DATA[i] = 0xFF;
    496496        }
    497497        psTrace("psModules.camera", 9, "Ratio %d: %f, %f, %f\n",
     
    523523
    524524
    525 bool pmReadoutWeightRenorm(const pmReadout *readout, psMaskType maskVal, psStatsOptions meanStat,
     525bool pmReadoutWeightRenorm(const pmReadout *readout, psImageMaskType maskVal, psStatsOptions meanStat,
    526526                           psStatsOptions stdevStat, int width, psRandom *rng)
    527527{
     
    591591
    592592
    593 bool pmReadoutMaskNonfinite(pmReadout *readout, psMaskType maskVal)
     593bool pmReadoutMaskNonfinite(pmReadout *readout, psImageMaskType maskVal)
    594594{
    595595    PM_ASSERT_READOUT_NON_NULL(readout, false);
     
    601601
    602602    if (!readout->mask) {
    603         readout->mask = psImageAlloc(numCols, numRows, PS_TYPE_MASK);
     603        readout->mask = psImageAlloc(numCols, numRows, PS_TYPE_IMAGE_MASK);
    604604    }
    605605    psImage *mask = readout->mask;      // Readout's mask
     
    608608        for (int x = 0; x < numCols; x++) {
    609609            if (!isfinite(image->data.F32[y][x]) || (weight && !isfinite(weight->data.F32[y][x]))) {
    610                 mask->data.PS_TYPE_MASK_DATA[y][x] |= maskVal;
     610                mask->data.PS_TYPE_IMAGE_MASK_DATA[y][x] |= maskVal;
    611611            }
    612612        }
     
    618618
    619619
    620 bool pmReadoutMaskApply(pmReadout *readout, psMaskType maskVal)
     620bool pmReadoutMaskApply(pmReadout *readout, psImageMaskType maskVal)
    621621{
    622622    PM_ASSERT_READOUT_NON_NULL(readout, false);
     
    625625
    626626    int numCols = readout->image->numCols, numRows = readout->image->numRows; // Size of image
    627     psMaskType **maskData = readout->mask->data.PS_TYPE_MASK_DATA; // Dereference mask
     627    psImageMaskType **maskData = readout->mask->data.PS_TYPE_IMAGE_MASK_DATA; // Dereference mask
    628628    psF32 **imageData = readout->image->data.F32;// Dereference image
    629629    psF32 **weightData = readout->weight ? readout->weight->data.F32 : NULL; // Dereference weight map
     
    644644
    645645
    646 bool pmReadoutInterpolateBadPixels(pmReadout *readout, psMaskType maskVal, psImageInterpolateMode mode,
    647                                    float poorFrac, psMaskType maskPoor, psMaskType maskBad)
     646bool pmReadoutInterpolateBadPixels(pmReadout *readout, psImageMaskType maskVal, psImageInterpolateMode mode,
     647                                   float poorFrac, psImageMaskType maskPoor, psImageMaskType maskBad)
    648648{
    649649    PM_ASSERT_READOUT_NON_NULL(readout, false);
     
    667667    psVector *imagePix = psVectorAllocEmpty(PIXELS_BUFFER, PS_TYPE_F32); // Corresponding values for image
    668668    psVector *weightPix = psVectorAllocEmpty(PIXELS_BUFFER, PS_TYPE_F32); // Corresponding values for weight
    669     psVector *maskPix = psVectorAllocEmpty(PIXELS_BUFFER, PS_TYPE_MASK); // Corresponding values for mask
     669    psVector *maskPix = psVectorAllocEmpty(PIXELS_BUFFER, PS_TYPE_IMAGE_MASK); // Corresponding values for mask
     670    // NOTE: maskPix carries the actual image mask values -- do NOT use
     671    // PS_TYPE_VECTOR_MASK here; it is storage, and is not treated as a vector mask
    670672
    671673    long numBad = 0;                    // Number of bad pixels interpolated
    672674    for (int y = 0; y < numRows; y++) {
    673675        for (int x = 0; x < numCols; x++) {
    674             if (mask->data.PS_TYPE_MASK_DATA[y][x] & maskVal) {
     676            if (mask->data.PS_TYPE_IMAGE_MASK_DATA[y][x] & maskVal) {
    675677                double imageValue, weightValue; // Image and weight value from interpolation
    676                 psMaskType maskValue = 0; // Mask value from interpolation
    677                 psImageInterpolateStatus status = psImageInterpolate(&imageValue, &weightValue, &maskValue,
    678                                                                      x, y, interp);
     678                psImageMaskType maskValue = 0; // Mask value from interpolation
     679                psImageInterpolateStatus status = psImageInterpolate(&imageValue, &weightValue, &maskValue, x, y, interp);
    679680                if (status == PS_INTERPOLATE_STATUS_ERROR || status == PS_INTERPOLATE_STATUS_OFF) {
    680681                    psError(PS_ERR_UNKNOWN, false, "Unable to interpolate readout at %d,%d", x, y);
     
    697698                imagePix->data.F32[numBad] = imageValue;
    698699                weightPix->data.F32[numBad] = weightValue;
    699                 maskPix->data.PS_TYPE_MASK_DATA[numBad] = maskValue;
     700                maskPix->data.PS_TYPE_IMAGE_MASK_DATA[numBad] = maskValue;
    700701                numBad++;
    701702            }
     
    709710        image->data.F32[y][x] = imagePix->data.F32[i];
    710711        weight->data.F32[y][x] = weightPix->data.F32[i];
    711         mask->data.PS_TYPE_MASK_DATA[y][x] = maskPix->data.PS_TYPE_MASK_DATA[i];
     712        mask->data.PS_TYPE_IMAGE_MASK_DATA[y][x] = maskPix->data.PS_TYPE_IMAGE_MASK_DATA[i];
    712713    }
    713714
  • branches/eam_branch_20081230/psModules/src/camera/pmFPAMaskWeight.h

    r20486 r21079  
    55 * @author Eugene Magnier, IfA
    66 *
    7  * @version $Revision: 1.16 $ $Name: not supported by cvs2svn $
    8  * @date $Date: 2008-10-31 21:50:16 $
     7 * @version $Revision: 1.16.10.1 $ $Name: not supported by cvs2svn $
     8 * @date $Date: 2009-01-02 05:13:00 $
    99 * Copyright 2005-2006 Institute for Astronomy, University of Hawaii
    1010 */
     
    4242/// iterating using pmReadoutReadNext, in which case the HDU can't be generated.
    4343bool pmReadoutSetMask(pmReadout *readout, ///< Readout for which to set mask
    44                       psMaskType satMask, ///< Mask value to give saturated pixels
    45                       psMaskType badMask  ///< Mask value to give bad (low) pixels
     44                      psImageMaskType satMask, ///< Mask value to give saturated pixels
     45                      psImageMaskType badMask  ///< Mask value to give bad (low) pixels
    4646    );
    4747
     
    6262/// is suitable for output (complete with HDU entry).  This is intended for most operations.
    6363bool pmReadoutGenerateMask(pmReadout *readout, ///< Readout for which to generate mask
    64                            psMaskType sat, ///< Mask value to give saturated pixels
    65                            psMaskType bad ///< Mask value to give bad (low) pixels
     64                           psImageMaskType sat, ///< Mask value to give saturated pixels
     65                           psImageMaskType bad ///< Mask value to give bad (low) pixels
    6666    );
    6767
     
    7979/// Calls pmReadoutGenerateMask and pmReadoutGenerateWeight for the readout
    8080bool pmReadoutGenerateMaskWeight(pmReadout *readout, ///< Readout for which to generate mask and weights
    81                                  psMaskType sat, ///< Mask value to give saturated pixels
    82                                  psMaskType bad, ///< Mask value to give bad (low) pixels
     81                                 psImageMaskType sat, ///< Mask value to give saturated pixels
     82                                 psImageMaskType bad, ///< Mask value to give bad (low) pixels
    8383                                 bool poisson ///< Use poisson weights (in addition to read noise)?
    8484                                );
     
    8888/// Calls pmReadoutGenerateMaskWeight for each readout within the cell.
    8989bool pmCellGenerateMaskWeight(pmCell *cell, ///< Cell for which to generate mask and weights
    90                               psMaskType sat, ///< Mask value to give saturated pixels
    91                               psMaskType bad, ///< Mask value to give bad (low) pixels
     90                              psImageMaskType sat, ///< Mask value to give saturated pixels
     91                              psImageMaskType bad, ///< Mask value to give bad (low) pixels
    9292                              bool poisson ///< Use poisson weights (in addition to read noise)?
    9393                             );
     
    9898bool pmReadoutWeightRenormPixels(
    9999    const pmReadout *readout,           ///< Readout to normalise
    100     psMaskType maskVal,                 ///< Value to mask
     100    psImageMaskType maskVal,                 ///< Value to mask
    101101    psStatsOptions meanStat,            ///< Statistic to measure the mean (of the variance map)
    102102    psStatsOptions stdevStat,           ///< Statistic to measure the stdev (of the image)
     
    110110bool pmReadoutWeightRenormPhot(
    111111    const pmReadout *readout,           ///< Readout to normalise
    112     psMaskType maskVal,                 ///< Value to mask
     112    psImageMaskType maskVal,                 ///< Value to mask
    113113    int num,                            ///< Number of instances to measure over the image
    114114    float width,                        ///< Photometry width
     
    123123/// that patch corresponds.
    124124bool pmReadoutWeightRenorm(const pmReadout *readout, // Readout to normalise
    125                            psMaskType maskVal, // Value to mask
     125                           psImageMaskType maskVal, // Value to mask
    126126                           psStatsOptions meanStat, // Statistic to measure the mean (of the variance map)
    127127                           psStatsOptions stdevStat, // Statistic to measure the stdev (of the image)
     
    136136/// the provided value.
    137137bool pmReadoutMaskNonfinite(pmReadout *readout, ///< Readout to mask
    138                             psMaskType maskVal ///< Mask value to give non-finite pixels
     138                            psImageMaskType maskVal ///< Mask value to give non-finite pixels
    139139    );
    140140
     
    145145/// sets masked areas to NAN in the image and weight.
    146146bool pmReadoutMaskApply(pmReadout *readout, ///< Readout to mask
    147                         psMaskType maskVal ///< Mask value for which to apply mask
     147                        psImageMaskType maskVal ///< Mask value for which to apply mask
    148148    );
    149149
     
    152152/// Scan the mask image for bad pixels, and interpolate over them using the nominated options
    153153bool pmReadoutInterpolateBadPixels(pmReadout *readout, ///< Readout to work on
    154                                    psMaskType maskVal, ///< Value to mask
     154                                   psImageMaskType maskVal, ///< Value to mask
    155155                                   psImageInterpolateMode mode, ///< Interpolation mode
    156156                                   float poorFrac, ///< Maximum bad fraction of kernel for "poor" status
    157                                    psMaskType maskPoor, ///< Mask value to give poor pixels
    158                                    psMaskType maskBad ///< Mask value to give bad pixels
     157                                   psImageMaskType maskPoor, ///< Mask value to give poor pixels
     158                                   psImageMaskType maskBad ///< Mask value to give bad pixels
    159159    );
    160160
  • branches/eam_branch_20081230/psModules/src/camera/pmFPAMosaic.c

    r21072 r21079  
    471471        numImages++;
    472472
    473         // Only implemented for F32 and U8 images so far.
    474         assert(image->type.type == PS_TYPE_F32 || image->type.type == PS_TYPE_U8);
    475473        // All input types must be the same
    476474        if (type == 0) {
     
    537535        if (xBinSource->data.S32[i] == xBinTarget && yBinSource->data.S32[i] == yBinTarget) {
    538536            switch (type) {
     537                COPY_WITH_PARITY_DIFFERENCE(U8);
     538                COPY_WITH_PARITY_DIFFERENCE(U16);
     539                COPY_WITH_PARITY_DIFFERENCE(U32);
     540                COPY_WITH_PARITY_DIFFERENCE(U64);
     541                COPY_WITH_PARITY_DIFFERENCE(S8);
     542                COPY_WITH_PARITY_DIFFERENCE(S16);
     543                COPY_WITH_PARITY_DIFFERENCE(S32);
     544                COPY_WITH_PARITY_DIFFERENCE(S64);
    539545                COPY_WITH_PARITY_DIFFERENCE(F32);
    540                 COPY_WITH_PARITY_DIFFERENCE(U8);
     546                COPY_WITH_PARITY_DIFFERENCE(F64);
    541547              default:
    542548                psAbort("Should never get here.\n");
     
    548554        // We have to do all of the hard work ourselves
    549555        switch (type) {
    550             FILL_IN(F32);
    551             FILL_IN(U8);
     556            FILL_IN(U8);
     557            FILL_IN(U16);
     558            FILL_IN(U32);
     559            FILL_IN(U64);
     560            FILL_IN(S8);
     561            FILL_IN(S16);
     562            FILL_IN(S32);
     563            FILL_IN(S64);
     564            FILL_IN(F32);
     565            FILL_IN(F64);
    552566          default:
    553567            psAbort("Should never get here.\n");
     
    730744                       const pmChip *chip, // Chip to mosaic
    731745                       const pmCell *targetCell, // Cell to which to mosaic
    732                        psMaskType blank // Mask value to give blank pixels
     746                       psImageMaskType blank // Mask value to give blank pixels
    733747                      )
    734748{
     
    838852                      const pmChip *targetChip, // Chip to which to mosaic
    839853                      const pmCell *targetCell, // Cell to which to mosaic
    840                       psMaskType blank  // Mask value to give blank pixels
     854                      psImageMaskType blank  // Mask value to give blank pixels
    841855                     )
    842856{
     
    9941008// the mosaic image.
    9951009
    996 bool pmChipMosaic(pmChip *target, const pmChip *source, bool deepCopy, psMaskType blank)
     1010bool pmChipMosaic(pmChip *target, const pmChip *source, bool deepCopy, psImageMaskType blank)
    9971011{
    9981012    // Target exists, and has only a single cell
     
    12251239
    12261240
    1227 bool pmFPAMosaic(pmFPA *target, const pmFPA *source, bool deepCopy, psMaskType blank)
     1241bool pmFPAMosaic(pmFPA *target, const pmFPA *source, bool deepCopy, psImageMaskType blank)
    12281242{
    12291243    // Target exists, and has only a single chip with single cell
  • branches/eam_branch_20081230/psModules/src/camera/pmFPAMosaic.h

    r13898 r21079  
    44 * @author Paul Price, IfA
    55 *
    6  * @version $Revision: 1.8 $ $Name: not supported by cvs2svn $
    7  * @date $Date: 2007-06-20 02:22:26 $
     6 * @version $Revision: 1.8.74.1 $ $Name: not supported by cvs2svn $
     7 * @date $Date: 2009-01-02 05:13:00 $
    88 * Copyright 2005-2006 Institute for Astronomy, University of Hawaii
    99 */
     
    2424                  const pmChip *source, ///< Source chip whose cells will be mosaicked
    2525                  bool deepCopy,        ///< Require a deep copy (disregard 'nice' chip)
    26                   psMaskType blank      ///< Mask value to give blank pixels
     26                  psImageMaskType blank      ///< Mask value to give blank pixels
    2727    );
    2828
     
    3636                 const pmFPA *source,   ///< FPA whose chips and cells will be mosaicked
    3737                 bool deepCopy,         ///< Require a deep copy (disregard 'nice' chip)
    38                  psMaskType blank       ///< Mask value to give blank pixels
     38                 psImageMaskType blank       ///< Mask value to give blank pixels
    3939                );
    4040/// @}
  • branches/eam_branch_20081230/psModules/src/camera/pmFPA_JPEG.c

    r21072 r21079  
    55 *  @author EAM, IfA
    66 *
    7  *  @version $Revision: 1.26 $ $Name: not supported by cvs2svn $
    8  *  @date $Date: 2008-09-23 02:00:36 $
     7 *  @version $Revision: 1.26.18.1 $ $Name: not supported by cvs2svn $
     8 *  @date $Date: 2009-01-02 05:13:00 $
    99 *
    1010 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    157157    psStats *stats = psStatsAlloc(PS_STAT_ROBUST_MEDIAN);
    158158    stats->nSubsample = 10000;
    159     psMaskType maskVal = pmConfigMaskGet("MASK.VALUE", config); // Value to mask
     159    psImageMaskType maskVal = pmConfigMaskGet("MASK.VALUE", config); // Value to mask
    160160    float mean = 0, delta = 0;          //
    161161    if (!psImageBackground(stats, NULL, readout->image, readout->mask, maskVal, rng)) {
  • branches/eam_branch_20081230/psModules/src/camera/pmHDU.c

    r21072 r21079  
    167167                     const psArray *images, // Images to write
    168168                     const psArray *masks, // Masks to use when writing
    169                      psMaskType maskVal,// Value to mask
     169                     psImageMaskType maskVal,// Value to mask
    170170                     psFits *fits       // FITS file to which to write
    171171                    )
     
    222222    PS_ASSERT_PTR_NON_NULL(fits, false);
    223223
    224     psMaskType maskVal = pmConfigMaskGet("MASK.VALUE", config); // Value to mask
     224    psImageMaskType maskVal = pmConfigMaskGet("MASK.VALUE", config); // Value to mask
    225225    return hduWrite(hdu, hdu->images, hdu->masks, maskVal, fits);
    226226}
     
    240240    PS_ASSERT_PTR_NON_NULL(fits, false);
    241241
    242     psMaskType maskVal = pmConfigMaskGet("MASK.VALUE", config); // Value to mask
     242    psImageMaskType maskVal = pmConfigMaskGet("MASK.VALUE", config); // Value to mask
    243243    return hduWrite(hdu, hdu->weights, hdu->masks, maskVal, fits);
    244244}
  • branches/eam_branch_20081230/psModules/src/camera/pmReadoutStack.c

    r18830 r21079  
    7878
    7979// XXX for the moment, use col0, row0, numCols, numRows supplied from the outside
    80 bool pmReadoutStackDefineOutput(pmReadout *readout, int col0, int row0, int numCols, int numRows, bool mask, bool weight, psMaskType blank)
     80bool pmReadoutStackDefineOutput(pmReadout *readout, int col0, int row0, int numCols, int numRows, bool mask, bool weight, psImageMaskType blank)
    8181{
    8282    PS_ASSERT_PTR_NON_NULL(readout, false);
     
    9494        // XXX is this an error?
    9595        if (readout->mask) return false;
    96         readout->mask = psImageAlloc(numCols, numRows, PS_TYPE_MASK);
     96        readout->mask = psImageAlloc(numCols, numRows, PS_TYPE_IMAGE_MASK);
    9797        psImageInit(readout->mask, blank);
    9898    }
     
    163163bool pmReadoutUpdateSize(pmReadout *readout, int minCols, int minRows,
    164164                         int numCols, int numRows, bool mask, bool weight,
    165                          psMaskType blank)
     165                         psImageMaskType blank)
    166166{
    167167    PS_ASSERT_PTR_NON_NULL(readout, false);
     
    191191    if (mask) {
    192192        if (!readout->mask) {
    193             readout->mask = psImageAlloc(numCols, numRows, PS_TYPE_MASK);
     193            readout->mask = psImageAlloc(numCols, numRows, PS_TYPE_IMAGE_MASK);
    194194            psImageInit(readout->mask, blank);
    195195        }
    196196        if (readout->mask->numCols < numCols || readout->mask->numRows < numRows) {
    197             psImage *newMask = psImageAlloc(numCols, numRows, PS_TYPE_MASK);
     197            psImage *newMask = psImageAlloc(numCols, numRows, PS_TYPE_IMAGE_MASK);
    198198            psImageInit(newMask, blank);
    199199            psImageOverlaySection(newMask, readout->mask, readout->col0, readout->row0, "=");
  • branches/eam_branch_20081230/psModules/src/camera/pmReadoutStack.h

    r18830 r21079  
    1414                         bool mask,     ///< Worry about the mask?
    1515                         bool weight,   ///< Worry about the weight?
    16                          psMaskType blank ///< Mask value to give to blank pixels
     16                         psImageMaskType blank ///< Mask value to give to blank pixels
    1717    );
    1818
     
    4747
    4848// XXX for the moment, use col0, row0, numCols, numRows supplied from the outside
    49 bool pmReadoutStackDefineOutput(pmReadout *readout, int col0, int row0, int numCols, int numRows, bool mask, bool weight, psMaskType blank);
     49bool pmReadoutStackDefineOutput(pmReadout *readout, int col0, int row0, int numCols, int numRows, bool mask, bool weight, psImageMaskType blank);
    5050
    5151bool pmReadoutStackSetOutputSize(int *col0, int *row0, int *numCols, int *numRows, const psArray *inputs);
  • branches/eam_branch_20081230/psModules/src/concepts/pmConceptsStandard.c

    r21072 r21079  
    1616#include "pmConceptsWrite.h"
    1717#include "pmConceptsStandard.h"
     18
     19// XXX why are these functions not supporting all types (S64, U64 often missing)?
    1820
    1921// The functions in this file are intended to be called solely within the psModules concepts code.  For this
     
    591593        TYPE_CASE(binning, concept, U16);
    592594        TYPE_CASE(binning, concept, U32);
     595        // TYPE_CASE(binning, concept, U64);
    593596        TYPE_CASE(binning, concept, S8);
    594597        TYPE_CASE(binning, concept, S16);
    595598        TYPE_CASE(binning, concept, S32);
     599        // TYPE_CASE(binning, concept, S64);
    596600      default:
    597601        psError(PS_ERR_UNKNOWN, true, "Note sure how to parse %s of type %x --- assuming 1.\n", pattern->name,
  • branches/eam_branch_20081230/psModules/src/config/pmConfigMask.c

    r19870 r21079  
    4545};
    4646// Default values in case a bad mask name and its fallback is not defined
    47 static const psMaskType defaultMask[] = { 0x00, // DETECTOR
    48                                           0x00, // DARK
    49                                           0x01, // FLAT
    50                                           0x01, // BLANK
    51                                           0x00, // RANGE
    52                                           0x01, // SAT
    53                                           0x01, // LOW
    54                                           0x01, // CONV
    55                                           0x00, // CR
    56                                           0x00  // GHOST
     47static const psImageMaskType defaultMask[] = { 0x00, // DETECTOR
     48                                               0x00, // DARK
     49                                               0x01, // FLAT
     50                                               0x01, // BLANK
     51                                               0x00, // RANGE
     52                                               0x01, // SAT
     53                                               0x01, // LOW
     54                                               0x01, // CONV
     55                                               0x00, // CR
     56                                               0x00  // GHOST
    5757};
    5858// Other mask names to ensure exist; these shouldn't be combined in the MASK.VALUE
     
    6262};
    6363
    64 static bool maskSetValues(psMaskType *outMaskValue, // Value of MASK.VALUE, returned
    65                           psMaskType *outMarkValue, // Value of MARK.VALUE, returned
     64static bool maskSetValues(psImageMaskType *outMaskValue, // Value of MASK.VALUE, returned
     65                          psImageMaskType *outMarkValue, // Value of MARK.VALUE, returned
    6666                          psMetadata *source  // Source of mask bits
    6767                          )
     
    7070
    7171    // Ensure all the bad mask names exist, and set the value to catch all bad pixels
    72     psMaskType maskValue = 0;           // Value to mask to catch all the bad pixels
     72    psImageMaskType maskValue = 0;           // Value to mask to catch all the bad pixels
    7373    for (int i = 0; badMaskNames[i]; i++) {
    7474        const char *name = badMaskNames[i]; // Name for mask
     
    7676
    7777        bool mdok;                      // Status of MD lookup
    78         psMaskType value = psMetadataLookupU8(&mdok, source, name); // Value of mask
     78        psImageMaskType value = psMetadataLookupImageMask(&mdok, source, name); // Value of mask
    7979        if (!value) {
    8080            if (fallback) {
    81                 value = psMetadataLookupU8(&mdok, source, fallback);
     81                value = psMetadataLookupImageMask(&mdok, source, fallback);
    8282            }
    8383            if (!value) {
    8484                value = defaultMask[i];
    8585            }
    86             psMetadataAddU8(source, PS_LIST_TAIL, name, PS_META_REPLACE, NULL, value);
     86            psMetadataAddImageMask(source, PS_LIST_TAIL, name, PS_META_REPLACE, NULL, value);
    8787        }
    8888        maskValue |= value;
     
    9393        const char *name = otherMaskNames[i]; // Name for mask
    9494        bool mdok;                      // Status of MD lookup
    95         psMaskType value = psMetadataLookupU8(&mdok, source, name); // Value of mask
     95        psImageMaskType value = psMetadataLookupImageMask(&mdok, source, name); // Value of mask
    9696        if (!value) {
    97             psMetadataAddU8(source, PS_LIST_TAIL, name, PS_META_REPLACE, NULL, 0x00);
     97            psMetadataAddImageMask(source, PS_LIST_TAIL, name, PS_META_REPLACE, NULL, 0x00);
    9898        }
    9999    }
    100100
    101101    // search for an unset bit to use for MARK:
    102     psMaskType markValue = 0x80;
    103 
    104     int nBits = sizeof(psMaskType) * 8;
     102    psImageMaskType markValue = 0x00;
     103    psImageMaskType markTrial = 0x01;
     104
     105    int nBits = sizeof(psImageMaskType) * 8;
    105106    for (int i = 0; !markValue && (i < nBits); i++) {
    106         if (maskValue & markValue) {
    107             markValue >>= 1;
     107        if (maskValue & markTrial) {
     108            markTrial <<= 1;
    108109        } else {
    109             markValue = markValue;
     110            markValue = markTrial;
    110111        }
    111112    }
     
    116117
    117118    // update the list with the results
    118     psMetadataAddU8(source, PS_LIST_TAIL, "MASK.VALUE", PS_META_REPLACE, NULL, maskValue);
    119     psMetadataAddU8(source, PS_LIST_TAIL, "MARK.VALUE", PS_META_REPLACE, NULL, markValue);
     119    psMetadataAddImageMask(source, PS_LIST_TAIL, "MASK.VALUE", PS_META_REPLACE, NULL, maskValue);
     120    psMetadataAddImageMask(source, PS_LIST_TAIL, "MARK.VALUE", PS_META_REPLACE, NULL, markValue);
    120121
    121122    if (outMaskValue) {
     
    130131
    131132// Get a mask value by name(s)
    132 static psMaskType maskGet(psMetadata *source, // Source of masks
    133                           const char *masks // Mask values to get
    134                           )
    135 {
    136     psMaskType mask = 0;                // Mask value, to return
     133static psImageMaskType maskGet(psMetadata *source, // Source of masks
     134                               const char *masks // Mask values to get
     135                               )
     136{
     137    psImageMaskType mask = 0;                // Mask value, to return
    137138
    138139    psArray *names = psStringSplitArray(masks, " ,;", false); // Array of symbolic names
     
    140141        const char *name = names->data[i]; // Symbolic name of interest
    141142        bool mdok;                      // Status of MD lookup
    142         psMaskType value = psMetadataLookupU8(&mdok, source, name);
     143        psImageMaskType value = psMetadataLookupImageMask(&mdok, source, name);
    143144        if (!mdok) {
    144145            // Try and generate the value if we can
     
    148149                    return 0;
    149150                }
    150                 value = psMetadataLookupU8(&mdok, source, name);
     151                value = psMetadataLookupImageMask(&mdok, source, name);
    151152                psAssert(mdok, "Should have generated mask value");
    152153            } else {
     
    187188
    188189#if 0
    189 bool pmFPAMaskSetValues(psMaskType *outMaskValue, psMaskType *outMarkValue, pmFPA *fpa)
     190bool pmFPAMaskSetValues(psImageMaskType *outMaskValue, psImageMaskType *outMarkValue, pmFPA *fpa)
    190191{
    191192    PS_ASSERT_PTR_NON_NULL(fpa, false);
     
    194195}
    195196
    196 psMaskType pmFPAMaskGet(const pmFPA *fpa, const char *masks, const pmConfig *config)
     197psImageMaskType pmFPAMaskGet(const pmFPA *fpa, const char *masks, const pmConfig *config)
    197198{
    198199    PS_ASSERT_PTR_NON_NULL(fpa, 0);
     
    206207}
    207208
    208 bool pmFPAMaskSet(pmFPA *fpa, const char *maskName, psMaskType maskValue)
     209bool pmFPAMaskSet(pmFPA *fpa, const char *maskName, psImageMaskType maskValue)
    209210{
    210211    PS_ASSERT_PTR_NON_NULL(fpa, 0);
     
    214215        fpa->masks = psMetadataAlloc();
    215216    }
    216     return psMetadataAddU8(fpa->masks, PS_LIST_TAIL, maskName, PS_META_REPLACE, NULL, maskValue);
     217    return psMetadataAddImageMask(fpa->masks, PS_LIST_TAIL, maskName, PS_META_REPLACE, NULL, maskValue);
    217218}
    218219
     
    250251            continue;
    251252        }
    252         psU8 bit = psMetadataLookupU8(&mdok, header, valuekey);
     253        psImageMaskType bit = psMetadataLookupImageMask(&mdok, header, valuekey);
    253254        if (!mdok) {
    254255            psWarning("Unable to find header keyword %s when parsing mask", namekey);
     
    267268            }
    268269        } else {
    269             psMetadataAddU8(fpa->masks, PS_LIST_TAIL, name, 0, NULL, bit);
     270            psMetadataAddImageMask(fpa->masks, PS_LIST_TAIL, name, 0, NULL, bit);
    270271        }
    271272    }
     
    286287        }
    287288        if (!psMetadataLookup(fpa->masks, item->name)) {
    288             psMetadataAddU8(fpa->masks, PS_LIST_TAIL, item->name, 0, item->comment,
     289            psMetadataAddImageMask(fpa->masks, PS_LIST_TAIL, item->name, 0, item->comment,
    289290                            item->data.PS_TYPE_MASK_DATA);
    290291        }
     
    322323
    323324        psMetadataAddStr(header, PS_LIST_TAIL, namekey, 0, "Bitmask bit name", item->name);
    324         psMetadataAddU8(header, PS_LIST_TAIL, valuekey, 0, "Bitmask bit value", item->data.PS_TYPE_MASK_DATA);
     325        psMetadataAddImageMask(header, PS_LIST_TAIL, valuekey, 0, "Bitmask bit value", item->data.PS_TYPE_MASK_DATA);
    325326        numMask++;
    326327    }
     
    333334
    334335
    335 psMaskType pmConfigMaskGet(const char *masks, const pmConfig *config)
     336psImageMaskType pmConfigMaskGet(const char *masks, const pmConfig *config)
    336337{
    337338    psAssert(config, "Require configuration");
     
    348349
    349350
    350 bool pmConfigMaskSet(const pmConfig *config, const char *maskName, psMaskType maskValue)
     351bool pmConfigMaskSet(const pmConfig *config, const char *maskName, psImageMaskType maskValue)
    351352{
    352353    psAssert(config, "Require configuration");
     
    359360    }
    360361
    361     return psMetadataAddU8(recipe, PS_LIST_TAIL, maskName, PS_META_REPLACE, NULL, maskValue);
     362    return psMetadataAddImageMask(recipe, PS_LIST_TAIL, maskName, PS_META_REPLACE, NULL, maskValue);
    362363}
    363364
     
    381382    // versions so that it won't complain later
    382383    if (!psMetadataLookup(recipe, "MASK.VALUE")) {
    383         psMetadataAddU8(recipe, PS_LIST_TAIL, "MASK.VALUE", 0, "Bits to mask", 0);
     384        psMetadataAddImageMask(recipe, PS_LIST_TAIL, "MASK.VALUE", 0, "Bits to mask", 0);
    384385    }
    385386    if (!psMetadataLookup(recipe, "MARK.VALUE")) {
    386         psMetadataAddU8(recipe, PS_LIST_TAIL, "MARK.VALUE", 0, "Bits for marking", 0);
     387        psMetadataAddImageMask(recipe, PS_LIST_TAIL, "MARK.VALUE", 0, "Bits for marking", 0);
    387388    }
    388389
     
    408409            continue;
    409410        }
    410         psU8 bit = psMetadataLookupU8(&status, header, valuekey);
     411        psImageMaskType bit = psMetadataLookupImageMask(&status, header, valuekey);
    411412        if (!status) {
    412413            psWarning("Unable to find header keyword %s when parsing mask", namekey);
     
    427428
    428429        if (already) {
    429             if (item && item->data.U8 != bit) {
     430            if (item && item->data.PS_TYPE_IMAGE_MASK_DATA != bit) {
    430431                psWarning("New mask recipe entry doesn't match previously loaded entry: %x vs %x",
    431                           bit, item->data.U8);
     432                          bit, item->data.PS_TYPE_IMAGE_MASK_DATA);
    432433            }
    433434        } else {
     
    437438        if (!item) {
    438439            psWarning("Mask recipe entry %s not in recipe\n", name);
    439             psMetadataAddU8(recipe, PS_LIST_TAIL, name, 0, "Bitmask bit value", bit);
     440            psMetadataAddImageMask(recipe, PS_LIST_TAIL, name, 0, "Bitmask bit value", bit);
    440441        } else {
    441             item->data.U8 = bit;
     442            item->data.PS_TYPE_IMAGE_MASK_DATA = bit;
    442443        }
    443444
     
    481482        }
    482483
    483         if (item->type != PS_DATA_U8) {
     484        if (item->type != PS_TYPE_IMAGE_MASK) {
    484485            psWarning("mask recipe entry %s is not a bit value\n", item->name);
    485486            continue;
     
    490491
    491492        psMetadataAddStr(header, PS_LIST_TAIL, namekey, 0, "Bitmask bit name", item->name);
    492         psMetadataAddU8(header, PS_LIST_TAIL, valuekey, 0, "Bitmask bit value", item->data.U8);
     493        psMetadataAddImageMask(header, PS_LIST_TAIL, valuekey, 0, "Bitmask bit value", item->data.PS_TYPE_IMAGE_MASK_DATA);
    493494        nMask++;
    494495    }
     
    500501
    501502
    502 bool pmConfigMaskSetBits(psMaskType *outMaskValue, psMaskType *outMarkValue, const pmConfig *config)
     503bool pmConfigMaskSetBits(psImageMaskType *outMaskValue, psImageMaskType *outMarkValue, const pmConfig *config)
    503504{
    504505    PS_ASSERT_PTR_NON_NULL(config, false);
  • branches/eam_branch_20081230/psModules/src/config/pmConfigMask.h

    r21072 r21079  
    44 *  @author Paul Price, IfA
    55 *
    6  *  @version $Revision: 1.4 $ $Name: not supported by cvs2svn $
    7  *  @date $Date: 2008-07-17 20:37:20 $
     6 *  @version $Revision: 1.4.30.1 $ $Name: not supported by cvs2svn $
     7 *  @date $Date: 2009-01-02 05:13:00 $
    88 *  Copyright 2007 Institute for Astronomy, University of Hawaii
    99 */
     
    2323///
    2424/// The mask values are derived from the MASKS recipe
    25 psMaskType pmConfigMaskGet(const char *masks, ///< List of symbolic names, space/comma delimited
     25psImageMaskType pmConfigMaskGet(const char *masks, ///< List of symbolic names, space/comma delimited
    2626                           const pmConfig *config ///< Configuration
    2727    );
    2828
    29 bool pmConfigMaskSet(const pmConfig *config, const char *maskName, psMaskType maskValue);
     29bool pmConfigMaskSet(const pmConfig *config, const char *maskName, psImageMaskType maskValue);
    3030
    3131// replace the named masks in the recipe with values in the header:
     
    3636bool pmConfigMaskWriteHeader(const pmConfig *config, psMetadata *header);
    3737
    38 bool pmConfigMaskSetBits(psMaskType *outMaskValue, psMaskType *outMarkValue, const pmConfig *config);
     38bool pmConfigMaskSetBits(psImageMaskType *outMaskValue, psImageMaskType *outMarkValue, const pmConfig *config);
    3939
    4040#endif
  • branches/eam_branch_20081230/psModules/src/detrend/pmBias.c

    r21072 r21079  
    4545                inImage->data.F32[i][j] -= subImage->data.F32[i+yOffset][j+xOffset];
    4646                if (inMask && subMask) {
    47                     inMask->data.U8[i][j] |= subMask->data.U8[i+yOffset][j+xOffset];
     47                    inMask->data.PS_TYPE_IMAGE_MASK_DATA[i][j] |= subMask->data.PS_TYPE_IMAGE_MASK_DATA[i+yOffset][j+xOffset];
    4848                }
    4949            }
     
    5454                inImage->data.F32[i][j] -= subImage->data.F32[i+yOffset][j+xOffset] * scale;
    5555                if (inMask && subMask) {
    56                     inMask->data.U8[i][j] |= subMask->data.U8[i+yOffset][j+xOffset];
     56                    inMask->data.PS_TYPE_IMAGE_MASK_DATA[i][j] |= subMask->data.PS_TYPE_IMAGE_MASK_DATA[i+yOffset][j+xOffset];
    5757                }
    5858            }
  • branches/eam_branch_20081230/psModules/src/detrend/pmDark.c

    r21072 r21079  
    103103{
    104104    psArray *values = psArrayAlloc(inputs->n);
    105     psVector *roMask = psVectorAlloc(inputs->n, PS_TYPE_U8); // Mask for bad readouts
     105    psVector *roMask = psVectorAlloc(inputs->n, PS_TYPE_VECTOR_MASK); // Mask for bad readouts
    106106    psVector *norm = normConcept ? psVectorAlloc(inputs->n, PS_TYPE_F32) : NULL; // Normalizations for each
    107107    psVector *orders = psVectorAlloc(ordinates->n, PS_TYPE_U8); // Orders for each concept
     
    121121        if (!ordinateLookup(&normValue, &inRange, normConcept, false, NAN, NAN, readout)) {
    122122            psWarning("Unable to find value of %s for readout %d", normConcept, i);
    123             roMask->data.U8[i] = 0xff;
     123            roMask->data.PS_TYPE_VECTOR_MASK_DATA[i] = 0xff;
    124124            norm->data.F32[i] = NAN;
    125125            numBadInputs++;
     
    128128        if (normValue == 0.0) {
    129129            psWarning("Normalisation value (%s) for readout %d is zero", normConcept, i);
    130             roMask->data.U8[i] = 0xff;
     130            roMask->data.PS_TYPE_VECTOR_MASK_DATA[i] = 0xff;
    131131            norm->data.F32[i] = NAN;
    132132            numBadInputs++;
     
    151151        for (int j = 0; j < inputs->n; j++) {
    152152            psVector *val = values->data[j]; // Value vector for readout
    153             if (roMask->data.U8[j]) {
     153            if (roMask->data.PS_TYPE_VECTOR_MASK_DATA[j]) {
    154154                val->data.F32[i] = NAN;
    155155                continue;
     
    159159            float value = NAN;          // Value of ordinate
    160160            if (!ordinateLookup(&value, &inRange, ord->name, ord->scale, ord->min, ord->max, readout)) {
    161                 roMask->data.U8[j] = 0xff;
     161                roMask->data.PS_TYPE_VECTOR_MASK_DATA[j] = 0xff;
    162162                val->data.F32[i] = NAN;
    163163                numBadInputs++;
     
    165165            }
    166166            if (!inRange) {
    167                 roMask->data.U8[j] = 0xff;
     167                roMask->data.PS_TYPE_VECTOR_MASK_DATA[j] = 0xff;
    168168                val->data.F32[i] = NAN;
    169169                numBadInputs++;
     
    263263
    264264// do the combine work for this portion of the output (range is set by input data)
    265 bool pmDarkCombine(pmCell *output, const psArray *inputs, int iter, float rej, psMaskType maskVal)
     265bool pmDarkCombine(pmCell *output, const psArray *inputs, int iter, float rej, psImageMaskType maskVal)
    266266{
    267267    PS_ASSERT_PTR_NON_NULL(output, false);
     
    314314    // Iterate over pixels, fitting polynomial
    315315    psVector *pixels = psVectorAlloc(inputs->n, PS_TYPE_F32); // Stack of pixels
    316     psVector *mask   = psVectorAlloc(inputs->n, PS_TYPE_MASK); // Mask for stack
     316    psVector *mask   = psVectorAlloc(inputs->n, PS_TYPE_VECTOR_MASK); // Mask for stack
    317317    for (int i = minInputRows; i < maxInputRows; i++) {
    318318        int yOut = i - outReadout->row0; // y position on output readout
     
    330330            psVectorInit(mask, 0);
    331331            for (int r = 0; r < inputs->n; r++) {
    332                 if (roMask->data.U8[r]) {
    333                     mask->data.PS_TYPE_MASK_DATA[r] = 0xff;
     332                if (roMask->data.PS_TYPE_VECTOR_MASK_DATA[r]) {
     333                    mask->data.PS_TYPE_VECTOR_MASK_DATA[r] = 0xff;
    334334                    continue;
    335335                }
     
    343343                }
    344344                if (readout->mask) {
    345                     mask->data.PS_TYPE_MASK_DATA[r] = readout->mask->data.PS_TYPE_MASK_DATA[yIn][xIn];
     345                    mask->data.PS_TYPE_VECTOR_MASK_DATA[r] = (readout->mask->data.PS_TYPE_IMAGE_MASK_DATA[yIn][xIn] & maskVal);
    346346                }
    347347
    348348            }
    349349
    350             if (!psPolynomialMDClipFit(poly, pixels, NULL, mask, maskVal, values, iter, rej)) {
     350            if (!psPolynomialMDClipFit(poly, pixels, NULL, mask, 0xff, values, iter, rej)) {
    351351                psErrorClear();         // Nothing we can do about it
    352352                psVectorInit(poly->coeff, NAN);
     
    376376    const psVector *values = job->args->data[3]; // Values for each ordinate
    377377
    378     psMaskType bad = PS_SCALAR_VALUE(job->args->data[4], U8); // Mask value to give bad pixels
     378    psImageMaskType bad = PS_SCALAR_VALUE(job->args->data[4], PS_TYPE_IMAGE_MASK_DATA); // Mask value to give bad pixels
    379379    bool doNorm    = PS_SCALAR_VALUE(job->args->data[5], U8); // Normalise values?
    380380    float norm     = PS_SCALAR_VALUE(job->args->data[6], F32); // Value by which to normalise
     
    386386
    387387bool pmDarkApplyScan(pmReadout *readout, const pmCell *dark, const psVector *orders, const psVector *values,
    388                      psMaskType bad, bool doNorm, float norm, int rowStart, int rowStop)
     388                     psImageMaskType bad, bool doNorm, float norm, int rowStart, int rowStop)
    389389{
    390390    int numCols = readout->image->numCols;
     
    405405            readout->image->data.F32[y][x] -= value;
    406406            if (readout->mask && !isfinite(value)) {
    407                 readout->mask->data.PS_TYPE_MASK_DATA[y][x] = bad;
     407                readout->mask->data.PS_TYPE_IMAGE_MASK_DATA[y][x] = bad;
    408408            }
    409409        }
     
    414414}
    415415
    416 bool pmDarkApply(pmReadout *readout, pmCell *dark, psMaskType bad)
     416bool pmDarkApply(pmReadout *readout, pmCell *dark, psImageMaskType bad)
    417417{
    418418    PS_ASSERT_PTR_NON_NULL(readout, false);
     
    424424        PS_ASSERT_IMAGE_NON_NULL(readout->mask, false);
    425425        PS_ASSERT_IMAGES_SIZE_EQUAL(readout->mask, readout->image, false);
    426         PS_ASSERT_IMAGE_TYPE(readout->mask, PS_TYPE_MASK, false);
     426        PS_ASSERT_IMAGE_TYPE(readout->mask, PS_TYPE_IMAGE_MASK, false);
    427427    }
    428428    int numTerms = dark->readouts->n;   // Number of polynomial terms
     
    496496            psArrayAdd(job->args, 1, orders);
    497497            psArrayAdd(job->args, 1, values);
    498             PS_ARRAY_ADD_SCALAR(job->args, bad, PS_TYPE_MASK);
     498            PS_ARRAY_ADD_SCALAR(job->args, bad, PS_TYPE_IMAGE_MASK);
    499499            PS_ARRAY_ADD_SCALAR(job->args, doNorm, PS_TYPE_U8);
    500500            PS_ARRAY_ADD_SCALAR(job->args, norm, PS_TYPE_F32);
  • branches/eam_branch_20081230/psModules/src/detrend/pmDark.h

    r21072 r21079  
    3737                   int iter,            // Number of rejection iterations
    3838                   float rej,           // Rejection threshold (standard deviations)
    39                    psMaskType maskVal   // Value to mask
     39                   psImageMaskType maskVal   // Value to mask
    4040    );
    4141
     
    4949                     const psVector *orders, // Polynomial orders for each ordinate
    5050                     const psVector *values, // Values for each ordinate
    51                      psMaskType bad,    // Value to give bad pixels
     51                     psImageMaskType bad,    // Value to give bad pixels
    5252                     bool doNorm,       // Normalise values?
    5353                     float norm,        // Value by which to normalise
     
    5858bool pmDarkApply(pmReadout *readout,    // Readout to which to apply dark
    5959                 pmCell *dark,    // Dark to apply
    60                  psMaskType bad         // Mask value to give bad pixels
     60                 psImageMaskType bad         // Mask value to give bad pixels
    6161    );
    6262
  • branches/eam_branch_20081230/psModules/src/detrend/pmFlatField.c

    r21072 r21079  
    2222    const psImage *flatMask  = job->args->data[3]; // Flat-field mask
    2323
    24     psMaskType badFlat = PS_SCALAR_VALUE(job->args->data[4],U8);
     24    psImageMaskType badFlat = PS_SCALAR_VALUE(job->args->data[4],PS_TYPE_IMAGE_MASK_DATA);
    2525    int xOffset        = PS_SCALAR_VALUE(job->args->data[5],S32);
    2626    int yOffset        = PS_SCALAR_VALUE(job->args->data[6],S32);
     
    3838            ps##TYPE flatValue = flatImage->data.TYPE[j + yOffset][i + xOffset]; \
    3939            if (!isfinite(flatValue) || flatValue <= 0.0 || \
    40                 (flatMask && flatMask->data.U8[j + yOffset][i + xOffset])) { \
     40                (flatMask && flatMask->data.PS_TYPE_IMAGE_MASK_DATA[j + yOffset][i + xOffset])) { \
    4141                if (inMask) { \
    42                     inMask->data.PS_TYPE_MASK_DATA[j][i] |= badFlat; \
     42                    inMask->data.PS_TYPE_IMAGE_MASK_DATA[j][i] |= badFlat; \
    4343                } \
    4444                inImage->data.TYPE[j][i] = SPECIAL; \
     
    5151
    5252bool pmFlatFieldScan(psImage *inImage, psImage *inMask, const psImage *flatImage, const psImage *flatMask,
    53                      psMaskType badFlat, int xOffset, int yOffset, int rowStart, int rowStop)
     53                     psImageMaskType badFlat, int xOffset, int yOffset, int rowStart, int rowStop)
    5454{
    5555    switch (inImage->type.type) {
     
    7272}
    7373
    74 bool pmFlatField(pmReadout *in, const pmReadout *flat, psMaskType badFlat)
     74bool pmFlatField(pmReadout *in, const pmReadout *flat, psImageMaskType badFlat)
    7575{
    7676    PS_ASSERT_PTR_NON_NULL(in, false);
     
    8181    PS_ASSERT_IMAGE_NON_EMPTY(flat->image, false);
    8282    if (in->mask) {
    83         PS_ASSERT_IMAGE_TYPE(in->mask, PS_TYPE_MASK, false);
     83        PS_ASSERT_IMAGE_TYPE(in->mask, PS_TYPE_IMAGE_MASK, false);
    8484        PS_ASSERT_IMAGES_SIZE_EQUAL(in->mask, in->image, false);
    8585    }
    8686    PS_ASSERT_IMAGE_TYPE(flat->image, in->image->type.type, false);
    8787    if (flat->mask) {
    88         PS_ASSERT_IMAGE_TYPE(flat->mask, PS_TYPE_MASK, false);
     88        PS_ASSERT_IMAGE_TYPE(flat->mask, PS_TYPE_IMAGE_MASK, false);
    8989        PS_ASSERT_IMAGES_SIZE_EQUAL(flat->mask, flat->image, false);
    9090    }
     
    148148          psArrayAdd(job->args, 1, flatImage);
    149149          psArrayAdd(job->args, 1, flatMask);
    150           PS_ARRAY_ADD_SCALAR(job->args, badFlat, PS_TYPE_U8);
     150          PS_ARRAY_ADD_SCALAR(job->args, badFlat, PS_TYPE_IMAGE_MASK);
    151151          PS_ARRAY_ADD_SCALAR(job->args, xOffset, PS_TYPE_S32);
    152152          PS_ARRAY_ADD_SCALAR(job->args, yOffset, PS_TYPE_S32);
  • branches/eam_branch_20081230/psModules/src/detrend/pmFlatField.h

    r21072 r21079  
    55 * @author Paul Price, IfA
    66 *
    7  * @version $Revision: 1.14 $ $Name: not supported by cvs2svn $
    8  * @date $Date: 2008-09-09 04:10:14 $
     7 * @version $Revision: 1.14.16.1 $ $Name: not supported by cvs2svn $
     8 * @date $Date: 2009-01-02 05:13:00 $
    99 * Copyright 2004-2006 Institute for Astronomy, University of Hawaii
    1010 */
     
    2525bool pmFlatField(pmReadout *in,         ///< Readout with input image
    2626                 const pmReadout *flat,  ///< Readout with flat image
    27                  psMaskType badFlat     ///< Mask value to give bad flat pixels
     27                 psImageMaskType badFlat     ///< Mask value to give bad flat pixels
    2828                );
    2929
     
    3838    const psImage *flatImage,           ///< Flat-field image
    3939    const psImage *flatMask,            ///< Flat-field mask
    40     psMaskType badFlag,                 ///< Mask value to give bad pixels
     40    psImageMaskType badFlag,                 ///< Mask value to give bad pixels
    4141    int xOffset, int yOffset,           ///< Offset between input and flat-field
    4242    int rowStart, int rowStop           ///< Scan range
  • branches/eam_branch_20081230/psModules/src/detrend/pmFlatNormalize.c

    r9730 r21079  
    99
    1010#include "pmFlatNormalize.h"
     11
     12// XXX this function should take the abstract mask names and set bad values in a more precise way
    1113
    1214// I'm not sure that many many iterations are required, but rather suspect that the system converges within a
     
    5557    // Take the logarithms
    5658    psImage *flux = psImageCopy(NULL, bgMatrix, PS_TYPE_F32); // Copy of the input flux levels matrix
    57     psImage *fluxMask = psImageAlloc(numChips, numExps, PS_TYPE_U8); // Mask for bad measurements
     59    psImage *fluxMask = psImageAlloc(numChips, numExps, PS_TYPE_IMAGE_MASK); // Mask for bad measurements
    5860    psImageInit(fluxMask, 0);
    59     psVector *gainMask = psVectorAlloc(numChips, PS_TYPE_U8); // Mask for bad gains
     61    psVector *gainMask = psVectorAlloc(numChips, PS_TYPE_VECTOR_MASK); // Mask for bad gains
    6062    psVectorInit(gainMask, 0);
    61     psVector *expMask = psVectorAlloc(numExps, PS_TYPE_U8); // Mask for bad exposures
     63    psVector *expMask = psVectorAlloc(numExps, PS_TYPE_VECTOR_MASK); // Mask for bad exposures
    6264    psVectorInit(expMask, 0);
    6365    for (int i = 0; i < numChips; i++) {
     
    7577            } else {
    7678                // Blank out this measurement
    77                 fluxMask->data.U8[j][i] = 1;
     79                fluxMask->data.PS_TYPE_IMAGE_MASK_DATA[j][i] = 1;
    7880                flux->data.F32[j][i] = NAN;
    7981            }
     
    9092        int numFluxes = 0;              // Number of fluxes
    9193        for (int i = 0; i < numExps; i++) {
    92             if (expMask->data.U8[i]) {
     94            if (expMask->data.PS_TYPE_VECTOR_MASK_DATA[i]) {
    9395                psTrace("psModules.detrend", 7, "Flux for exposure %d is masked.\n", i);
    9496                continue;
     
    98100            int number = 0;             // Number of chips contributing
    99101            for (int j = 0; j < numChips; j++) {
    100                 if (!gainMask->data.U8[j] && !fluxMask->data.U8[i][j]) {
     102                if (!gainMask->data.PS_TYPE_VECTOR_MASK_DATA[j] && !fluxMask->data.PS_TYPE_IMAGE_MASK_DATA[i][j]) {
    101103                    sum += flux->data.F32[i][j] - chipGains->data.F32[j];
    102104                    number++;
     
    106108                expFluxes->data.F32[i] = sum / (float)number;
    107109            } else {
    108                 expMask->data.U8[i] = 1;
     110                expMask->data.PS_TYPE_VECTOR_MASK_DATA[i] = 1;
    109111                expFluxes->data.F32[i] = NAN;
    110112            }
     
    116118        int numGains = 0;               // Number of gains
    117119        for (int i = 0; i < numChips; i++) {
    118             if (gainMask->data.U8[i]) {
     120            if (gainMask->data.PS_TYPE_VECTOR_MASK_DATA[i]) {
    119121                continue;
    120122            }
     
    122124            int number = 0;             // Numer of sources contributing
    123125            for (int j = 0; j < numExps; j++) {
    124                 if (!fluxMask->data.U8[j][i]) {
     126                if (!fluxMask->data.PS_TYPE_IMAGE_MASK_DATA[j][i]) {
    125127                    sum += flux->data.F32[j][i] - expFluxes->data.F32[j];
    126128                    number++;
     
    130132                chipGains->data.F32[i] = sum / (float)number;
    131133            } else {
    132                 gainMask->data.U8[i] = 1;
     134                gainMask->data.PS_TYPE_VECTOR_MASK_DATA[i] = 1;
    133135                chipGains->data.F32[i] = NAN;
    134136            }
     
    144146            diff = 0.0;
    145147            for (int i = 0; i < numChips; i++) {
    146                 if (gainMask->data.U8[i]) {
     148                if (gainMask->data.PS_TYPE_VECTOR_MASK_DATA[i]) {
    147149                    continue;
    148150                }
     
    151153            }
    152154            for (int i = 0; i < numExps; i++) {
    153                 if (expMask->data.U8[i]) {
     155                if (expMask->data.PS_TYPE_VECTOR_MASK_DATA[i]) {
    154156                    continue;
    155157                }
     
    171173    // Un-log the vectors
    172174    for (int i = 0; i < numChips; i++) {
    173         if (!gainMask->data.U8[i]) {
     175        if (!gainMask->data.PS_TYPE_VECTOR_MASK_DATA[i]) {
    174176            chipGains->data.F32[i] = expf(chipGains->data.F32[i]);
    175177        }
    176178    }
    177179    for (int i = 0; i < numExps; i++) {
    178         if (!expMask->data.U8[i]) {
     180        if (!expMask->data.PS_TYPE_VECTOR_MASK_DATA[i]) {
    179181            expFluxes->data.F32[i] = expf(expFluxes->data.F32[i]);
    180182        }
  • branches/eam_branch_20081230/psModules/src/detrend/pmFringeStats.c

    r13776 r21079  
    7070    fringe->x = psVectorRecycle(fringe->x, fringe->nRequested, PS_TYPE_F32);
    7171    fringe->y = psVectorRecycle(fringe->y, fringe->nRequested, PS_TYPE_F32);
    72     fringe->mask = psVectorRecycle(fringe->mask, fringe->nRequested, PS_TYPE_U8);
     72    fringe->mask = psVectorRecycle(fringe->mask, fringe->nRequested, PS_TYPE_VECTOR_MASK);
    7373    fringe->x->n = fringe->y->n = fringe->mask->n = fringe->nRequested;
    7474    psVectorInit(fringe->mask, 0);
     
    115115    if (mask) {
    116116        PS_ASSERT_VECTOR_NON_NULL(mask, false);
    117         PS_ASSERT_VECTOR_TYPE(mask, PS_TYPE_U8, false);
     117        PS_ASSERT_VECTOR_TYPE(mask, PS_TYPE_VECTOR_MASK, false);
    118118        PS_ASSERT_VECTOR_SIZE(mask, (long)numRows, false);
    119119    }
     
    142142        psMetadataAddF32(row, PS_LIST_TAIL, "x", PS_META_REPLACE, "Fringe position in x", x->data.F32[i]);
    143143        psMetadataAddF32(row, PS_LIST_TAIL, "y", PS_META_REPLACE, "Fringe position in y", y->data.F32[i]);
    144         psU8 maskValue = 0;
    145         if (mask && mask->data.U8[i]) {
     144        psVectorMaskType maskValue = 0;
     145        if (mask && mask->data.PS_TYPE_VECTOR_MASK_DATA[i]) {
    146146            maskValue = 0xff;
    147147        }
    148         psMetadataAddU8(row, PS_LIST_TAIL, "mask", PS_META_REPLACE, "Mask", maskValue);
     148        psMetadataAddVectorMask(row, PS_LIST_TAIL, "mask", PS_META_REPLACE, "Mask", maskValue);
    149149        table->data[i] = row;
    150150    }
     
    207207    psVector *x = psVectorAlloc(numRows, PS_TYPE_F32); // x position
    208208    psVector *y = psVectorAlloc(numRows, PS_TYPE_F32); // y position
    209     psVector *mask = psVectorAlloc(numRows, PS_TYPE_U8); // mask
     209    psVector *mask = psVectorAlloc(numRows, PS_TYPE_VECTOR_MASK); // mask
    210210    regions->x = x;
    211211    regions->y = y;
    212212    regions->mask = mask;
    213213
    214     #define READ_REGIONS_ROW(VECTOR, TYPE, NAME, DESCRIPTION) \
    215     VECTOR->data.TYPE[i] = psMetadataLookup##TYPE(&mdok, row, NAME); \
     214    #define READ_REGIONS_ROW(VECTOR, TYPE, DATATYPE, NAME, DESCRIPTION) \
     215    VECTOR->data.DATATYPE[i] = psMetadataLookup##TYPE(&mdok, row, NAME); \
    216216    if (!mdok) { \
    217217        psError(PS_ERR_IO, true, "Unable to find " #DESCRIPTION " .\n"); \
     
    224224    for (long i = 0; i < numRows; i++) {
    225225        psMetadata *row = table->data[i]; // Table row
    226         READ_REGIONS_ROW(x, F32, "x", "x position");
    227         READ_REGIONS_ROW(y, F32, "y", "y position");
    228         READ_REGIONS_ROW(mask, U8, "mask", "mask");
     226        READ_REGIONS_ROW(x, F32, F32, "x", "x position");
     227        READ_REGIONS_ROW(y, F32, F32, "y", "y position");
     228        READ_REGIONS_ROW(mask, VectorMask, PS_TYPE_VECTOR_MASK_DATA, "mask", "mask");
    229229    }
    230230    psFree(table);
     
    259259}
    260260
    261 pmFringeStats *pmFringeStatsMeasure(pmFringeRegions *fringe, const pmReadout *readout, psMaskType maskVal)
     261pmFringeStats *pmFringeStatsMeasure(pmFringeRegions *fringe, const pmReadout *readout, psImageMaskType maskVal)
    262262{
    263263    PS_ASSERT_PTR_NON_NULL(fringe, NULL);
     
    490490    newRegions->x = psVectorAlloc(numPoints, PS_TYPE_F32);
    491491    newRegions->y = psVectorAlloc(numPoints, PS_TYPE_F32);
    492     newRegions->mask = psVectorAlloc(numPoints, PS_TYPE_U8);
     492    newRegions->mask = psVectorAlloc(numPoints, PS_TYPE_VECTOR_MASK);
    493493    pmFringeStats *newStats = pmFringeStatsAlloc(newRegions); // The new list of statistics
    494494
     
    500500        memcpy(&newRegions->x->data.F32[offset], regions->x->data.F32, regions->x->n * sizeof(psF32));
    501501        memcpy(&newRegions->y->data.F32[offset], regions->y->data.F32, regions->y->n * sizeof(psF32));
    502         memcpy(&newRegions->mask->data.U8[offset], regions->mask->data.U8, regions->mask->n * sizeof(psU8));
     502        memcpy(&newRegions->mask->data.PS_TYPE_VECTOR_MASK_DATA[offset], regions->mask->data.PS_TYPE_VECTOR_MASK_DATA, regions->mask->n * sizeof(psVectorMaskType));
    503503        memcpy(&newStats->f->data.F32[offset], fringe->f->data.F32, fringe->f->n * sizeof(psF32));
    504504        memcpy(&newStats->df->data.F32[offset], fringe->df->data.F32, fringe->df->n * sizeof(psF32));
     
    549549    if (mask) {
    550550        PS_ASSERT_VECTOR_NON_NULL(mask, false);
    551         PS_ASSERT_VECTOR_TYPE(mask, PS_TYPE_U8, false);
     551        PS_ASSERT_VECTOR_TYPE(mask, PS_TYPE_VECTOR_MASK, false);
    552552        PS_ASSERT_VECTOR_SIZE(mask, (long)numRows, false);
    553553    }
     
    580580        psMetadataAddF32(row, PS_LIST_TAIL, "x", PS_META_REPLACE, "Fringe position in x", x->data.F32[i]);
    581581        psMetadataAddF32(row, PS_LIST_TAIL, "y", PS_META_REPLACE, "Fringe position in y", y->data.F32[i]);
    582         psU8 maskValue = 0;             // Mask value
    583         if (mask && mask->data.U8[i]) {
     582        psVectorMaskType maskValue = 0;             // Mask value
     583        if (mask && mask->data.PS_TYPE_VECTOR_MASK_DATA[i]) {
    584584            maskValue = 0xff;
    585585        }
     
    601601        psFree(df);
    602602
    603         psMetadataAddU8(row, PS_LIST_TAIL, "mask", PS_META_REPLACE, "Mask", maskValue);
     603        psMetadataAddVectorMask(row, PS_LIST_TAIL, "mask", PS_META_REPLACE, "Mask", maskValue);
    604604        table->data[i] = row;
    605605    }
     
    648648    psVector *x = psVectorAlloc(numRows, PS_TYPE_F32); // x position
    649649    psVector *y = psVectorAlloc(numRows, PS_TYPE_F32); // y position
    650     psVector *mask = psVectorAlloc(numRows, PS_TYPE_U8); // mask
     650    psVector *mask = psVectorAlloc(numRows, PS_TYPE_VECTOR_MASK); // mask
    651651    regions->x = x;
    652652    regions->y = y;
     
    656656    psArray *fringes = NULL; // Array of fringes, to return
    657657
    658     #define READ_FRINGES_VECTOR_ROW(VECTOR, TYPE, NAME, DESCRIPTION) \
     658    #define READ_FRINGES_VECTOR_ROW(VECTOR, TYPE, DATATYPE, NAME, DESCRIPTION) \
    659659    { \
    660         VECTOR->data.TYPE[i] = psMetadataLookup##TYPE(&mdok, row, NAME); \
     660        VECTOR->data.DATATYPE[i] = psMetadataLookup##TYPE(&mdok, row, NAME); \
    661661        if (!mdok) { \
    662662            psError(PS_ERR_IO, true, "Unable to find " #DESCRIPTION " for row %ld.\n", i); \
     
    686686    }
    687687
     688    // XXX : need to extend this to support arbitrary types for the vectors on disk
    688689    // Translate the table into vectors
    689690    for (long i = 0; i < numRows; i++) {
    690691        psMetadata *row = table->data[i]; // Table row
    691         READ_FRINGES_VECTOR_ROW(x, F32, "x", "x position");
    692         READ_FRINGES_VECTOR_ROW(y, F32, "y", "y position");
    693         READ_FRINGES_VECTOR_ROW(mask, U8, "mask", "mask");
     692        READ_FRINGES_VECTOR_ROW(x, F32, F32, "x", "x position");
     693        READ_FRINGES_VECTOR_ROW(y, F32, F32, "y", "y position");
     694        READ_FRINGES_VECTOR_ROW(mask, VectorMask, PS_TYPE_VECTOR_MASK_DATA, "mask", "mask");
    694695        READ_FRINGES_ARRAY_ROW(f, F32, "f", "fringe measurement");
    695696        READ_FRINGES_ARRAY_ROW(df, F32, "df", "fringe error");
     
    782783            double matrix = 0.0;        // The matrix sum
    783784            for (int k = 0; k < numPoints; k++) {
    784                 if (!mask->data.U8[k]) {
     785                if (!mask->data.PS_TYPE_VECTOR_MASK_DATA[k]) {
    785786                    psF32 f1 = (fringe1) ? fringe1->data.F32[k] : 1.0; // Contribution from i fringe
    786787                    psF32 f2 = (fringe2) ? fringe2->data.F32[k] : 1.0; // Contribution from j fringe
     
    799800        double vector = 0.0;            // The vector sum
    800801        for (int k = 0; k < numPoints; k++) {
    801             if (!mask->data.U8[k]) {
     802            if (!mask->data.PS_TYPE_VECTOR_MASK_DATA[k]) {
    802803                psF32 f1 = (fringe1) ? fringe1->data.F32[k] : 1.0; // Contribution from fringe 1
    803804                psF32 s = science->f->data.F32[k]; // Contribution from science measurement
     
    855856
    856857    for (int i = 0; i < diff->n; i++) {
    857         if (!mask->data.U8[i]) {
     858        if (!mask->data.PS_TYPE_VECTOR_MASK_DATA[i]) {
    858859            float difference = science->f->data.F32[i] - scale->coeff->data.F32[0];
    859860            for (int j = 0; j < fringes->n; j++) {
     
    877878    assert(diffs->type.type == PS_TYPE_F32);
    878879    assert(mask);
    879     assert(mask->type.type == PS_TYPE_U8);
     880    assert(mask->type.type == PS_TYPE_VECTOR_MASK);
    880881    assert(diffs->n == mask->n);
    881882
     
    888889    int numClipped = 0;                 // Number clipped
    889890    for (int i = 0; i < diffs->n; i++) {
    890         psTrace("psModules.detrend", 10, "Region %d (%d): %f\n", i, mask->data.U8[i], diffs->data.F32[i]);
    891         if (!mask->data.U8[i] && fabs(diffs->data.F32[i]) > middle + thresh) {
     891        psTrace("psModules.detrend", 10, "Region %d (%d): %f\n", i, mask->data.PS_TYPE_VECTOR_MASK_DATA[i], diffs->data.F32[i]);
     892        if (!mask->data.PS_TYPE_VECTOR_MASK_DATA[i] && fabs(diffs->data.F32[i]) > middle + thresh) {
    892893            psTrace("psModules.detrend", 5, "Masking %d: %f\n", i, diffs->data.F32[i]);
    893             mask->data.U8[i] = 1;
     894            mask->data.PS_TYPE_VECTOR_MASK_DATA[i] = 1;
    894895            numClipped++;
    895896        }
     
    931932    // Set up the mask
    932933    if (!regions->mask) {
    933         regions->mask = psVectorAlloc(numRegions, PS_TYPE_U8);
     934        regions->mask = psVectorAlloc(numRegions, PS_TYPE_VECTOR_MASK);
    934935        psVectorInit(regions->mask, 0);
    935936    }
     
    946947        for (int j = 0; j < numRegions; j++) {
    947948            if (!isfinite(fringe->f->data.F32[j])) {
    948                 mask->data.U8[j] = 1;
     949                mask->data.PS_TYPE_VECTOR_MASK_DATA[j] = 1;
    949950                psTrace("psModules.detrend", 9, "Masking region %d because not finite in fringe %d.\n", j, i);
    950951            }
     
    956957    FILE *f = fopen ("fringe.dat", "w");
    957958    for (int j = 0; j < numRegions; j++) {
    958         if (mask->data.U8[j]) continue;
     959        if (mask->data.PS_TYPE_VECTOR_MASK_DATA[j]) continue;
    959960        fprintf (f, "%d %f %f ", j, science->f->data.F32[j], science->df->data.F32[j]);
    960961        for (int i = 0; i < fringes->n; i++) {
     
    10141015// XXX note that this modifies the input fringe images
    10151016psImage *pmFringeCorrect(pmReadout *readout, pmFringeRegions *fringes, psArray *fringeImages,
    1016                          psArray *fringeStats, psMaskType maskVal, float rej,
     1017                         psArray *fringeStats, psImageMaskType maskVal, float rej,
    10171018                         unsigned int nIter, float keepFrac)
    10181019{
  • branches/eam_branch_20081230/psModules/src/detrend/pmFringeStats.h

    r11253 r21079  
    55 * @author Paul Price, IfA
    66 *
    7  * @version $Revision: 1.12 $ $Name: not supported by cvs2svn $
    8  * @date $Date: 2007-01-24 02:54:15 $
     7 * @version $Revision: 1.12.78.1 $ $Name: not supported by cvs2svn $
     8 * @date $Date: 2009-01-02 05:13:00 $
    99 * Copyright 2004-2006 Institute for Astronomy, University of Hawaii
    1010 */
     
    102102pmFringeStats *pmFringeStatsMeasure(pmFringeRegions *fringe, ///< Fringe regions at which to measure
    103103                                    const pmReadout *readout, ///< Readout for which to measure
    104                                     psMaskType maskVal ///< Mask value for image
     104                                    psImageMaskType maskVal ///< Mask value for image
    105105                                   );
    106106
     
    206206                         psArray *fringeImages, ///< Fringe template images to use in correction
    207207                         psArray *fringeStats, ///< Fringe stats (for templates) to use in correction
    208                          psMaskType maskVal, ///< Value to mask for science image
     208                         psImageMaskType maskVal, ///< Value to mask for science image
    209209                         float rej,     ///< Rejection threshold, for pmFringeScaleMeasure
    210210                         unsigned int nIter, ///< Maximum number of iterations, for pmFringeScaleMeasure
  • branches/eam_branch_20081230/psModules/src/detrend/pmMaskBadPixels.c

    r21072 r21079  
    1414#include "pmMaskBadPixels.h"
    1515
    16 bool pmMaskBadPixels(pmReadout *input, const pmReadout *mask, psMaskType maskVal)
     16bool pmMaskBadPixels(pmReadout *input, const pmReadout *mask, psImageMaskType maskVal)
    1717{
    1818    PS_ASSERT_PTR_NON_NULL(input, false);
    1919    PS_ASSERT_PTR_NON_NULL(input->mask, false);
    20     PS_ASSERT_IMAGE_TYPE(input->mask, PS_TYPE_MASK, false);
     20    PS_ASSERT_IMAGE_TYPE(input->mask, PS_TYPE_IMAGE_MASK, false);
    2121
    2222    PS_ASSERT_PTR_NON_NULL(mask, false);
    2323    PS_ASSERT_PTR_NON_NULL(mask->mask, false);
    24     PS_ASSERT_IMAGE_TYPE(mask->mask, PS_TYPE_MASK, false);
     24    PS_ASSERT_IMAGE_TYPE(mask->mask, PS_TYPE_IMAGE_MASK, false);
    2525
    2626    psImage *inMask = input->mask;
     
    5353    int offRow = input->row0 - mask->row0;
    5454
    55     // masks are both of type PS_TYPE_MASK
    56     psMaskType **exVal = exMask->data.U8;
    57     psMaskType **inVal = inMask->data.U8;
     55    // masks are both of type PS_TYPE_IMAGE_MASK
     56    psImageMaskType **exVal = exMask->data.PS_TYPE_IMAGE_MASK_DATA;
     57    psImageMaskType **inVal = inMask->data.PS_TYPE_IMAGE_MASK_DATA;
    5858
    5959    // apply exMask values
     
    8282
    8383bool pmMaskFlagSuspectPixels(pmReadout *output, const pmReadout *readout, float median, float stdev,
    84                              float rej, psMaskType maskVal)
     84                             float rej, psImageMaskType maskVal)
    8585{
    8686    PS_ASSERT_PTR_NON_NULL(readout, false);
     
    9292        PS_ASSERT_IMAGE_NON_EMPTY(readout->mask, false);
    9393        PS_ASSERT_IMAGES_SIZE_EQUAL(readout->image, readout->mask, false);
    94         PS_ASSERT_IMAGE_TYPE(readout->mask, PS_TYPE_MASK, false);
     94        PS_ASSERT_IMAGE_TYPE(readout->mask, PS_TYPE_IMAGE_MASK, false);
    9595    }
    9696    PS_ASSERT_PTR_NON_NULL(output, false);
     
    128128        for (int x = 0; x < image->numCols; x++) {
    129129            if (fabs((image->data.F32[y][x] - median) / stdev) < rej) continue;
    130             if (mask && (mask->data.PS_TYPE_MASK_DATA[y][x] & maskVal)) continue;
     130            if (mask && (mask->data.PS_TYPE_IMAGE_MASK_DATA[y][x] & maskVal)) continue;
    131131            suspect->data.F32[y][x] += 1.0;
    132132        }
     
    142142
    143143// the maskVal supplied here is the value SET for this mask (ie, it is not used to avoid pixels)
    144 bool pmMaskIdentifyBadPixels(pmReadout *output, psMaskType maskVal, float thresh, pmMaskIdentifyMode mode)
     144bool pmMaskIdentifyBadPixels(pmReadout *output, psImageMaskType maskVal, float thresh, pmMaskIdentifyMode mode)
    145145{
    146146    PS_ASSERT_PTR_NON_NULL(output, false);
     
    155155        PS_ASSERT_IMAGE_NON_EMPTY(output->mask, false);
    156156        PS_ASSERT_IMAGES_SIZE_EQUAL(output->mask, suspects, false);
    157         PS_ASSERT_IMAGE_TYPE(output->mask, PS_TYPE_MASK, false);
     157        PS_ASSERT_IMAGE_TYPE(output->mask, PS_TYPE_IMAGE_MASK, false);
    158158    } else {
    159         output->mask = psImageAlloc(suspects->numCols, suspects->numRows, PS_TYPE_MASK);
     159        output->mask = psImageAlloc(suspects->numCols, suspects->numRows, PS_TYPE_IMAGE_MASK);
    160160    }
    161161    int num = psMetadataLookupS32(NULL, output->analysis, PM_MASK_ANALYSIS_NUM); // Number of inputs
     
    246246        for (int x = 0; x < suspects->numCols; x++) {
    247247            if (suspects->data.F32[y][x] >= limit) {
    248                 badpix->data.PS_TYPE_MASK_DATA[y][x] = maskVal;
     248                badpix->data.PS_TYPE_IMAGE_MASK_DATA[y][x] = maskVal;
    249249            }
    250250        }
  • branches/eam_branch_20081230/psModules/src/detrend/pmMaskBadPixels.h

    r17228 r21079  
    55 * @author Eugene Magnier, IfA
    66 *
    7  * @version $Revision: 1.16 $ $Name: not supported by cvs2svn $
    8  * @date $Date: 2008-03-29 03:10:17 $
     7 * @version $Revision: 1.16.44.1 $ $Name: not supported by cvs2svn $
     8 * @date $Date: 2009-01-02 05:13:00 $
    99 * Copyright 2004 Institute for Astronomy, University of Hawaii
    1010 */
     
    4040bool pmMaskBadPixels(pmReadout *input,  ///< Input science image
    4141                     const pmReadout *mask, ///< Mask image to apply
    42                      psMaskType maskVal ///< Mask value to apply
     42                     psImageMaskType maskVal ///< Mask value to apply
    4343                    );
    4444
     
    5656                             float stdev, ///< Image standard deviation
    5757                             float rej, ///< Rejection threshold (standard deviations)
    58                              psMaskType maskVal ///< Mask value for statistics
     58                             psImageMaskType maskVal ///< Mask value for statistics
    5959    );
    6060
     
    6464/// according to the chosen mode.
    6565bool pmMaskIdentifyBadPixels(pmReadout *output, ///< Output readout, with suspect pixels imageOut
    66                              psMaskType maskVal, ///< Value to set for bad pixels
     66                             psImageMaskType maskVal, ///< Value to set for bad pixels
    6767                             float thresh, ///< Threshold for bad pixel
    6868                             pmMaskIdentifyMode mode ///< Mode for identifying bad pixels
  • branches/eam_branch_20081230/psModules/src/detrend/pmOverscan.c

    r19846 r21079  
    6767    psVector *reduced = psVectorAlloc(pixels->n, PS_TYPE_F32); // Overscan for each row
    6868    psVector *ordinate = psVectorAlloc(pixels->n, PS_TYPE_F32); // Ordinate
    69     psVector *mask = psVectorAlloc(pixels->n, PS_TYPE_U8); // Mask for fitting
     69    psVector *mask = psVectorAlloc(pixels->n, PS_TYPE_VECTOR_MASK); // Mask for fitting
    7070
    7171    for (int i = 0; i < pixels->n; i++) {
    7272        psVector *values = pixels->data[i]; // Vector with overscan values
    7373        if (values->n > 0) {
    74             mask->data.U8[i] = 0;
     74            mask->data.PS_TYPE_VECTOR_MASK_DATA[i] = 0;
    7575            ordinate->data.F32[i] = 2.0*(float)i/(float)pixels->n - 1.0; // Scale to [-1,1]
    7676            psVectorStats(myStats, values, NULL, NULL, 0);
     
    8282        } else {
    8383            // We'll fit this one out
    84             mask->data.U8[i] = 1;
     84            mask->data.PS_TYPE_VECTOR_MASK_DATA[i] = 1;
    8585        }
    8686    }
  • branches/eam_branch_20081230/psModules/src/detrend/pmRemnance.c

    r21072 r21079  
    1313
    1414bool pmRemnance(pmReadout *ro,           ///< Readout with input image
    15                 psMaskType maskVal,      ///< Value of mask
    16                 psMaskType maskRem,       ///< Value to give remance
     15                psImageMaskType maskVal,      ///< Value of mask
     16                psImageMaskType maskRem,       ///< Value to give remance
    1717                int size,               ///< Size of accumulation patches
    1818                float threshold         ///< Threshold for masking
     
    2323    PM_ASSERT_READOUT_MASK(ro, false);
    2424
    25     psImage *image = ro->image, *mask = ro->mask; // Mask and image from readout
     25    psImage *image = ro->image;
     26    psImage *mask = ro->mask; // Mask and image from readout
     27
    2628    int numCols = image->numCols, numRows = image->numRows; // Size of image
    2729
     
    3335        psErrorClear();
    3436        psWarning("Unable to calculate image statistics: masking entire readout.");
    35         psBinaryOp(mask, mask, "|", psScalarAlloc(maskRem, PS_TYPE_MASK));
     37        psBinaryOp(mask, mask, "|", psScalarAlloc(maskRem, PS_TYPE_IMAGE_MASK));
    3638        psFree(stats);
    3739        psFree(rng);
     
    5759            }
    5860            for (int y = min; y < max; y++) {
    59                 if (mask->data.PS_TYPE_MASK_DATA[y][x] & maskVal) {
     61                if (mask->data.PS_TYPE_IMAGE_MASK_DATA[y][x] & maskVal) {
    6062                    continue;
    6163                }
     
    8486            }
    8587            for (int y = 0; y < maxMask; y++) {
    86                 mask->data.PS_TYPE_MASK_DATA[y][x] |= maskRem;
     88                mask->data.PS_TYPE_IMAGE_MASK_DATA[y][x] |= maskRem;
    8789            }
    8890            numMasked += maxMask;
  • branches/eam_branch_20081230/psModules/src/detrend/pmRemnance.h

    r21072 r21079  
    1313// GPC1 leaves remnance that flows down from where the annoyed pixels are.
    1414bool pmRemnance(pmReadout *ro,           ///< Readout with input image
    15                 psMaskType maskVal,      ///< Value of mask
    16                 psMaskType maskRem,       ///< Value to give remance
     15                psImageMaskType maskVal,      ///< Value of mask
     16                psImageMaskType maskRem,       ///< Value to give remance
    1717                int size,               ///< Size of accumulation patches
    1818                float threshold         ///< Threshold for masking
  • branches/eam_branch_20081230/psModules/src/detrend/pmShifts.c

    r15322 r21079  
    412412}
    413413
    414 bool pmShiftsConvolve(pmReadout *detrend, const pmCell *source, psMaskType maskVal)
     414bool pmShiftsConvolve(pmReadout *detrend, const pmCell *source, psImageMaskType maskVal)
    415415{
    416416    PS_ASSERT_PTR(detrend, false);
  • branches/eam_branch_20081230/psModules/src/detrend/pmShifts.h

    r12696 r21079  
    4646bool pmShiftsConvolve(pmReadout *detrend, ///< Detrend readout to convolve
    4747                      const pmCell *source, ///< Science exposure, containing a shifts kernel
    48                       psMaskType maskVal ///< Mask value to smear
     48                      psImageMaskType maskVal ///< Mask value to smear
    4949                      );
    5050
  • branches/eam_branch_20081230/psModules/src/detrend/pmShutterCorrection.h

    r21072 r21079  
    55 * @author Paul Price, IfA
    66 *
    7  * @version $Revision: 1.21 $ $Name: not supported by cvs2svn $
    8  * @date $Date: 2008-09-09 04:10:14 $
     7 * @version $Revision: 1.21.16.1 $ $Name: not supported by cvs2svn $
     8 * @date $Date: 2009-01-02 05:13:00 $
    99 * Copyright 2006 Institute for Astronomy, University of Hawaii
    1010 */
     
    9191    float offref,                       ///< Reference time offset
    9292    int nIter,                          ///< Number of iterations
    93     float rej,                          ///< Rejection threshold (sigma)
    94     psMaskType maskVal                  ///< Mask value
     93    float rej                           ///< Rejection threshold (sigma)
    9594    );
    9695
     
    121120    int nIter,                          ///< Number of iterations
    122121    float rej,                          ///< Rejection threshold (sigma)
    123     psMaskType maskVal                  ///< Mask value
     122    psImageMaskType maskVal                  ///< Mask value
    124123    );
    125124
     
    135134    psImage *mask,                      ///< Input mask image
    136135    float exptime,                      ///< Exposure time to which to correct
    137     psMaskType blank,                   ///< Mask value to give blank pixels
     136    psImageMaskType blank,                   ///< Mask value to give blank pixels
    138137    int rowStart, int rowStop           ///< Range of scan
    139138    );
     
    145144    pmReadout *readout,                 ///< Readout to which to apply shutter correction
    146145    const pmReadout *shutter,           ///< Shutter correction readout, with dT for each pixel
    147     psMaskType blank                    ///< Value to give blank pixels
     146    psImageMaskType blank                    ///< Value to give blank pixels
    148147    );
    149148
     
    181180    psStatsOptions meanStat,            ///< Statistic to use for mean
    182181    psStatsOptions stdevStat,           ///< Statistic to use for stdev
    183     psMaskType maskVal,                 ///< Mask value
     182    psImageMaskType maskVal,                 ///< Mask value
    184183    psRandom *rng                       ///< Random number generator
    185184    );
     
    201200    int nIter,                          ///< Number of iterations
    202201    float rej,                          ///< Rejection threshold (sigma)
    203     psMaskType maskVal                  ///< Mask value
     202    psImageMaskType maskVal                  ///< Mask value
    204203    );
    205204
    206205// prepare outputs for shutter correction
    207206bool pmShutterCorrectionGeneratePrepare(pmReadout *shutter, pmReadout *pattern, const psArray *inputs,
    208                                         psMaskType maskVal);
     207                                        psImageMaskType maskVal);
    209208
    210209/// @}
  • branches/eam_branch_20081230/psModules/src/detrend/pmSkySubtract.c

    r12742 r21079  
    66 *  @author GLG, MHPCC
    77 *
    8  *  @version $Revision: 1.3 $ $Name: not supported by cvs2svn $
    9  *  @date $Date: 2007-04-04 22:42:48 $
     8 *  @version $Revision: 1.3.74.1 $ $Name: not supported by cvs2svn $
     9 *  @date $Date: 2009-01-02 05:13:00 $
    1010 *
    1111 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    114114
    115115    psVector *binVector = psVectorAlloc(binFactor * binFactor, PS_TYPE_F32);
    116     psVector *binMask = psVectorAlloc(binFactor * binFactor, PS_TYPE_U8);
     116    psVector *binMask = psVectorAlloc(binFactor * binFactor, PS_TYPE_VECTOR_MASK);
    117117    psStats *myStats = psStatsAlloc(statOptions);
    118118
     
    126126                        binVector->data.F32[count] =
    127127                            origImage->data.F32[row + binRow][col + binCol];
    128                         binMask->data.U8[count] = 0;
     128                        binMask->data.PS_TYPE_VECTOR_MASK_DATA[count] = 0;
    129129                    } else {
    130130                        binVector->data.F32[count] = 0.0;
    131                         binMask->data.U8[count] = 1;
     131                        binMask->data.PS_TYPE_VECTOR_MASK_DATA[count] = 1;
    132132                    }
    133133                    count++;
     
    313313    PS_ASSERT_IMAGE_NON_NULL(maskImage, NULL);
    314314    PS_ASSERT_IMAGE_NON_EMPTY(maskImage, NULL);
    315     PS_ASSERT_IMAGE_TYPE(maskImage, PS_TYPE_U8, NULL);
     315    PS_ASSERT_IMAGE_TYPE(maskImage, PS_TYPE_IMAGE_MASK, NULL);
    316316    PS_ASSERT_IMAGES_SIZE_EQUAL(dataImage, maskImage, NULL);
    317317    psS32 oldPolyX = -1;
     
    361361    for (x=0;x<dataImage->numRows;x++) {
    362362        for (y=0;y<dataImage->numCols;y++) {
    363             if (maskImage->data.U8[x][y] == 0) {
     363            if (maskImage->data.PS_TYPE_IMAGE_MASK_DATA[x][y] == 0) {
    364364                buildSums((psF64) x, (psF64) y, myPoly->nX, myPoly->nY);
    365365
     
    572572
    573573        if (in->mask != NULL) {
    574             binnedMaskImage = psImageCopy(binnedMaskImage, in->mask, PS_TYPE_U8);
     574            binnedMaskImage = psImageCopy(binnedMaskImage, in->mask, PS_TYPE_IMAGE_MASK);
    575575            if (binnedMaskImage == NULL) {
    576576                psError(PS_ERR_UNKNOWN, false, "psImageCopy() returned NULL.  Returning in image.\n");
     
    581581            binnedMaskImage = psImageAlloc(binnedImage->numCols,
    582582                                           binnedImage->numRows,
    583                                            PS_TYPE_U8);
     583                                           PS_TYPE_IMAGE_MASK);
    584584            psImageInit(binnedMaskImage, 0);
    585585        }
     
    592592        binnedMaskImage = psImageAlloc(binnedImage->numCols,
    593593                                       binnedImage->numRows,
    594                                        PS_TYPE_U8);
     594                                       PS_TYPE_IMAGE_MASK);
    595595        psImageInit(binnedMaskImage, 0);
    596596    }
     
    625625                if (fabs(binnedImage->data.F32[row][col] - binnedMean) >
    626626                        (clipSD * binnedStdev)) {
    627                     binnedMaskImage->data.U8[row][col] = 1;
     627                    binnedMaskImage->data.PS_TYPE_IMAGE_MASK_DATA[row][col] = 1;
    628628                }
    629629            }
  • branches/eam_branch_20081230/psModules/src/imcombine/pmImageCombine.c

    r21072 r21079  
    88 *  @author GLG, MHPCC
    99 *
    10  *  @version $Revision: 1.12 $ $Name: not supported by cvs2svn $
    11  *  @date $Date: 2007-04-04 22:42:48 $
     10 *  @version $Revision: 1.12.78.1 $ $Name: not supported by cvs2svn $
     11 *  @date $Date: 2009-01-02 05:13:00 $
    1212 *
    1313 *  XXX: pmRejectPixels() has a known bug with the pmImageTransform() call.
     
    1717 */
    1818
     19// XXX this is somewhat messy and unclear on the masking.
     20
    1921#ifdef HAVE_CONFIG_H
    2022#include <config.h>
     
    5355
    5456    buffer->pixels = psVectorAlloc(numImages, PS_TYPE_F32);
    55     buffer->masks = psVectorAlloc(numImages, PS_TYPE_MASK);
     57    buffer->masks = psVectorAlloc(numImages, PS_TYPE_VECTOR_MASK);
    5658    buffer->errors = psVectorAlloc(numImages, PS_TYPE_F32);
    5759    buffer->stats = psStatsAlloc(PS_STAT_SAMPLE_MEAN | PS_STAT_SAMPLE_STDEV);
     
    6769                          const psArray *errors, // Array of input error images
    6870                          const psArray *masks, // Array of input masks
    69                           psU32 maskVal, // Mask value
     71                          psImageMaskType maskVal, // Mask value
    7072                          psS32 numIter, // Number of rejection iterations
    7173                          psF32 sigmaClip, // Number of standard deviations at which to reject
     
    115117        if (masks) {
    116118            psImage *mask = masks->data[i]; // Mask of interest
    117             pixelMasks->data.U8[i] = mask->data.U8[y][x];
    118         }        // Set the pixel error data, if necessary
     119            pixelMasks->data.PS_TYPE_VECTOR_MASK_DATA[i] = (mask->data.PS_TYPE_IMAGE_MASK_DATA[y][x] & maskVal);
     120        }       
     121        // Set the pixel error data, if necessary
    119122        if (errors) {
    120123            psImage *error = errors->data[i]; // Error image of interest
     
    128131    for (int iter = 0; iter < numIter; iter++) {
    129132        // Combine all the pixels, using the specified stat.
    130         if (!psVectorStats(stats, pixelData, pixelErrors, pixelMasks, maskVal)) {
     133        if (!psVectorStats(stats, pixelData, pixelErrors, pixelMasks, 0xff)) {
    131134            combine->data.F32[y][x] = NAN;
    132135            psFree(buffer);
     
    148151        float stdev = stats->sampleStdev;
    149152        for (int i = 0; i < numImages; i++) {
    150             if (!(pixelMasks->data.U8[i] & maskVal) &&
     153            if (!(pixelMasks->data.PS_TYPE_VECTOR_MASK_DATA[i] & 0xff) &&
    151154                    fabs(pixelData->data.F32[i] - combinedPixel) > sigmaClip * stdev) {
    152155                // Reject pixel as questionable
    153156                numRejects++;
    154                 pixelMasks->data.U8[i] = maskVal;
     157                pixelMasks->data.PS_TYPE_IMAGE_MASK_DATA[i] = 0xff;
    155158                if (questionablePixels) {
    156159                    // Mark the pixel as questionable
     
    191194    const psArray *errors,              ///< Array of input error images
    192195    const psArray *masks,               ///< Array of input masks
    193     psU32 maskVal,                      ///< Mask value
     196    psImageMaskType maskVal,                      ///< Mask value
    194197    const psPixels *pixels,             ///< Pixels to combine
    195198    psS32 numIter,                      ///< Number of rejection iterations
     
    231234            psImage *mask  = masks->data[i];
    232235            PS_ASSERT_IMAGE_SIZE(mask, numCols, numRows, NULL);
    233             PS_ASSERT_IMAGE_TYPE(mask, PS_TYPE_MASK, NULL);
     236            PS_ASSERT_IMAGE_TYPE(mask, PS_TYPE_IMAGE_MASK, NULL);
    234237        }
    235238    }
     
    319322    int num = 0;
    320323    psVector *pixels = psVectorAlloc(8, PS_TYPE_F32); // Array of pixels
    321     psVector *mask = psVectorAlloc(8, PS_TYPE_U8); // Corresponding mask
     324    psVector *mask = psVectorAlloc(8, PS_TYPE_VECTOR_MASK); // Corresponding mask
    322325
    323326    // Get limits
     
    329332        for (int j = yMin; j <= yMax; j++) {
    330333            for (int i = xMin; i <= xMax; i++) {
    331                 if ((i != x) && (j != y) && (0 == imageMask->data.U8[j][i])) {
     334                if ((i != x) && (j != y) && (0 == imageMask->data.PS_TYPE_IMAGE_MASK_DATA[j][i])) {
    332335                    pixels->data.F32[num] = image->data.F32[j][i];
    333                     mask->data.U8[num] = 0;
     336                    mask->data.PS_TYPE_VECTOR_MASK_DATA[num] = 0;
    334337                    num++;
    335338                } else {
    336                     mask->data.U8[num] = 1;
     339                    mask->data.PS_TYPE_VECTOR_MASK_DATA[num] = 1;
    337340                }
    338341            }
     
    347350                if ((i != x) && (j != y)) {
    348351                    pixels->data.F32[num] = image->data.F32[j][i];
    349                     mask->data.U8[num] = 0;
     352                    mask->data.PS_TYPE_VECTOR_MASK_DATA[num] = 0;
    350353                    num++;
    351354                } else {
    352                     mask->data.U8[num] = 1;
     355                    mask->data.PS_TYPE_VECTOR_MASK_DATA[num] = 1;
    353356                }
    354357            }
     
    473476    for (psS32 i = 0 ; i < image->numRows ; i++) {
    474477        for (psS32 j = 0 ; j < image->numCols ; j++) {
    475             imgF32->data.F32[i][j] = (psF32) image->data.U8[i][j];
     478            imgF32->data.F32[i][j] = (psF32) image->data.PS_TYPE_IMAGE_MASK_DATA[i][j];
    476479        }
    477480    }
     
    518521            PS_ASSERT_IMAGE_NON_NULL(tmpMask, NULL);
    519522            PS_ASSERT_IMAGE_NON_EMPTY(tmpMask, NULL);
    520             PS_ASSERT_IMAGE_TYPE(tmpMask, PS_TYPE_F32, NULL);
     523            PS_ASSERT_IMAGE_TYPE(tmpMask, PS_TYPE_F32, NULL); // XXX really F32??
    521524            PS_ASSERT_IMAGES_SIZE_EQUAL(tmpImage, tmpMask, NULL);
    522525        }
     
    571574
    572575        //
    573         // Create a psU8 mask image from the list of cosmic pixels.
     576        // Create a psImageMaskType mask image from the list of cosmic pixels.
    574577        //
    575578        psImage *maskImage = NULL;
  • branches/eam_branch_20081230/psModules/src/imcombine/pmStack.h

    r21072 r21079  
    88 * @author GLG, MHPCC
    99 *
    10  * @version $Revision: 1.9 $ $Name: not supported by cvs2svn $
    11  * @date $Date: 2008-11-01 02:59:33 $
     10 * @version $Revision: 1.9.8.1 $ $Name: not supported by cvs2svn $
     11 * @date $Date: 2009-01-02 05:13:00 $
    1212 *
    1313 * Copyright 2004-2007 Institute for Astronomy, University of Hawaii
     
    4343bool pmStackCombine(pmReadout *combined,///< Combined readout (output)
    4444                    psArray *input,     ///< Input array of pmStackData
    45                     psMaskType maskVal, ///< Mask value of bad pixels
    46                     psMaskType bad,     ///< Mask value to give rejected pixels
     45                    psImageMaskType maskVal, ///< Mask value of bad pixels
     46                    psImageMaskType bad,     ///< Mask value to give rejected pixels
    4747                    int kernelSize,     ///< Half-size of the convolution kernel
    4848                    int numIter,        ///< Number of iterations
  • branches/eam_branch_20081230/psModules/src/imcombine/pmSubtraction.h

    r20568 r21079  
    66 * @author GLG, MHPCC
    77 *
    8  * @version $Revision: 1.34 $ $Name: not supported by cvs2svn $
    9  * @date $Date: 2008-11-07 00:03:18 $
     8 * @version $Revision: 1.34.6.1 $ $Name: not supported by cvs2svn $
     9 * @date $Date: 2009-01-02 05:13:00 $
    1010 * Copyright 2004-207 Institute for Astronomy, University of Hawaii
    1111 */
     
    104104                           psImage *subMask, ///< Subtraction mask (or NULL)
    105105                           int stride,  ///< Size of convolution patches
    106                            psMaskType maskBad, ///< Mask value to give bad pixels
    107                            psMaskType maskPoor, ///< Mask value to give poor pixels
     106                           psImageMaskType maskBad, ///< Mask value to give bad pixels
     107                           psImageMaskType maskPoor, ///< Mask value to give poor pixels
    108108                           float poorFrac, ///< Fraction for "poor"
    109109                           float sysError, ///< Relative systematic error
  • branches/eam_branch_20081230/psModules/src/imcombine/pmSubtractionMask.h

    r21072 r21079  
    77psImage *pmSubtractionMask(const psImage *refMask, ///< Mask for the reference image (will be convolved)
    88                           const psImage *inMask, ///< Mask for the input image, or NULL
    9                            psMaskType maskVal, ///< Value to mask out
     9                           psImageMaskType maskVal, ///< Value to mask out
    1010                           int size, ///< Half-size of the kernel (pmSubtractionKernels.size)
    1111                           int footprint, ///< Half-size of the kernel footprint
     
    1919                         psImage *mask, ///< Mask (or NULL)
    2020                         int size,      ///< Kernel half-size
    21                          psMaskType blank ///< Mask value for blank regions
     21                         psImageMaskType blank ///< Mask value for blank regions
    2222    );
    2323
  • branches/eam_branch_20081230/psModules/src/imcombine/pmSubtractionMatch.h

    r20568 r21079  
    4040                        float rej,      ///< Rejection threshold
    4141                        float sysError, ///< Relative systematic error
    42                         psMaskType maskVal, ///< Value to mask for input
    43                         psMaskType maskBad, ///< Mask for output bad pixels
    44                         psMaskType maskPoor, ///< Mask for output poor pixels
     42                        psImageMaskType maskVal, ///< Value to mask for input
     43                        psImageMaskType maskBad, ///< Mask for output bad pixels
     44                        psImageMaskType maskPoor, ///< Mask for output poor pixels
    4545                        float poorFrac, ///< Fraction for "poor"
    4646                        float badFrac,   ///< Maximum fraction of bad input pixels to accept
  • branches/eam_branch_20081230/psModules/src/objects/pmModel.h

    r20945 r21079  
    55 * @author EAM, IfA
    66 *
    7  * @version $Revision: 1.17 $ $Name: not supported by cvs2svn $
    8  * @date $Date: 2008-12-09 21:16:09 $
     7 * @version $Revision: 1.17.4.1 $ $Name: not supported by cvs2svn $
     8 * @date $Date: 2009-01-02 05:13:00 $
    99 *
    1010 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    150150    pmModel *model,                     ///< The input pmModel
    151151    pmModelOpMode mode,                 ///< mode to control how the model is added into the image
    152     psMaskType maskVal                  ///< Value to mask
     152    psImageMaskType maskVal             ///< Value to mask
    153153);
    154154
     
    168168    pmModel *model,                     ///< The input pmModel
    169169    pmModelOpMode mode,                 ///< mode to control how the model is added into the image
    170     psMaskType maskVal                  ///< Value to mask
     170    psImageMaskType maskVal             ///< Value to mask
    171171);
    172172
     
    175175                          pmModel *model,
    176176                          pmModelOpMode mode,
    177                           psMaskType maskVal,
     177                          psImageMaskType maskVal,
    178178                          int dx,
    179179                          int dy);
     
    183183                          pmModel *model,
    184184                          pmModelOpMode mode,
    185                           psMaskType maskVal,
     185                          psImageMaskType maskVal,
    186186                          int dx,
    187187                          int dy);
  • branches/eam_branch_20081230/psModules/src/objects/pmPSF.h

    r20945 r21079  
    66 * @author EAM, IfA
    77 *
    8  * @version $Revision: 1.21 $ $Name: not supported by cvs2svn $
    9  * @date $Date: 2008-12-09 21:16:09 $
     8 * @version $Revision: 1.21.4.1 $ $Name: not supported by cvs2svn $
     9 * @date $Date: 2009-01-02 05:13:00 $
    1010 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii
    1111 */
     
    102102double pmPSF_SXYtoModel (psF32 *fittedPar);
    103103
    104 bool pmGrowthCurveGenerate (pmReadout *readout, pmPSF *psf, bool ignore, psMaskType maskVal, psMaskType mark);
     104bool pmGrowthCurveGenerate (pmReadout *readout, pmPSF *psf, bool ignore, psImageMaskType maskVal, psImageMaskType mark);
    105105pmPSF *pmPSFBuildSimple (char *typeName, float sxx, float syy, float sxy, ...);
    106106
  • branches/eam_branch_20081230/psModules/src/objects/pmPSFtry.c

    r21075 r21079  
    55 *  @author EAM, IfA
    66 *
    7  *  @version $Revision: 1.67.4.1 $ $Name: not supported by cvs2svn $
    8  *  @date $Date: 2008-12-31 20:31:29 $
     7 *  @version $Revision: 1.67.4.2 $ $Name: not supported by cvs2svn $
     8 *  @date $Date: 2009-01-02 05:13:00 $
    99 *
    1010 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    193193        // exclude the poor fits
    194194        if (!status) {
    195             psfTry->mask->data.PS_TYPE_IMAGE_MASK_DATA[i] = PSFTRY_MASK_EXT_FAIL;
     195            psfTry->mask->data.PS_TYPE_VECTOR_MASK_DATA[i] = PSFTRY_MASK_EXT_FAIL;
    196196            psTrace ("psModules.objects", 4, "masking %d (%d,%d) : status is poor\n", i, source->peak->x, source->peak->y);
    197197            continue;
     
    283283    psVector *flux  = psVectorAlloc (psfTry->sources->n, PS_TYPE_F32);
    284284    psVector *chisq = psVectorAlloc (psfTry->sources->n, PS_TYPE_F32);
    285     psVector *mask  = psVectorAlloc (psfTry->sources->n, PS_TYPE_MASK);
     285    psVector *mask  = psVectorAlloc (psfTry->sources->n, PS_TYPE_VECTOR_MASK);
    286286
    287287    // generate the x and y vectors, and mask missing models
     
    303303
    304304    // linear clipped fit of chisq trend vs flux
    305     bool result = psVectorClipFitPolynomial1D(psfTry->psf->ChiTrend, options->stats, mask,
    306                                               0xff, chisq, NULL, flux);
     305    bool result = psVectorClipFitPolynomial1D(psfTry->psf->ChiTrend, options->stats, mask, 0xff, chisq, NULL, flux);
    307306    psStatsOptions meanStat = psStatsMeanOption(options->stats->options); // Statistic for mean
    308307    psStatsOptions stdevStat = psStatsStdevOption(options->stats->options); // Statistic for stdev
  • branches/eam_branch_20081230/psModules/src/objects/pmPSFtry.h

    r20078 r21079  
    66 * @author EAM, IfA
    77 *
    8  * @version $Revision: 1.20 $ $Name: not supported by cvs2svn $
    9  * @date $Date: 2008-10-13 02:00:25 $
     8 * @version $Revision: 1.20.10.1 $ $Name: not supported by cvs2svn $
     9 * @date $Date: 2009-01-02 05:13:00 $
    1010 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii
    1111 */
     
    4848    pmPSF      *psf;                    ///< Add comment.
    4949    psArray    *sources;                ///< pointers to the original sources
    50     psVector   *mask;                   ///< Add comment.
     50    psVector   *mask;                   ///< PS_TYPE_VECTOR_MASK to flag good and bad sources
    5151    psVector   *metric;                 ///< Add comment.
    5252    psVector   *metricErr;              ///< Add comment.
     
    8989 *
    9090 */
    91 pmPSFtry *pmPSFtryModel (const psArray *sources, const char *modelName, pmPSFOptions *options, psMaskType maskVal, psMaskType mark);
     91pmPSFtry *pmPSFtryModel (const psArray *sources, const char *modelName, pmPSFOptions *options, psImageMaskType maskVal, psImageMaskType mark);
    9292
    9393/** pmPSFtryMetric()
  • branches/eam_branch_20081230/psModules/src/objects/pmResiduals.c

    r15562 r21079  
    44 *
    55 * @author EAM, IfA
    6  * @version $Revision: 1.3 $ $Name: not supported by cvs2svn $
    7  * @date $Date: 2007-11-10 01:09:20 $
     6 * @version $Revision: 1.3.52.1 $ $Name: not supported by cvs2svn $
     7 * @date $Date: 2009-01-02 05:13:00 $
    88 * Copyright 2004 IfA, University of Hawaii
    99 */
     
    4444    resid->weight = psImageAlloc (nX, nY, PS_TYPE_F32);
    4545    resid->mask   = psImageAlloc (nX, nY, PS_TYPE_U8);
     46    // NOTE : the residual mask is internal only : 1 byte is sufficient
     47    // XXX abstract the resid->mask type??
    4648
    4749    resid->xBin = xBin;
  • branches/eam_branch_20081230/psModules/src/objects/pmSource.h

    r20945 r21079  
    33 * @author EAM, IfA; GLG, MHPCC
    44 *
    5  * @version $Revision: 1.26 $ $Name: not supported by cvs2svn $
    6  * @date $Date: 2008-12-09 21:16:09 $
     5 * @version $Revision: 1.26.4.1 $ $Name: not supported by cvs2svn $
     6 * @date $Date: 2009-01-02 05:13:00 $
    77 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii
    88 */
     
    210210    psMetadata *metadata,               ///< Contains classification parameters
    211211    pmPSFClump clump,                   ///< Statistics about the PSF clump
    212     psMaskType maskSat                  ///< Mask value for saturated pixels
     212    psImageMaskType maskSat             ///< Mask value for saturated pixels
    213213);
    214214
     
    231231pmModel *pmSourceGetModel (bool *isPSF, const pmSource *source);
    232232
    233 bool pmSourceAdd (pmSource *source, pmModelOpMode mode, psMaskType maskVal);
    234 bool pmSourceSub (pmSource *source, pmModelOpMode mode, psMaskType maskVal);
    235 bool pmSourceAddWithOffset (pmSource *source, pmModelOpMode mode, psMaskType maskVal, int dx, int dy);
    236 bool pmSourceSubWithOffset (pmSource *source, pmModelOpMode mode, psMaskType maskVal, int dx, int dy);
    237 
    238 bool pmSourceOp (pmSource *source, pmModelOpMode mode, bool add, psMaskType maskVal, int dx, int dy);
    239 bool pmSourceCacheModel (pmSource *source, psMaskType maskVal);
    240 bool pmSourceCachePSF (pmSource *source, psMaskType maskVal);
     233bool pmSourceAdd (pmSource *source, pmModelOpMode mode, psImageMaskType maskVal);
     234bool pmSourceSub (pmSource *source, pmModelOpMode mode, psImageMaskType maskVal);
     235bool pmSourceAddWithOffset (pmSource *source, pmModelOpMode mode, psImageMaskType maskVal, int dx, int dy);
     236bool pmSourceSubWithOffset (pmSource *source, pmModelOpMode mode, psImageMaskType maskVal, int dx, int dy);
     237
     238bool pmSourceOp (pmSource *source, pmModelOpMode mode, bool add, psImageMaskType maskVal, int dx, int dy);
     239bool pmSourceCacheModel (pmSource *source, psImageMaskType maskVal);
     240bool pmSourceCachePSF (pmSource *source, psImageMaskType maskVal);
    241241
    242242int             pmSourceSortBySN (const void **a, const void **b);
  • branches/eam_branch_20081230/psModules/src/objects/pmSourceFitModel.c

    r21075 r21079  
    66 *  @author GLG, MHPCC
    77 *
    8  *  @version $Revision: 1.28.4.1 $ $Name: not supported by cvs2svn $
    9  *  @date $Date: 2008-12-31 20:31:29 $
     8 *  @version $Revision: 1.28.4.2 $ $Name: not supported by cvs2svn $
     9 *  @date $Date: 2009-01-02 05:13:00 $
    1010 *
    1111 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    121121    // create the minimization constraints
    122122    psMinConstraint *constraint = psMinConstraintAlloc();
    123     constraint->paramMask = psVectorAlloc (params->n, PS_TYPE_VECTOR_MASK_DATA);
     123    constraint->paramMask = psVectorAlloc (params->n, PS_TYPE_VECTOR_MASK);
    124124    constraint->checkLimits = model->modelLimits;
    125125
  • branches/eam_branch_20081230/psModules/src/objects/pmSourceFitModel.h

    r13898 r21079  
    33 * @author EAM, IfA; GLG, MHPCC
    44 *
    5  * @version $Revision: 1.6 $ $Name: not supported by cvs2svn $
    6  * @date $Date: 2007-06-20 02:22:26 $
     5 * @version $Revision: 1.6.66.1 $ $Name: not supported by cvs2svn $
     6 * @date $Date: 2009-01-02 05:13:00 $
    77 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii
    88 */
     
    4141    pmModel *model,   ///< model to be fitted
    4242    pmSourceFitMode mode,  ///< define parameters to be fitted
    43     psMaskType maskVal                  ///< Value to mask
     43    psImageMaskType maskVal             ///< Value to mask
    4444);
    4545
     
    7171    psArray *modelSet,   ///< model to be fitted
    7272    pmSourceFitMode mode,  ///< define parameters to be fitted
    73     psMaskType maskVal                  ///< Vale to mask
     73    psImageMaskType maskVal             ///< Vale to mask
    7474
    7575);
  • branches/eam_branch_20081230/psModules/src/objects/pmSourceFitSet.h

    r15562 r21079  
    33 * @author EAM, IfA; GLG, MHPCC
    44 *
    5  * @version $Revision: 1.6 $ $Name: not supported by cvs2svn $
    6  * @date $Date: 2007-11-10 01:09:20 $
     5 * @version $Revision: 1.6.52.1 $ $Name: not supported by cvs2svn $
     6 * @date $Date: 2009-01-02 05:13:00 $
    77 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii
    88 */
     
    4444 */
    4545bool pmSourceFitSet(
    46     pmSource *source,   ///< The input pmSource
    47     psArray *modelSet,   ///< model to be fitted
    48     pmSourceFitMode mode,  ///< define parameters to be fitted
    49     psMaskType maskVal                  ///< Vale to mask
     46    pmSource *source,                   ///< The input pmSource
     47    psArray *modelSet,                  ///< model to be fitted
     48    pmSourceFitMode mode,               ///< define parameters to be fitted
     49    psImageMaskType maskVal             ///< Vale to mask
    5050
    5151);
  • branches/eam_branch_20081230/psModules/src/objects/pmSourceMatch.c

    r20963 r21079  
    122122    match->image = psVectorAllocEmpty(num, PS_TYPE_U32);
    123123    match->index = psVectorAllocEmpty(num, PS_TYPE_U32);
    124     match->mask = psVectorAllocEmpty(num, PS_TYPE_MASK);
     124    match->mask = psVectorAllocEmpty(num, PS_TYPE_VECTOR_MASK);
    125125
    126126    return match;
     
    143143    match->image->data.S32[num] = image;
    144144    match->index->data.S32[num] = index;
    145     match->index->data.PS_TYPE_MASK_DATA[num] = 0;
     145    match->index->data.PS_TYPE_VECTOR_MASK_DATA[num] = 0; // XXXX EAM : I think this should be match->mask not match->index
    146146    match->num++;
    147147
     
    316316        double star = 0.0, starErr = 0.0; // Accumulators for star
    317317        for (int j = 0; j < match->num; j++) {
    318             if (match->mask->data.PS_TYPE_MASK_DATA[j]) {
     318            if (match->mask->data.PS_TYPE_VECTOR_MASK_DATA[j]) {
    319319                continue;
    320320            }
     
    347347        pmSourceMatch *match = matches->data[i]; // Matched stars
    348348        for (int j = 0; j < match->num; j++) {
    349             if (match->mask->data.PS_TYPE_MASK_DATA[j]) {
     349            if (match->mask->data.PS_TYPE_VECTOR_MASK_DATA[j]) {
    350350                continue;
    351351            }
     
    373373        pmSourceMatch *match = matches->data[i]; // Matched stars
    374374        for (int j = 0; j < match->num; j++) {
    375             if (match->mask->data.PS_TYPE_MASK_DATA[j]) {
     375            if (match->mask->data.PS_TYPE_VECTOR_MASK_DATA[j]) {
    376376                continue;
    377377            }
     
    474474        pmSourceMatch *match = matches->data[i]; // Matched stars
    475475        for (int j = 0; j < match->num; j++) {
    476             if (match->mask->data.PS_TYPE_MASK_DATA[j]) {
     476            if (match->mask->data.PS_TYPE_VECTOR_MASK_DATA[j]) {
    477477                continue;
    478478            }
     
    488488            if (PS_SQR(dev) > starClip * (PS_SQR(magErr) + sysErr2)) {
    489489                numRejected++;
    490                 match->mask->data.PS_TYPE_MASK_DATA[j] = 0xFF;
     490                match->mask->data.PS_TYPE_VECTOR_MASK_DATA[j] = 0xFF;
    491491            }
    492492        }
  • branches/eam_branch_20081230/psModules/src/objects/pmSourceMoments.c

    r20937 r21079  
    66 *  @author EAM, IfA: significant modifications.
    77 *
    8  *  @version $Revision: 1.6 $ $Name: not supported by cvs2svn $
    9  *  @date $Date: 2008-12-08 02:51:14 $
     8 *  @version $Revision: 1.6.4.1 $ $Name: not supported by cvs2svn $
     9 *  @date $Date: 2009-01-02 05:13:00 $
    1010 *
    1111 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    100100        psF32 *vPix = source->pixels->data.F32[row];
    101101        psF32 *vWgt = source->weight->data.F32[row];
    102         psU8  *vMsk = (source->maskObj == NULL) ? NULL : source->maskObj->data.U8[row];
     102        psImageMaskType *vMsk = (source->maskObj == NULL) ? NULL : source->maskObj->data.PS_TYPE_IMAGE_MASK_DATA[row];
    103103
    104104        for (psS32 col = 0; col < source->pixels->numCols ; col++, vPix++, vWgt++) {
     
    190190        psF32 *vPix = source->pixels->data.F32[row];
    191191        psF32 *vWgt = source->weight->data.F32[row];
    192         psU8  *vMsk = (source->maskObj == NULL) ? NULL : source->maskObj->data.U8[row];
     192        psImageMaskType  *vMsk = (source->maskObj == NULL) ? NULL : source->maskObj->data.PS_TYPE_IMAGE_MASK_DATA[row];
    193193
    194194        for (psS32 col = 0; col < source->pixels->numCols ; col++, vPix++, vWgt++) {
     
    342342        psF32 *vPix = source->pixels->data.F32[row];
    343343        psF32 *vWgt = source->weight->data.F32[row];
    344         psU8  *vMsk = (source->maskObj == NULL) ? NULL : source->maskObj->data.U8[row];
     344        psImageMaskType  *vMsk = (source->maskObj == NULL) ? NULL : source->maskObj->data.PS_TYPE_IMAGE_MASK_DATA[row];
    345345
    346346        for (psS32 col = 0; col < source->pixels->numCols ; col++, vPix++, vWgt++) {
  • branches/eam_branch_20081230/psModules/src/objects/pmSourcePhotometry.h

    r21072 r21079  
    44 * @author EAM, IfA; GLG, MHPCC
    55 *
    6  * @version $Revision: 1.11 $ $Name: not supported by cvs2svn $
    7  * @date $Date: 2008-07-15 20:25:00 $
     6 * @version $Revision: 1.11.32.1 $ $Name: not supported by cvs2svn $
     7 * @date $Date: 2009-01-02 05:13:00 $
    88 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii
    99 */
     
    4646    psImage *image,                     ///< image pixels to be used
    4747    psImage *mask,                      ///< mask of pixels to ignore
    48     psMaskType maskVal                  ///< Value to mask
     48    psImageMaskType maskVal             ///< Value to mask
    4949);
    5050
    5151bool pmSourceMagnitudesInit (psMetadata *config);
    52 bool pmSourceMagnitudes (pmSource *source, pmPSF *psf, pmSourcePhotometryMode mode, psMaskType maskVal);
    53 bool pmSourcePixelWeight (float *pixWeight, pmModel *model, psImage *image, psImage *mask, psMaskType maskVal);
    54 bool pmSourceChisq (pmModel *model, psImage *image, psImage *mask, psImage *weight, psMaskType maskVal);
     52bool pmSourceMagnitudes (pmSource *source, pmPSF *psf, pmSourcePhotometryMode mode, psImageMaskType maskVal);
     53bool pmSourcePixelWeight (float *pixWeight, pmModel *model, psImage *image, psImage *mask, psImageMaskType maskVal);
     54bool pmSourceChisq (pmModel *model, psImage *image, psImage *mask, psImage *weight, psImageMaskType maskVal);
    5555
    5656
  • branches/eam_branch_20081230/psModules/src/objects/pmSourceSky.h

    r13898 r21079  
    22 * @author EAM, IfA; GLG, MHPCC
    33 *
    4  * @version $Revision: 1.4 $ $Name: not supported by cvs2svn $
    5  * @date $Date: 2007-06-20 02:22:26 $
     4 * @version $Revision: 1.4.66.1 $ $Name: not supported by cvs2svn $
     5 * @date $Date: 2009-01-02 05:13:00 $
    66 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii
    77 */
     
    3030    psStatsOptions statsOptions, ///< The statistic used in calculating the background sky
    3131    float Radius,   ///< The inner radius of the square annulus to exclude
    32     psMaskType maskVal,                 ///< Value to mask
    33     psMaskType mark                     ///< Mask value for marking
     32    psImageMaskType maskVal,                 ///< Value to mask
     33    psImageMaskType mark                     ///< Mask value for marking
    3434);
    3535
     
    4040    psStatsOptions statsOptions, ///< The statistic used in calculating the background sky
    4141    float Radius,   ///< The inner radius of the square annulus to exclude
    42     psMaskType maskVal,                 ///< Value to mask
    43     psMaskType mark                     ///< Mask value for marking
     42    psImageMaskType maskVal,                 ///< Value to mask
     43    psImageMaskType mark                     ///< Mask value for marking
    4444);
    4545
  • branches/eam_branch_20081230/psModules/src/objects/pmSourceVisual.c

    r21072 r21079  
    5757        model->data.F32[i] = pmTrend2DEval (trend, x->data.F32[i], y->data.F32[i]);
    5858        resid->data.F32[i] = param->data.F32[i] - model->data.F32[i];
    59         if (mask->data.U8[i]) continue;
     59        if (mask->data.PS_TYPE_VECTOR_MASK_DATA[i]) continue;
    6060        min = PS_MIN (min, resid->data.F32[i]);
    6161        max = PS_MAX (max, resid->data.F32[i]);
  • branches/eam_branch_20081230/psModules/src/objects/pmTrend2D.h

    r19961 r21079  
    55 * @author EAM, IfA
    66 *
    7  * @version $Revision: 1.7 $ $Name: not supported by cvs2svn $
    8  * @date $Date: 2008-10-07 22:47:04 $
     7 * @version $Revision: 1.7.14.1 $ $Name: not supported by cvs2svn $
     8 * @date $Date: 2009-01-02 05:13:00 $
    99 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii
    1010 */
     
    8080bool pmTrend2DFit(pmTrend2D *trend,
    8181                  psVector *mask,       // Warning: mask is modified!
    82                   psMaskType maskVal,
     82                  psVectorMaskType maskVal,
    8383                  const psVector *x,
    8484                  const psVector *y,
Note: See TracChangeset for help on using the changeset viewer.