IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jan 26, 2009, 8:40:07 PM (17 years ago)
Author:
eugene
Message:

incorporating changes from 16bit mask upgrades (eam_branch_20081230)

Location:
trunk/psModules/src/objects
Files:
26 edited

Legend:

Unmodified
Added
Removed
  • trunk/psModules/src/objects/pmFootprintArrayGrow.c

    r20937 r21183  
    33 * @author RHL, Princeton & IfA; EAM, IfA
    44 *
    5  * @version $Revision: 1.11 $ $Name: not supported by cvs2svn $
    6  * @date $Date: 2008-12-08 02:51:14 $
     5 * @version $Revision: 1.12 $ $Name: not supported by cvs2svn $
     6 * @date $Date: 2009-01-27 06:39:38 $
    77 * Copyright 2006 Institute for Astronomy, University of Hawaii
    88 */
     
    4545    // Use a separable convolution: should be faster
    4646    idImage = (psImage*)psBinaryOp(idImage, idImage, "MIN", psScalarAlloc(1, PS_TYPE_S32));
    47     psImage *idImageMask = psImageCopy(NULL, idImage, PS_TYPE_MASK); // Image with 1 = object
     47    psImage *idImageMask = psImageCopy(NULL, idImage, PS_TYPE_IMAGE_MASK); // Image with 1 = object
    4848    psImage *grownIdImage = psImageConvolveMask(NULL, idImageMask, 0x01, 0x01, -r, r, -r, r); // Grown mask
    4949    if (!grownIdImage) {
  • trunk/psModules/src/objects/pmFootprintFindAtPoint.c

    r20937 r21183  
    44 * @author RHL, Princeton & IfA; EAM, IfA
    55 *
    6  * @version $Revision: 1.3 $ $Name: not supported by cvs2svn $
    7  * @date $Date: 2008-12-08 02:51:14 $
     6 * @version $Revision: 1.4 $ $Name: not supported by cvs2svn $
     7 * @date $Date: 2009-01-27 06:39:38 $
    88 * Copyright 2006 Institute for Astronomy, University of Hawaii
    99 */
     
    7777   
    7878    if (mask != NULL) {                 // remember that we've detected these pixels
    79         psMaskType *mpix = &mask->data.PS_TYPE_MASK_DATA[span->y - mask->row0][span->x0 - mask->col0];
     79        psImageMaskType *mpix = &mask->data.PS_TYPE_IMAGE_MASK_DATA[span->y - mask->row0][span->x0 - mask->col0];
    8080
    8181        for (int i = 0; i <= span->x1 - span->x0; i++) {
     
    143143    psF32 *imgRowF32 = NULL;            // row pointer if F32
    144144    psS32 *imgRowS32 = NULL;            //  "   "   "  "  !F32
    145     psMaskType *maskRow = NULL;         //  masks's row pointer
     145    psImageMaskType *maskRow = NULL;            //  masks's row pointer
    146146   
    147147    const int row0 = img->row0;
     
    186186        imgRowF32 = img->data.F32[i];   // only one of
    187187        imgRowS32 = img->data.S32[i];   //      these is valid!
    188         maskRow = mask->data.PS_TYPE_MASK_DATA[i];
     188        maskRow = mask->data.PS_TYPE_IMAGE_MASK_DATA[i];
    189189        //
    190190        // Search left from the pixel diagonally to the left of (i - di, x0). If there's
     
    354354 * looking for the rest of the pmFootprint.  These are generally set from peaks.
    355355 */
    356    psImage *mask = psImageAlloc(numCols, numRows, PS_TYPE_MASK);
     356   psImage *mask = psImageAlloc(numCols, numRows, PS_TYPE_IMAGE_MASK);
    357357   P_PSIMAGE_SET_ROW0(mask, row0);
    358358   P_PSIMAGE_SET_COL0(mask, col0);
     
    365365       for (int i = 0; i < peaks->n; i++) {
    366366           pmPeak *peak = peaks->data[i];
    367            mask->data.PS_TYPE_MASK_DATA[peak->y - mask->row0][peak->x - mask->col0] |= PM_SSPAN_STOP;
     367           mask->data.PS_TYPE_IMAGE_MASK_DATA[peak->y - mask->row0][peak->x - mask->col0] |= PM_SSPAN_STOP;
    368368       }
    369369   }
     
    375375   imgRowF32 = img->data.F32[row];      // only one of
    376376   imgRowS32 = img->data.S32[row];      //      these is valid!
    377    psMaskType *maskRow = mask->data.PS_TYPE_MASK_DATA[row];
     377   psImageMaskType *maskRow = mask->data.PS_TYPE_IMAGE_MASK_DATA[row];
    378378   {
    379379       int i;
  • trunk/psModules/src/objects/pmGrowthCurveGenerate.c

    r20937 r21183  
    55 *  @author EAM, IfA
    66 *
    7  *  @version $Revision: 1.4 $ $Name: not supported by cvs2svn $
    8  *  @date $Date: 2008-12-08 02:51:14 $
     7 *  @version $Revision: 1.5 $ $Name: not supported by cvs2svn $
     8 *  @date $Date: 2009-01-27 06:39:38 $
    99 *
    1010 *  Copyright 2004 Institute for Astronomy, University of Hawaii
     
    4141#include "pmErrorCodes.h"
    4242
    43 pmGrowthCurve *pmGrowthCurveForPosition (psImage *image, pmPSF *psf, bool ignore, psMaskType maskVal, psMaskType markVal, float xc, float yc);
     43pmGrowthCurve *pmGrowthCurveForPosition (psImage *image, pmPSF *psf, bool ignore, psImageMaskType maskVal, psImageMaskType markVal, float xc, float yc);
    4444
    4545/*****************************************************************************/
     
    4848
    4949// we generate the growth curve for the center of the image with the specified psf model
    50 bool pmGrowthCurveGenerate (pmReadout *readout, pmPSF *psf, bool ignore, psMaskType maskVal, psMaskType markVal)
     50bool pmGrowthCurveGenerate (pmReadout *readout, pmPSF *psf, bool ignore, psImageMaskType maskVal, psImageMaskType markVal)
    5151{
    5252    PS_ASSERT_PTR_NON_NULL(readout, false);
     
    119119}
    120120
    121 pmGrowthCurve *pmGrowthCurveForPosition (psImage *image, pmPSF *psf, bool ignore, psMaskType maskVal, psMaskType markVal, float xc, float yc) {
     121pmGrowthCurve *pmGrowthCurveForPosition (psImage *image, pmPSF *psf, bool ignore, psImageMaskType maskVal, psImageMaskType markVal, float xc, float yc) {
    122122
    123123    float fitMag, apMag;
     
    162162    psImage *view = psImageSubset (image, region);
    163163    psImage *pixels = psImageCopy (NULL, view, PS_TYPE_F32);
    164     psImage *mask = psImageCopy (NULL, view, PS_TYPE_U8);
     164    psImage *mask = psImageCopy (NULL, view, PS_TYPE_IMAGE_MASK);
    165165
    166166    psImageInit (pixels, 0.0);
     
    189189            return NULL;
    190190        }
    191         psImageKeepCircle (mask, xc, yc, radius, "AND", PS_NOT_U8(markVal));
     191        psImageKeepCircle (mask, xc, yc, radius, "AND", PS_NOT_IMAGE_MASK(markVal));
    192192
    193193        // the 'ignore' mode is for testing
  • trunk/psModules/src/objects/pmModel.c

    r20592 r21183  
    66 *  @author EAM, IfA
    77 *
    8  *  @version $Revision: 1.25 $ $Name: not supported by cvs2svn $
    9  *  @date $Date: 2008-11-09 00:28:18 $
     8 *  @version $Revision: 1.26 $ $Name: not supported by cvs2svn $
     9 *  @date $Date: 2009-01-27 06:39:38 $
    1010 *
    1111 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    172172                          pmModelOpMode mode,
    173173                          bool add,
    174                           psMaskType maskVal,
     174                          psImageMaskType maskVal,
    175175                          int dx,
    176176                          int dy
     
    229229    psF32 **Rx = NULL;
    230230    psF32 **Ry = NULL;
    231     psU8 **Rm = NULL;
     231    psImageMaskType **Rm = NULL;
    232232
    233233    if (model->residuals) {
     
    237237        Rx = (model->residuals->Rx)   ? model->residuals->Rx->data.F32 : NULL;
    238238        Ry = (model->residuals->Ry)   ? model->residuals->Ry->data.F32 : NULL;
    239         Rm = (model->residuals->mask) ? model->residuals->mask->data.U8 : NULL;
     239        Rm = (model->residuals->mask) ? model->residuals->mask->data.PS_TYPE_IMAGE_MASK_DATA : NULL;
    240240        if (Ro) {
    241241            NX = model->residuals->Ro->numCols;
     
    249249    for (psS32 iy = 0; iy < image->numRows; iy++) {
    250250        for (psS32 ix = 0; ix < image->numCols; ix++) {
    251             if ((mask != NULL) && (mask->data.U8[iy][ix] & maskVal))
     251            if ((mask != NULL) && (mask->data.PS_TYPE_IMAGE_MASK_DATA[iy][ix] & maskVal))
    252252                continue;
    253253
     
    351351                pmModel *model,
    352352                pmModelOpMode mode,
    353                 psMaskType maskVal)
     353                psImageMaskType maskVal)
    354354{
    355355    psTrace("psModules.objects", 3, "---- %s() begin ----\n", __func__);
     
    365365                pmModel *model,
    366366                pmModelOpMode mode,
    367                 psMaskType maskVal)
     367                psImageMaskType maskVal)
    368368{
    369369    psTrace("psModules.objects", 3, "---- %s() begin ----\n", __func__);
     
    379379                          pmModel *model,
    380380                          pmModelOpMode mode,
    381                           psMaskType maskVal,
     381                          psImageMaskType maskVal,
    382382                          int dx,
    383383                          int dy)
     
    395395                          pmModel *model,
    396396                          pmModelOpMode mode,
    397                           psMaskType maskVal,
     397                          psImageMaskType maskVal,
    398398                          int dx,
    399399                          int dy)
  • trunk/psModules/src/objects/pmModel.h

    r20945 r21183  
    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.18 $ $Name: not supported by cvs2svn $
     8 * @date $Date: 2009-01-27 06:39:38 $
    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);
  • trunk/psModules/src/objects/pmPSF.h

    r20945 r21183  
    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.22 $ $Name: not supported by cvs2svn $
     9 * @date $Date: 2009-01-27 06:39:38 $
    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
  • trunk/psModules/src/objects/pmPSF_IO.c

    r20937 r21183  
    66 *  @author EAM, IfA
    77 *
    8  *  @version $Revision: 1.36 $ $Name: not supported by cvs2svn $
    9  *  @date $Date: 2008-12-08 02:51:14 $
     8 *  @version $Revision: 1.37 $ $Name: not supported by cvs2svn $
     9 *  @date $Date: 2009-01-27 06:39:38 $
    1010 *
    1111 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    871871            psFitsReadImageBuffer(psf->residuals->Ry, file->fits, fullImage, 2); // Desired pixels
    872872        }
     873        // XXX notice that we are not saving the resid->mask
    873874    }
    874875
  • trunk/psModules/src/objects/pmPSFtry.c

    r21173 r21183  
    55 *  @author EAM, IfA
    66 *
    7  *  @version $Revision: 1.68 $ $Name: not supported by cvs2svn $
    8  *  @date $Date: 2009-01-27 00:01:33 $
    9  *
     7 *  @version $Revision: 1.69 $ $Name: not supported by cvs2svn $
     8 *  @date $Date: 2009-01-27 06:39:38 $
    109 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
    1110 *
     
    115114    test->metricErr = psVectorAlloc (sources->n, PS_TYPE_F32);
    116115    test->fitMag    = psVectorAlloc (sources->n, PS_TYPE_F32);
    117     test->mask      = psVectorAlloc (sources->n, PS_TYPE_U8);
     116    test->mask      = psVectorAlloc (sources->n, PS_TYPE_VECTOR_MASK);
    118117
    119118    psVectorInit (test->mask,        0);
     
    148147
    149148// generate a pmPSFtry with a copy of the test PSF sources
    150 pmPSFtry *pmPSFtryModel (const psArray *sources, const char *modelName, pmPSFOptions *options, psMaskType maskVal, psMaskType markVal)
     149pmPSFtry *pmPSFtryModel (const psArray *sources, const char *modelName, pmPSFOptions *options, psImageMaskType maskVal, psImageMaskType markVal)
    151150{
    152151    bool status;
     
    176175        pmSource *source = psfTry->sources->data[i];
    177176        if (!source->moments) {
    178             psfTry->mask->data.U8[i] = PSFTRY_MASK_EXT_FAIL;
     177            psfTry->mask->data.PS_TYPE_VECTOR_MASK_DATA[i] = PSFTRY_MASK_EXT_FAIL;
    179178            continue;
    180179        }
    181180        if (!source->moments->nPixels) {
    182             psfTry->mask->data.U8[i] = PSFTRY_MASK_EXT_FAIL;
     181            psfTry->mask->data.PS_TYPE_VECTOR_MASK_DATA[i] = PSFTRY_MASK_EXT_FAIL;
    183182            continue;
    184183        }
     
    186185        source->modelEXT = pmSourceModelGuess (source, psfTry->psf->type);
    187186        if (source->modelEXT == NULL) {
    188             psfTry->mask->data.U8[i] = PSFTRY_MASK_EXT_FAIL;
     187            psfTry->mask->data.PS_TYPE_VECTOR_MASK_DATA[i] = PSFTRY_MASK_EXT_FAIL;
    189188            psTrace ("psModules.objects", 4, "masking %d (%d,%d) : failed to generate model guess\n", i, source->peak->x, source->peak->y);
    190189            continue;
     
    198197
    199198        // clear object mask to define valid pixels
    200         psImageKeepCircle (source->maskObj, source->peak->x, source->peak->y, options->radius, "AND", PS_NOT_U8(markVal));
     199        psImageKeepCircle (source->maskObj, source->peak->x, source->peak->y, options->radius, "AND", PS_NOT_IMAGE_MASK(markVal));
    201200
    202201        // exclude the poor fits
    203202        if (!status) {
    204             psfTry->mask->data.U8[i] = PSFTRY_MASK_EXT_FAIL;
     203            psfTry->mask->data.PS_TYPE_VECTOR_MASK_DATA[i] = PSFTRY_MASK_EXT_FAIL;
    205204            psTrace ("psModules.objects", 4, "masking %d (%d,%d) : status is poor\n", i, source->peak->x, source->peak->y);
    206205            continue;
     
    231230
    232231        // masked for: bad model fit, outlier in parameters
    233         if (psfTry->mask->data.U8[i] & PSFTRY_MASK_ALL) {
     232        if (psfTry->mask->data.PS_TYPE_VECTOR_MASK_DATA[i] & PSFTRY_MASK_ALL) {
    234233            psTrace ("psModules.objects", 4, "dropping %d (%d,%d) : source is masked\n", i, source->peak->x, source->peak->y);
    235234            continue;
     
    239238        source->modelPSF = pmModelFromPSF (source->modelEXT, psfTry->psf);
    240239        if (source->modelPSF == NULL) {
    241             psfTry->mask->data.U8[i] = PSFTRY_MASK_BAD_MODEL;
     240            psfTry->mask->data.PS_TYPE_VECTOR_MASK_DATA[i] = PSFTRY_MASK_BAD_MODEL;
    242241            abort();
    243242            continue;
     
    253252        // skip poor fits
    254253        if (!status) {
    255             psImageKeepCircle (source->maskObj, source->peak->x, source->peak->y, options->radius, "AND", PS_NOT_U8(markVal));
    256             psfTry->mask->data.U8[i] = PSFTRY_MASK_PSF_FAIL;
     254            psImageKeepCircle (source->maskObj, source->peak->x, source->peak->y, options->radius, "AND", PS_NOT_IMAGE_MASK(markVal));
     255            psfTry->mask->data.PS_TYPE_VECTOR_MASK_DATA[i] = PSFTRY_MASK_PSF_FAIL;
    257256            psTrace ("psModules.objects", 4, "dropping %d (%d,%d) : failed PSF fit\n", i, source->peak->x, source->peak->y);
    258257            continue;
     
    261260        status = pmSourceMagnitudes (source, psfTry->psf, PM_SOURCE_PHOT_INTERP, maskVal);
    262261        if (!status || isnan(source->apMag)) {
    263             psImageKeepCircle (source->maskObj, source->peak->x, source->peak->y, options->radius, "AND", PS_NOT_U8(markVal));
    264             psfTry->mask->data.U8[i] = PSFTRY_MASK_BAD_PHOT;
     262            psImageKeepCircle (source->maskObj, source->peak->x, source->peak->y, options->radius, "AND", PS_NOT_IMAGE_MASK(markVal));
     263            psfTry->mask->data.PS_TYPE_VECTOR_MASK_DATA[i] = PSFTRY_MASK_BAD_PHOT;
    265264            psTrace ("psModules.objects", 4, "dropping %d (%d,%d) : poor photometry\n", i, source->peak->x, source->peak->y);
    266265            continue;
     
    268267
    269268        // clear object mask to define valid pixels
    270         psImageKeepCircle (source->maskObj, source->peak->x, source->peak->y, options->radius, "AND", PS_NOT_U8(markVal));
     269        psImageKeepCircle (source->maskObj, source->peak->x, source->peak->y, options->radius, "AND", PS_NOT_IMAGE_MASK(markVal));
    271270
    272271        psfTry->fitMag->data.F32[i] = source->psfMag;
     
    292291    psVector *flux  = psVectorAlloc (psfTry->sources->n, PS_TYPE_F32);
    293292    psVector *chisq = psVectorAlloc (psfTry->sources->n, PS_TYPE_F32);
    294     psVector *mask  = psVectorAlloc (psfTry->sources->n, PS_TYPE_MASK);
     293    psVector *mask  = psVectorAlloc (psfTry->sources->n, PS_TYPE_VECTOR_MASK);
    295294
    296295    // generate the x and y vectors, and mask missing models
     
    300299            flux->data.F32[i] = 0.0;
    301300            chisq->data.F32[i] = 0.0;
    302             mask->data.U8[i] = 0xff;
     301            mask->data.PS_TYPE_VECTOR_MASK_DATA[i] = 0xff;
    303302        } else {
    304303            flux->data.F32[i] = source->modelPSF->params->data.F32[PM_PAR_I0];
    305304            chisq->data.F32[i] = source->modelPSF->chisq / source->modelPSF->nDOF;
    306             mask->data.U8[i] = 0;
     305            mask->data.PS_TYPE_VECTOR_MASK_DATA[i] = 0;
    307306        }
    308307    }
     
    312311
    313312    // linear clipped fit of chisq trend vs flux
    314     bool result = psVectorClipFitPolynomial1D(psfTry->psf->ChiTrend, options->stats, mask,
    315                                               0xff, chisq, NULL, flux);
     313    bool result = psVectorClipFitPolynomial1D(psfTry->psf->ChiTrend, options->stats, mask, 0xff, chisq, NULL, flux);
    316314    psStatsOptions meanStat = psStatsMeanOption(options->stats->options); // Statistic for mean
    317315    psStatsOptions stdevStat = psStatsStdevOption(options->stats->options); // Statistic for stdev
     
    370368
    371369    for (int i = 0; i < psfTry->sources->n; i++) {
    372         if (psfTry->mask->data.U8[i] & PSFTRY_MASK_ALL)
     370        if (psfTry->mask->data.PS_TYPE_VECTOR_MASK_DATA[i] & PSFTRY_MASK_ALL)
    373371            continue;
    374372        r2rflux->data.F32[i] = PS_SQR(RADIUS) * pow(10.0, 0.4*psfTry->fitMag->data.F32[i]);
     
    379377        FILE *f = fopen ("apresid.dat", "w");
    380378        for (int i = 0; i < psfTry->sources->n; i++) {
    381             int keep = (psfTry->mask->data.U8[i] & PSFTRY_MASK_ALL);
     379            int keep = (psfTry->mask->data.PS_TYPE_VECTOR_MASK_DATA[i] & PSFTRY_MASK_ALL);
    382380
    383381            pmSource *source = psfTry->sources->data[i];
     
    427425        psVector *apfit = psPolynomial1DEvalVector (poly, r2rflux);
    428426        for (int i = 0; i < psfTry->sources->n; i++) {
    429             int keep = (psfTry->mask->data.U8[i] & PSFTRY_MASK_ALL);
     427            int keep = (psfTry->mask->data.PS_TYPE_VECTOR_MASK_DATA[i] & PSFTRY_MASK_ALL);
    430428
    431429            pmSource *source = psfTry->sources->data[i];
     
    603601    for (int i = 0; i < sources->n; i++) {
    604602        // skip any masked sources (failed to fit one of the model steps or get a magnitude)
    605         if (srcMask->data.U8[i]) continue;
     603        if (srcMask->data.PS_TYPE_VECTOR_MASK_DATA[i]) continue;
    606604       
    607605        pmSource *source = sources->data[i];
     
    624622
    625623        psVector *dz = NULL;
    626         psVector *mask = psVectorAlloc (sources->n, PS_TYPE_U8);
     624        psVector *mask = psVectorAlloc (sources->n, PS_TYPE_VECTOR_MASK);
    627625
    628626        // check the fit residuals and increase Nx,Ny until the error is minimized
     
    632630            // copy srcMask to mask (we do not want the mask values set in pmPSFFitShapeParamsMap to be sticky)
    633631            for (int i = 0; i < mask->n; i++) {
    634                 mask->data.U8[i] = srcMask->data.U8[i];
     632                mask->data.PS_TYPE_VECTOR_MASK_DATA[i] = srcMask->data.PS_TYPE_VECTOR_MASK_DATA[i];
    635633            }
    636634            if (!pmPSFFitShapeParamsMap (psf, i, &scatterTotal, mask, x, y, mag, e0, e1, e2, dz)) {
     
    651649        // copy srcMask to mask (we do not want the mask values set in pmPSFFitShapeParamsMap to be sticky)
    652650        for (int i = 0; i < mask->n; i++) {
    653             mask->data.U8[i] = srcMask->data.U8[i];
     651            mask->data.PS_TYPE_VECTOR_MASK_DATA[i] = srcMask->data.PS_TYPE_VECTOR_MASK_DATA[i];
    654652        }
    655653        if (!pmPSFFitShapeParamsMap (psf, entryMin, &scatterTotal, mask, x, y, mag, e0, e1, e2, dz)) {
     
    663661        // copy mask back to srcMask
    664662        for (int i = 0; i < mask->n; i++) {
    665             srcMask->data.U8[i] = mask->data.U8[i];
     663            srcMask->data.PS_TYPE_VECTOR_MASK_DATA[i] = mask->data.PS_TYPE_VECTOR_MASK_DATA[i];
    666664        }
    667665
     
    736734                     pmTrend2DEval (psf->params->data[PM_PAR_E1], x->data.F32[i], y->data.F32[i]),
    737735                     pmTrend2DEval (psf->params->data[PM_PAR_E2], x->data.F32[i], y->data.F32[i]),
    738                      srcMask->data.U8[i]);
     736                     srcMask->data.PS_TYPE_VECTOR_MASK_DATA[i]);
    739737        }
    740738        fclose (f);
     
    851849
    852850    // the mask marks the values not used to calculate the ApTrend
    853     psVector *fitMask = psVectorAlloc (x_fit->n, PS_TYPE_U8);
     851    psVector *fitMask = psVectorAlloc (x_fit->n, PS_TYPE_VECTOR_MASK);
    854852    // copy mask values to fitMask as a starting point
    855853    for (int i = 0; i < fitMask->n; i++) {
    856         fitMask->data.U8[i] = mask->data.U8[i];
     854        fitMask->data.PS_TYPE_VECTOR_MASK_DATA[i] = mask->data.PS_TYPE_VECTOR_MASK_DATA[i];
    857855    }
    858856
     
    943941    // XXX copy fitMask values back to mask
    944942    for (int i = 0; i < fitMask->n; i++) {
    945         mask->data.U8[i] = fitMask->data.U8[i];
     943        mask->data.PS_TYPE_VECTOR_MASK_DATA[i] = fitMask->data.PS_TYPE_VECTOR_MASK_DATA[i];
    946944    }
    947945    psFree (fitMask);
     
    951949
    952950// calculate the scatter of the parameters
    953 bool pmPSFShapeParamsScatter(float *scatterTotal, psVector *e0res, psVector *e1res, psVector *e2res, psVector *mask, psMaskType maskValue, psStatsOptions stdevOpt)
     951bool pmPSFShapeParamsScatter(float *scatterTotal, psVector *e0res, psVector *e1res, psVector *e2res, psVector *mask, psVectorMaskType maskValue, psStatsOptions stdevOpt)
    954952{
    955953
     
    994992    psVector *dE1subset = psVectorAllocEmpty (nGroup, PS_TYPE_F32);
    995993    psVector *dE2subset = psVectorAllocEmpty (nGroup, PS_TYPE_F32);
    996     psVector *mkSubset  = psVectorAllocEmpty (nGroup, PS_TYPE_U8);
     994    psVector *mkSubset  = psVectorAllocEmpty (nGroup, PS_TYPE_VECTOR_MASK);
    997995
    998996    int n = 0;
     
    10071005            dE2subset->data.F32[j] = e2res->data.F32[N];
    10081006
    1009             mkSubset->data.U8[j]   = mask->data.U8[N];
    1010             if (!mask->data.U8[N]) nValid ++;
     1007            mkSubset->data.PS_TYPE_VECTOR_MASK_DATA[j]   = mask->data.PS_TYPE_VECTOR_MASK_DATA[N];
     1008            if (!mask->data.PS_TYPE_VECTOR_MASK_DATA[N]) nValid ++;
    10111009        }
    10121010        if (nValid < 3) continue;
  • trunk/psModules/src/objects/pmPSFtry.h

    r21174 r21183  
    66 * @author EAM, IfA
    77 *
    8  * @version $Revision: 1.21 $ $Name: not supported by cvs2svn $
    9  * @date $Date: 2009-01-27 00:02:16 $
     8 * @version $Revision: 1.22 $ $Name: not supported by cvs2svn $
     9 * @date $Date: 2009-01-27 06:39:38 $
    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()
     
    129129bool pmPSFFitShapeParams (pmPSF *psf, psArray *sources, psVector *x, psVector *y, psVector *srcMask);
    130130bool pmPSFFitShapeParamsMap (pmPSF *psf, int scale, float *scatterTotal, psVector *mask, psVector *x, psVector *y, psVector *mag, psVector *e0obs, psVector *e1obs, psVector *e2obs, psVector *dz);
    131 bool pmPSFShapeParamsScatter(float *scatterTotal, psVector *e0res, psVector *e1res, psVector *e2res, psVector *mask, psMaskType maskValue, psStatsOptions stdevOpt);
     131bool pmPSFShapeParamsScatter(float *scatterTotal, psVector *e0res, psVector *e1res, psVector *e2res, psVector *mask, psVectorMaskType maskValue, psStatsOptions stdevOpt);
    132132bool pmPSFShapeParamsErrors (float *errorFloor, psVector *mag, psVector *e0res, psVector *e1res, psVector *e2res, psVector *mask, int nGroup, psStatsOptions stdevOpt);
    133133
  • trunk/psModules/src/objects/pmResiduals.c

    r15562 r21183  
    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.4 $ $Name: not supported by cvs2svn $
     7 * @date $Date: 2009-01-27 06:39:38 $
    88 * Copyright 2004 IfA, University of Hawaii
    99 */
     
    4343    resid->Ry  = psImageAlloc (nX, nY, PS_TYPE_F32);
    4444    resid->weight = psImageAlloc (nX, nY, PS_TYPE_F32);
    45     resid->mask   = psImageAlloc (nX, nY, PS_TYPE_U8);
     45    resid->mask   = psImageAlloc (nX, nY, PM_TYPE_RESID_MASK);
     46
     47    // NOTE : the residual mask is internal only : 1 byte is sufficient
    4648
    4749    resid->xBin = xBin;
  • trunk/psModules/src/objects/pmResiduals.h

    r15562 r21183  
    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.4 $ $Name: not supported by cvs2svn $
     7 * @date $Date: 2009-01-27 06:39:38 $
    88 * Copyright 2004 IfA, University of Hawaii
    99 */
     
    3131bool psMemCheckResiduals(psPtr ptr);
    3232
     33// macros to abstract the resid mask type : these values must be consistent
     34#define PM_TYPE_RESID_MASK PS_TYPE_U8        /**< the psElemType to use for mask image */
     35#define PM_TYPE_RESID_MASK_DATA U8           /**< the data member to use for mask image */
     36#define PM_TYPE_RESID_MASK_NAME "psU8"       /**< the data type for mask as a string */
     37typedef psU8 pmResidMaskType;               ///< the C datatype for a mask image
     38#define PM_NOT_RESID_MASK(A)(UINT8_MAX-(A))
     39
    3340/// @}
    3441# endif
  • trunk/psModules/src/objects/pmSource.c

    r20937 r21183  
    66 *  @author EAM, IfA: significant modifications.
    77 *
    8  *  @version $Revision: 1.66 $ $Name: not supported by cvs2svn $
    9  *  @date $Date: 2008-12-08 02:51:14 $
     8 *  @version $Revision: 1.67 $ $Name: not supported by cvs2svn $
     9 *  @date $Date: 2009-01-27 06:39:38 $
    1010 *
    1111 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    171171
    172172    // the maskObj is a unique mask array; create a new mask image
    173     source->maskObj = in->maskObj ? psImageCopy (NULL, in->maskObj, PS_TYPE_MASK) : NULL;
     173    source->maskObj = in->maskObj ? psImageCopy (NULL, in->maskObj, PS_TYPE_IMAGE_MASK) : NULL;
    174174
    175175    source->type = in->type;
     
    205205        mySource->maskView = psImageSubset(readout->mask,  srcRegion);
    206206        // the object mask is a copy, and used to define the source pixels
    207         mySource->maskObj = psImageCopy(NULL, mySource->maskView, PS_TYPE_MASK);
     207        mySource->maskObj = psImageCopy(NULL, mySource->maskView, PS_TYPE_IMAGE_MASK);
    208208    }
    209209    mySource->region   = srcRegion;
     
    255255        // re-copy the main mask pixels.  NOTE: the user will need to reset the object mask
    256256        // pixels (eg, with psImageKeepCircle)
    257         mySource->maskObj = psImageCopy (mySource->maskObj, mySource->maskView, PS_TYPE_MASK);
     257        mySource->maskObj = psImageCopy (mySource->maskObj, mySource->maskView, PS_TYPE_IMAGE_MASK);
    258258
    259259        // drop the old modelFlux pixels and force the user to re-create
     
    505505*****************************************************************************/
    506506
    507 bool pmSourceRoughClass(psRegion *region, psArray *sources, psMetadata *recipe, pmPSFClump clump, psMaskType maskSat)
     507bool pmSourceRoughClass(psRegion *region, psArray *sources, psMetadata *recipe, pmPSFClump clump, psImageMaskType maskSat)
    508508{
    509509    psTrace("psModules.objects", 5, "---- begin ----");
     
    738738        psF32 *vPix = source->pixels->data.F32[row];
    739739        psF32 *vWgt = source->weight->data.F32[row];
    740         psU8  *vMsk = (source->maskObj == NULL) ? NULL : source->maskObj->data.U8[row];
     740        psImageMaskType *vMsk = (source->maskObj == NULL) ? NULL : source->maskObj->data.PS_TYPE_IMAGE_MASK_DATA[row];
    741741
    742742        for (psS32 col = 0; col < source->pixels->numCols ; col++, vPix++, vWgt++) {
     
    848848# endif
    849849// construct a realization of the source model
    850 bool pmSourceCacheModel (pmSource *source, psMaskType maskVal) {
     850bool pmSourceCacheModel (pmSource *source, psImageMaskType maskVal) {
    851851    PS_ASSERT_PTR_NON_NULL(source, false);
    852852    // select appropriate model
     
    867867// construct a realization of the source model
    868868// XXX this function should optionally save an existing psf image from modelFlux
    869 bool pmSourceCachePSF (pmSource *source, psMaskType maskVal) {
     869bool pmSourceCachePSF (pmSource *source, psImageMaskType maskVal) {
    870870    PS_ASSERT_PTR_NON_NULL(source, false);
    871871
     
    885885
    886886// should we call pmSourceCacheModel if it does not exist?
    887 bool pmSourceOp (pmSource *source, pmModelOpMode mode, bool add, psMaskType maskVal, int dx, int dy)
     887bool pmSourceOp (pmSource *source, pmModelOpMode mode, bool add, psImageMaskType maskVal, int dx, int dy)
    888888{
    889889    PS_ASSERT_PTR_NON_NULL(source, false);
     
    915915        }
    916916
    917         psU8 **mask = NULL;
     917        psImageMaskType **mask = NULL;
    918918        if (source->maskObj) {
    919             mask = source->maskObj->data.U8;
     919            mask = source->maskObj->data.PS_TYPE_IMAGE_MASK_DATA;
    920920        }
    921921
     
    957957}
    958958
    959 bool pmSourceAdd (pmSource *source, pmModelOpMode mode, psMaskType maskVal) {
     959bool pmSourceAdd (pmSource *source, pmModelOpMode mode, psImageMaskType maskVal) {
    960960    return pmSourceOp (source, mode, true, maskVal, 0, 0);
    961961}
    962962
    963 bool pmSourceSub (pmSource *source, pmModelOpMode mode, psMaskType maskVal) {
     963bool pmSourceSub (pmSource *source, pmModelOpMode mode, psImageMaskType maskVal) {
    964964    return pmSourceOp (source, mode, false, maskVal, 0, 0);
    965965}
    966966
    967 bool pmSourceAddWithOffset (pmSource *source, pmModelOpMode mode, psMaskType maskVal, int dx, int dy) {
     967bool pmSourceAddWithOffset (pmSource *source, pmModelOpMode mode, psImageMaskType maskVal, int dx, int dy) {
    968968    return pmSourceOp (source, mode, true, maskVal, dx, dy);
    969969}
    970970
    971 bool pmSourceSubWithOffset (pmSource *source, pmModelOpMode mode, psMaskType maskVal, int dx, int dy) {
     971bool pmSourceSubWithOffset (pmSource *source, pmModelOpMode mode, psImageMaskType maskVal, int dx, int dy) {
    972972    return pmSourceOp (source, mode, false, maskVal, dx, dy);
    973973}
  • trunk/psModules/src/objects/pmSource.h

    r20945 r21183  
    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.27 $ $Name: not supported by cvs2svn $
     6 * @date $Date: 2009-01-27 06:39:38 $
    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);
  • trunk/psModules/src/objects/pmSourceFitModel.c

    r20937 r21183  
    66 *  @author GLG, MHPCC
    77 *
    8  *  @version $Revision: 1.28 $ $Name: not supported by cvs2svn $
    9  *  @date $Date: 2008-12-08 02:51:14 $
     8 *  @version $Revision: 1.29 $ $Name: not supported by cvs2svn $
     9 *  @date $Date: 2009-01-27 06:39:38 $
    1010 *
    1111 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    5656                       pmModel *model,
    5757                       pmSourceFitMode mode,
    58                        psMaskType maskVal)
     58                       psImageMaskType maskVal)
    5959{
    6060    psTrace("psModules.objects", 5, "---- %s begin ----\n", __func__);
     
    8181        for (psS32 j = 0; j < source->pixels->numCols; j++) {
    8282            // skip masked points
    83             if (source->maskObj->data.U8[i][j] & maskVal) {
     83            if (source->maskObj->data.PS_TYPE_IMAGE_MASK_DATA[i][j] & maskVal) {
    8484                continue;
    8585            }
     
    121121    // create the minimization constraints
    122122    psMinConstraint *constraint = psMinConstraintAlloc();
    123     constraint->paramMask = psVectorAlloc (params->n, PS_TYPE_U8);
     123    constraint->paramMask = psVectorAlloc (params->n, PS_TYPE_VECTOR_MASK);
    124124    constraint->checkLimits = model->modelLimits;
    125125
     
    131131        nParams = 1;
    132132        psVectorInit (constraint->paramMask, 1);
    133         constraint->paramMask->data.U8[PM_PAR_I0] = 0;
     133        constraint->paramMask->data.PS_TYPE_VECTOR_MASK_DATA[PM_PAR_I0] = 0;
    134134        break;
    135135    case PM_SOURCE_FIT_PSF:
     
    137137        nParams = 3;
    138138        psVectorInit (constraint->paramMask, 1);
    139         constraint->paramMask->data.U8[PM_PAR_I0] = 0;
    140         constraint->paramMask->data.U8[PM_PAR_XPOS] = 0;
    141         constraint->paramMask->data.U8[PM_PAR_YPOS] = 0;
     139        constraint->paramMask->data.PS_TYPE_VECTOR_MASK_DATA[PM_PAR_I0] = 0;
     140        constraint->paramMask->data.PS_TYPE_VECTOR_MASK_DATA[PM_PAR_XPOS] = 0;
     141        constraint->paramMask->data.PS_TYPE_VECTOR_MASK_DATA[PM_PAR_YPOS] = 0;
    142142        break;
    143143    case PM_SOURCE_FIT_EXT:
     
    145145        nParams = params->n - 1;
    146146        psVectorInit (constraint->paramMask, 0);
    147         constraint->paramMask->data.U8[PM_PAR_SKY] = 1;
     147        constraint->paramMask->data.PS_TYPE_VECTOR_MASK_DATA[PM_PAR_SKY] = 1;
    148148        break;
    149149    default:
     
    175175            fprintf (stderr, "%f ", params->data.F32[i]);
    176176        }
    177         if ((constraint->paramMask != NULL) && constraint->paramMask->data.U8[i])
     177        if ((constraint->paramMask != NULL) && constraint->paramMask->data.PS_TYPE_VECTOR_MASK_DATA[i])
    178178            continue;
    179179        dparams->data.F32[i] = sqrt(covar->data.F32[i][i]);
     
    192192    if (constraint->paramMask != NULL) {
    193193        psVector *delta = psVectorAlloc (params->n, PS_TYPE_F32);
    194         psVector *altmask = psVectorAlloc (params->n, PS_TYPE_U8);
    195         altmask->data.U8[0] = 1;
     194        psVector *altmask = psVectorAlloc (params->n, PS_TYPE_VECTOR_MASK);
     195        altmask->data.PS_TYPE_VECTOR_MASK_DATA[0] = 1;
    196196        for (int i = 1; i < dparams->n; i++) {
    197             altmask->data.U8[i] = (constraint->paramMask->data.U8[i]) ? 0 : 1;
     197            altmask->data.PS_TYPE_VECTOR_MASK_DATA[i] = (constraint->paramMask->data.PS_TYPE_VECTOR_MASK_DATA[i]) ? 0 : 1;
    198198        }
    199199        psMinimizeGaussNewtonDelta(delta, params, altmask, x, y, yErr, model->modelFunc);
    200200
    201201        for (int i = 0; i < dparams->n; i++) {
    202             if (!constraint->paramMask->data.U8[i])
     202            if (!constraint->paramMask->data.PS_TYPE_VECTOR_MASK_DATA[i])
    203203                continue;
    204204            // note that delta is the value *subtracted* from the parameter
  • trunk/psModules/src/objects/pmSourceFitModel.h

    r13898 r21183  
    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.7 $ $Name: not supported by cvs2svn $
     6 * @date $Date: 2009-01-27 06:39:38 $
    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);
  • trunk/psModules/src/objects/pmSourceFitSet.c

    r21163 r21183  
    66 *  @author GLG, MHPCC
    77 *
    8  *  @version $Revision: 1.13 $ $Name: not supported by cvs2svn $
    9  *  @date $Date: 2009-01-24 20:52:26 $
    10  *
     8 *  @version $Revision: 1.14 $ $Name: not supported by cvs2svn $
     9 *  @date $Date: 2009-01-27 06:39:38 $
    1110 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
    1211 *
     
    394393            for (int j = 0; j < paramOne->n; j++) {
    395394                if (j == PM_PAR_I0) continue;
    396                 constraint->paramMask->data.U8[n + j] = 1;
     395                constraint->paramMask->data.PS_TYPE_VECTOR_MASK_DATA[n + j] = 1;
    397396            }
    398397            break;
     
    403402                if (j == PM_PAR_YPOS) continue;
    404403                if (j == PM_PAR_I0) continue;
    405                 constraint->paramMask->data.U8[n + j] = 1;
     404                constraint->paramMask->data.PS_TYPE_VECTOR_MASK_DATA[n + j] = 1;
    406405            }
    407406            break;
    408407          case PM_SOURCE_FIT_EXT:
    409408            // EXT model fits all params (except sky)
    410             constraint->paramMask->data.U8[n + PM_PAR_SKY] = 1;
     409            constraint->paramMask->data.PS_TYPE_VECTOR_MASK_DATA[n + PM_PAR_SKY] = 1;
    411410            break;
    412411          default:
     
    445444                     psArray *modelSet,
    446445                     pmSourceFitMode mode,
    447                      psMaskType maskVal)
     446                     psImageMaskType maskVal)
    448447{
    449448    psTrace("psModules.objects", 3, "---- %s begin ----\n", __func__);
     
    469468        for (psS32 j = 0; j < source->pixels->numCols; j++) {
    470469            // skip masked points
    471             if (source->maskObj->data.U8[i][j] & maskVal) {
     470            if (source->maskObj->data.PS_TYPE_IMAGE_MASK_DATA[i][j] & maskVal) {
    472471                continue;
    473472            }
     
    515514    // create the minimization constraints
    516515    psMinConstraint *constraint = psMinConstraintAlloc();
    517     constraint->paramMask = psVectorAlloc (thisSet->nParamSet, PS_TYPE_U8);
     516    constraint->paramMask = psVectorAlloc (thisSet->nParamSet, PS_TYPE_VECTOR_MASK);
    518517    constraint->checkLimits = pmSourceFitSetCheckLimits;
    519518
     
    528527    if (psTraceGetLevel("psModules.objects") >= 5) {
    529528        for (int i = 0; i < params->n; i++) {
    530             fprintf (stderr, "%d %f %d\n", i, params->data.F32[i], constraint->paramMask->data.U8[i]);
     529            fprintf (stderr, "%d %f %d\n", i, params->data.F32[i], constraint->paramMask->data.PS_TYPE_VECTOR_MASK_DATA[i]);
    531530        }
    532531    }
     
    560559    psVector *dparams = psVectorAlloc (thisSet->nParamSet, PS_TYPE_F32);
    561560    for (int i = 0; i < dparams->n; i++) {
    562         if ((constraint->paramMask != NULL) && constraint->paramMask->data.U8[i])
     561        if ((constraint->paramMask != NULL) && constraint->paramMask->data.PS_TYPE_VECTOR_MASK_DATA[i])
    563562            continue;
    564563        dparams->data.F32[i] = sqrt(covar->data.F32[i][i]);
     
    568567    if (constraint->paramMask != NULL) {
    569568        psVector *delta = psVectorAlloc (params->n, PS_TYPE_F32);
    570         psVector *altmask = psVectorAlloc (params->n, PS_TYPE_U8);
    571         altmask->data.U8[0] = 1;
     569        psVector *altmask = psVectorAlloc (params->n, PS_TYPE_VECTOR_MASK);
     570        altmask->data.PS_TYPE_VECTOR_MASK_DATA[0] = 1;
    572571        for (int i = 1; i < dparams->n; i++) {
    573             altmask->data.U8[i] = (constraint->paramMask->data.U8[i]) ? 0 : 1;
     572            altmask->data.PS_TYPE_VECTOR_MASK_DATA[i] = (constraint->paramMask->data.PS_TYPE_VECTOR_MASK_DATA[i]) ? 0 : 1;
    574573        }
    575574        psMinimizeGaussNewtonDelta(delta, params, altmask, x, y, yErr, pmSourceFitSetFunction);
    576575
    577576        for (int i = 0; i < dparams->n; i++) {
    578             if (!constraint->paramMask->data.U8[i])
     577            if (!constraint->paramMask->data.PS_TYPE_VECTOR_MASK_DATA[i])
    579578                continue;
    580579            // note that delta is the value *subtracted* from the parameter
  • trunk/psModules/src/objects/pmSourceFitSet.h

    r21163 r21183  
    33 * @author EAM, IfA; GLG, MHPCC
    44 *
    5  * @version $Revision: 1.7 $ $Name: not supported by cvs2svn $
    6  * @date $Date: 2009-01-24 20:52:26 $
     5 * @version $Revision: 1.8 $ $Name: not supported by cvs2svn $
     6 * @date $Date: 2009-01-27 06:39:38 $
    77 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii
    88 */
     
    5454 */
    5555bool pmSourceFitSet(
    56     pmSource *source,   ///< The input pmSource
    57     psArray *modelSet,   ///< model to be fitted
    58     pmSourceFitMode mode,  ///< define parameters to be fitted
    59     psMaskType maskVal                  ///< Vale to mask
     56    pmSource *source,                   ///< The input pmSource
     57    psArray *modelSet,                  ///< model to be fitted
     58    pmSourceFitMode mode,               ///< define parameters to be fitted
     59    psImageMaskType maskVal             ///< Vale to mask
    6060
    6161);
  • trunk/psModules/src/objects/pmSourceMatch.c

    r21105 r21183  
    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->mask->data.PS_TYPE_MASK_DATA[num] = 0;
     145    match->mask->data.PS_TYPE_VECTOR_MASK_DATA[num] = 0;
    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        }
  • trunk/psModules/src/objects/pmSourceMoments.c

    r20937 r21183  
    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.7 $ $Name: not supported by cvs2svn $
     9 *  @date $Date: 2009-01-27 06:39:38 $
    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++) {
  • trunk/psModules/src/objects/pmSourcePhotometry.c

    r20937 r21183  
    33 *  @author EAM, IfA; GLG, MHPCC
    44 *
    5  *  @version $Revision: 1.47 $ $Name: not supported by cvs2svn $
    6  *  @date $Date: 2008-12-08 02:51:14 $
     5 *  @version $Revision: 1.48 $ $Name: not supported by cvs2svn $
     6 *  @date $Date: 2009-01-27 06:39:38 $
    77 *
    88 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    6666
    6767// XXX masked region should be (optionally) elliptical
    68 bool pmSourceMagnitudes (pmSource *source, pmPSF *psf, pmSourcePhotometryMode mode, psMaskType maskVal)
     68bool pmSourceMagnitudes (pmSource *source, pmPSF *psf, pmSourcePhotometryMode mode, psImageMaskType maskVal)
    6969{
    7070    PS_ASSERT_PTR_NON_NULL(source, false);
     
    306306
    307307// return source aperture magnitude
    308 bool pmSourcePhotometryAper (float *apMag, pmModel *model, psImage *image, psImage *mask, psMaskType maskVal)
     308bool pmSourcePhotometryAper (float *apMag, pmModel *model, psImage *image, psImage *mask, psImageMaskType maskVal)
    309309{
    310310    PS_ASSERT_PTR_NON_NULL(apMag, false);
     
    324324
    325325    psF32 **imData = image->data.F32;
    326     psU8 **mkData = mask->data.U8;
     326    psImageMaskType **mkData = mask->data.PS_TYPE_IMAGE_MASK_DATA;
    327327
    328328    // measure apMag
     
    344344
    345345// return source aperture magnitude
    346 bool pmSourcePixelWeight (float *pixWeight, pmModel *model, psImage *image, psImage *mask, psMaskType maskVal)
     346bool pmSourcePixelWeight (float *pixWeight, pmModel *model, psImage *image, psImage *mask, psImageMaskType maskVal)
    347347{
    348348    PS_ASSERT_PTR_NON_NULL(pixWeight, false);
     
    412412            if (my >= NY)
    413413                continue;
    414             if (mask->data.U8[my][mx] & maskVal)
     414            if (mask->data.PS_TYPE_IMAGE_MASK_DATA[my][mx] & maskVal)
    415415                continue;
    416416
     
    475475    for (yi = yIs, yj = yJs; yi < yIe; yi++, yj++) {
    476476        for (xi = xIs, xj = xJs; xi < xIe; xi++, xj++) {
    477             if (Ti->data.U8[yi][xi])
    478                 continue;
    479             if (Tj->data.U8[yj][xj])
     477            if (Ti->data.PS_TYPE_IMAGE_MASK_DATA[yi][xi])
     478                continue;
     479            if (Tj->data.PS_TYPE_IMAGE_MASK_DATA[yj][xj])
    480480                continue;
    481481
     
    540540    for (yi = yIs, yj = yJs; yi < yIe; yi++, yj++) {
    541541        for (xi = xIs, xj = xJs; xi < xIe; xi++, xj++) {
    542             if (Ti->data.U8[yi][xi])
    543                 continue;
    544             if (Tj->data.U8[yj][xj])
     542            if (Ti->data.PS_TYPE_IMAGE_MASK_DATA[yi][xi])
     543                continue;
     544            if (Tj->data.PS_TYPE_IMAGE_MASK_DATA[yj][xj])
    545545                continue;
    546546
     
    578578    for (int yi = 0; yi < Pi->numRows; yi++) {
    579579        for (int xi = 0; xi < Pi->numCols; xi++) {
    580             if (Ti->data.U8[yi][xi])
     580            if (Ti->data.PS_TYPE_IMAGE_MASK_DATA[yi][xi])
    581581                continue;
    582582            if (!unweighted_sum) {
     
    613613
    614614bool pmSourceChisq (pmModel *model, psImage *image, psImage *mask, psImage *weight,
    615                     psMaskType maskVal)
     615                    psImageMaskType maskVal)
    616616{
    617617    PS_ASSERT_PTR_NON_NULL(model, false);
     
    624624    for (int j = 0; j < image->numRows; j++) {
    625625        for (int i = 0; i < image->numCols; i++) {
    626             if (mask->data.U8[j][i] & maskVal)
     626            if (mask->data.PS_TYPE_IMAGE_MASK_DATA[j][i] & maskVal)
    627627                continue;
    628628            if (weight->data.F32[j][i] <= 0)
     
    657657    for (int yi = 0; yi < Pi->numRows; yi++) {
    658658        for (int xi = 0; xi < Pi->numCols; xi++) {
    659             if (Ti->data.U8[yi][xi])
     659            if (Ti->data.PS_TYPE_IMAGE_MASK_DATA[yi][xi])
    660660                continue;
    661661            if (!unweighted_sum) {
     
    734734    for (yi = yIs, yj = yJs; yi < yIe; yi++, yj++) {
    735735        for (xi = xIs, xj = xJs; xi < xIe; xi++, xj++) {
    736             if (Ti->data.U8[yi][xi])
    737                 continue;
    738             if (Tj->data.U8[yj][xj])
     736            if (Ti->data.PS_TYPE_IMAGE_MASK_DATA[yi][xi])
     737                continue;
     738            if (Tj->data.PS_TYPE_IMAGE_MASK_DATA[yj][xj])
    739739                continue;
    740740
     
    798798    for (yi = yIs, yj = yJs; yi < yIe; yi++, yj++) {
    799799        for (xi = xIs, xj = xJs; xi < xIe; xi++, xj++) {
    800             if (Ti->data.U8[yi][xi])
    801                 continue;
    802             if (Tj->data.U8[yj][xj])
     800            if (Ti->data.PS_TYPE_IMAGE_MASK_DATA[yi][xi])
     801                continue;
     802            if (Tj->data.PS_TYPE_IMAGE_MASK_DATA[yj][xj])
    803803                continue;
    804804
  • trunk/psModules/src/objects/pmSourcePhotometry.h

    r18554 r21183  
    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.12 $ $Name: not supported by cvs2svn $
     7 * @date $Date: 2009-01-27 06:39:38 $
    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
  • trunk/psModules/src/objects/pmSourceSky.c

    r20937 r21183  
    66 *  @author EAM, IfA: significant modifications.
    77 *
    8  *  @version $Revision: 1.18 $ $Name: not supported by cvs2svn $
    9  *  @date $Date: 2008-12-08 02:51:14 $
     8 *  @version $Revision: 1.19 $ $Name: not supported by cvs2svn $
     9 *  @date $Date: 2009-01-27 06:39:38 $
    1010 *
    1111 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    5252    psStatsOptions statsOptions,
    5353    psF32 Radius,
    54     psMaskType maskVal,
    55     psMaskType markVal)
     54    psImageMaskType maskVal,
     55    psImageMaskType markVal)
    5656{
    5757    psTrace("psModules.objects", 3, "---- %s() begin ----\n", __func__);
     
    8686        return false;
    8787    }
    88     psImageMaskRegion(mask, srcRegion, "AND", PS_NOT_U8(markVal));
     88    psImageMaskRegion(mask, srcRegion, "AND", PS_NOT_IMAGE_MASK(markVal));
    8989    double value = psStatsGetValue(myStats, statistic);
    9090    psFree(myStats);
     
    107107    psStatsOptions statsOptions,
    108108    psF32 Radius,
    109     psMaskType maskVal,
    110     psMaskType markVal
     109    psImageMaskType maskVal,
     110    psImageMaskType markVal
    111111)
    112112{
     
    142142        return false;
    143143    }
    144     psImageMaskRegion(mask, srcRegion, "AND", PS_NOT_U8(markVal));
     144    psImageMaskRegion(mask, srcRegion, "AND", PS_NOT_IMAGE_MASK(markVal));
    145145    double value = psStatsGetValue(myStats, statistic);
    146146    psFree(myStats);
  • trunk/psModules/src/objects/pmSourceSky.h

    r13898 r21183  
    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.5 $ $Name: not supported by cvs2svn $
     5 * @date $Date: 2009-01-27 06:39:38 $
    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
  • trunk/psModules/src/objects/pmSourceVisual.c

    r20582 r21183  
    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]);
  • trunk/psModules/src/objects/pmTrend2D.c

    r21172 r21183  
    33 *  @author EAM, IfA
    44 *
    5  *  @version $Revision: 1.11 $ $Name: not supported by cvs2svn $
    6  *  @date $Date: 2009-01-27 00:00:44 $
     5 *  @version $Revision: 1.12 $ $Name: not supported by cvs2svn $
     6 *  @date $Date: 2009-01-27 06:39:38 $
    77 *  Copyright 2004 Institute for Astronomy, University of Hawaii
    88 *
     
    179179}
    180180
    181 bool pmTrend2DFit(pmTrend2D *trend, psVector *mask, psMaskType maskVal, const psVector *x,
     181bool pmTrend2DFit(pmTrend2D *trend, psVector *mask, psVectorMaskType maskVal, const psVector *x,
    182182                  const psVector *y, const psVector *f, const psVector *df)
    183183{
     
    234234}
    235235
    236 psVector *pmTrend2DEvalVector(const pmTrend2D *trend, psVector *mask, psMaskType maskValue, const psVector *x, const psVector *y)
     236psVector *pmTrend2DEvalVector(const pmTrend2D *trend, psVector *mask, psVectorMaskType maskValue, const psVector *x, const psVector *y)
    237237{
    238238    PM_ASSERT_TREND2D_NON_NULL(trend, NULL);
  • trunk/psModules/src/objects/pmTrend2D.h

    r21172 r21183  
    55 * @author EAM, IfA
    66 *
    7  * @version $Revision: 1.8 $ $Name: not supported by cvs2svn $
    8  * @date $Date: 2009-01-27 00:00:45 $
     7 * @version $Revision: 1.9 $ $Name: not supported by cvs2svn $
     8 * @date $Date: 2009-01-27 06:39:38 $
    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,
     
    9090                     float x, float y
    9191    );
    92 psVector *pmTrend2DEvalVector(const pmTrend2D *trend, psVector *mask, psMaskType maskValue,
     92psVector *pmTrend2DEvalVector(const pmTrend2D *trend, psVector *mask, psVectorMaskType maskValue,
    9393                              const psVector *x, const psVector *y
    9494    );
Note: See TracChangeset for help on using the changeset viewer.