IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 21183 for trunk/psastro


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/psastro/src
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/psastro/src/psastroAstromGuess.c

    r20805 r21183  
    267267    psVector *cornerDn = psVectorAllocEmpty (100, PS_TYPE_F32);
    268268
    269     psVector *cornerMK = psVectorAllocEmpty (100, PS_TYPE_U8);
     269    psVector *cornerMK = psVectorAllocEmpty (100, PS_TYPE_VECTOR_MASK);
    270270
    271271    if (DEBUG) psastroDumpCorners ("corners.up.guess3.dat", "corners.dn.guess3.dat", fpa);
  • trunk/psastro/src/psastroFixChips.c

    r20805 r21183  
    160160    psPlaneTransform *map = psPlaneTransformAlloc (1, 1);
    161161 
    162     psVector *mask = psVectorAlloc (nPts, PS_TYPE_U8);
     162    psVector *mask = psVectorAlloc (nPts, PS_TYPE_VECTOR_MASK);
    163163    psVectorInit (mask, 0);
    164164
  • trunk/psastro/src/psastroLuminosityFunction.c

    r20805 r21183  
    9191    psLogMsg ("psastro", 4, "fitting %d points to luminosity function\n", n);
    9292
    93     psVector *mask = psVectorAlloc (Mag->n, PS_TYPE_MASK);
     93    psVector *mask = psVectorAlloc (Mag->n, PS_TYPE_VECTOR_MASK);
    9494    psVectorInit (mask, 0);
    9595
     
    108108    double mMaxValid = NAN;
    109109    for (int i = 0; i < Mag->n; i++) {
    110         if (mask->data.U8[i]) continue;
     110        if (mask->data.PS_TYPE_VECTOR_MASK_DATA[i]) continue;
    111111        if (isnan(mMinValid) || (Mag->data.F32[i] < mMinValid)) {
    112112            mMinValid = Mag->data.F32[i];
  • trunk/psastro/src/psastroMaskUpdates.Mosaic.c

    r20650 r21183  
    99pmCell *pmCellInChip (pmChip *chip, float x, float y);
    1010bool pmCellCoordsForChip (float *xCell, float *yCell, pmCell *cell, float xChip, float yChip);
    11 bool psastroMaskCircle (psImage *mask, char value, float x0, float y0, float dX, float dY);
    12 bool psastroMaskBox (psImage *mask, char value, float x0, float y0, float dL, float dW, float theta);
    13 void psastroMaskLine (psImage *mask, char value, double x1, double y1, double x2, double y2, int dW);
    14 void psastroMaskLineBresen (psImage *mask, char value, int X1, int Y1, int X2, int Y2, int dW, int swapcoords);
    15 void psastroMaskRectangle (psImage *mask, char value, int x0, int y0, int x1, int y1);
     11bool psastroMaskCircle (psImage *mask, psImageMaskType value, float x0, float y0, float dX, float dY);
     12bool psastroMaskBox (psImage *mask, psImageMaskType value, float x0, float y0, float dL, float dW, float theta);
     13void psastroMaskLine (psImage *mask, psImageMaskType value, double x1, double y1, double x2, double y2, int dW);
     14void psastroMaskLineBresen (psImage *mask, psImageMaskType value, int X1, int Y1, int X2, int Y2, int dW, int swapcoords);
     15void psastroMaskRectangle (psImage *mask, psImageMaskType value, int x0, int y0, int x1, int y1);
    1616
    1717// create a mask or mask regions based on the collection of reference stars that are
     
    2525    float zeropt, exptime;
    2626
    27     psMaskType maskValue  = pmConfigMaskGet("GHOST", config); // Mask value for ghost pixels
    28     psMaskType maskBlank  = pmConfigMaskGet("BLANK", config); // Mask value for blank pixels
     27    psImageMaskType maskValue  = pmConfigMaskGet("GHOST", config); // Mask value for ghost pixels
     28    psImageMaskType maskBlank  = pmConfigMaskGet("BLANK", config); // Mask value for blank pixels
    2929
    3030    // select the current recipe
     
    342342
    343343// XXX should be doing an OR
    344 bool psastroMaskCircle (psImage *mask, char value, float x0, float y0, float dX, float dY) {
     344bool psastroMaskCircle (psImage *mask, psImageMaskType value, float x0, float y0, float dX, float dY) {
    345345
    346346    // XXX need to worry about row0, col0
     
    357357            if (r2 > 1.0) continue;
    358358           
    359             mask->data.U8[jy][jx] |= value;
     359            mask->data.PS_TYPE_IMAGE_MASK_DATA[jy][jx] |= value;
    360360        }
    361361    }
     
    364364
    365365// XXX should be doing an OR
    366 bool psastroMaskBox (psImage *mask, char value, float x0, float y0, float dL, float dW, float theta) {
     366bool psastroMaskBox (psImage *mask, psImageMaskType value, float x0, float y0, float dL, float dW, float theta) {
    367367
    368368    // draw a series of lines (from -0.5*dW to +0.5*dW) of length dL, starting at x0, y0, angle theta
     
    379379
    380380// identify the quadrant and draw the correct line
    381 void psastroMaskLine (psImage *mask, char value, double x1, double y1, double x2, double y2, int dW) {
     381void psastroMaskLine (psImage *mask, psImageMaskType value, double x1, double y1, double x2, double y2, int dW) {
    382382
    383383  int FlipDirect, FlipCoords;
     
    408408// use the Bresenham line drawing technique
    409409// integer-only Bresenham line-draw version which is fast
    410 void psastroMaskLineBresen (psImage *mask, char value, int X1, int Y1, int X2, int Y2, int dW, int swapcoords) {
     410void psastroMaskLineBresen (psImage *mask, psImageMaskType value, int X1, int Y1, int X2, int Y2, int dW, int swapcoords) {
    411411
    412412    int X, Y, dX, dY;
     
    425425                    if (y < 0) continue;
    426426                    if (y >= mask->numCols) continue;
    427                     mask->data.U8[X][y] |= value;
     427                    mask->data.PS_TYPE_IMAGE_MASK_DATA[X][y] |= value;
    428428                }
    429429            } else {
     
    432432                    if (y < 0) continue;
    433433                    if (y >= mask->numRows) continue;
    434                     mask->data.U8[y][X] |= value;
     434                    mask->data.PS_TYPE_IMAGE_MASK_DATA[y][X] |= value;
    435435                }
    436436            }
     
    450450}
    451451
    452 void psastroMaskRectangle (psImage *mask, char value, int x0, int y0, int x1, int y1) {
     452void psastroMaskRectangle (psImage *mask, psImageMaskType value, int x0, int y0, int x1, int y1) {
    453453    for (int iy = PS_MAX(0,y0); iy < PS_MIN(y1,mask->numRows); iy++) {
    454454        for (int ix = PS_MAX(0,x0); ix < PS_MIN(x1,mask->numCols); ix++) {
    455             mask->data.U8[iy][ix] |= value;
    456         }
    457     }
    458 }
    459 
     455            mask->data.PS_TYPE_IMAGE_MASK_DATA[iy][ix] |= value;
     456        }
     457    }
     458}
     459
  • trunk/psastro/src/psastroMaskUpdates.c

    r21018 r21183  
    1111bool pmChipCoordsForCell (float *xChip, float *yChip, pmCell *cell, float xCell, float yCell);
    1212
    13 bool psastroMaskCircle (psImage *mask, char value, float x0, float y0, float dX, float dY);
    14 bool psastroMaskBox (psImage *mask, char value, float x0, float y0, float dL, float dW, float theta);
    15 void psastroMaskLine (psImage *mask, char value, double x1, double y1, double x2, double y2, int dW);
    16 void psastroMaskLineBresen (psImage *mask, char value, int X1, int Y1, int X2, int Y2, int dW, int swapcoords);
    17 void psastroMaskRectangle (psImage *mask, char value, int x0, int y0, int x1, int y1);
     13bool psastroMaskCircle (psImage *mask, psImageMaskType value, float x0, float y0, float dX, float dY);
     14bool psastroMaskBox (psImage *mask, psImageMaskType value, float x0, float y0, float dL, float dW, float theta);
     15void psastroMaskLine (psImage *mask, psImageMaskType value, double x1, double y1, double x2, double y2, int dW);
     16void psastroMaskLineBresen (psImage *mask, psImageMaskType value, int X1, int Y1, int X2, int Y2, int dW, int swapcoords);
     17void psastroMaskRectangle (psImage *mask, psImageMaskType value, int x0, int y0, int x1, int y1);
    1818
    1919// create a mask or mask regions based on the collection of reference stars that are
     
    2727    float zeropt, exptime;
    2828
    29     psMaskType maskValue  = pmConfigMaskGet("GHOST", config); // Mask value for ghost pixels
    30 
    31     // psMaskType maskBlank  = pmConfigMaskGet("BLANK", config); // Mask value for blank pixels
     29    psImageMaskType maskValue  = pmConfigMaskGet("GHOST", config); // Mask value for ghost pixels
     30
     31    // psImageMaskType maskBlank  = pmConfigMaskGet("BLANK", config); // Mask value for blank pixels
    3232
    3333    // select the current recipe
     
    376376
    377377// XXX should be doing an OR
    378 bool psastroMaskCircle (psImage *mask, char value, float x0, float y0, float dX, float dY) {
     378bool psastroMaskCircle (psImage *mask, psImageMaskType value, float x0, float y0, float dX, float dY) {
    379379
    380380    // XXX need to worry about row0, col0
     
    391391            if (r2 > 1.0) continue;
    392392
    393             mask->data.U8[jy][jx] |= value;
     393            mask->data.PS_TYPE_IMAGE_MASK_DATA[jy][jx] |= value;
    394394        }
    395395    }
     
    398398
    399399// XXX should be doing an OR
    400 bool psastroMaskBox (psImage *mask, char value, float x0, float y0, float dL, float dW, float theta) {
     400bool psastroMaskBox (psImage *mask, psImageMaskType value, float x0, float y0, float dL, float dW, float theta) {
    401401
    402402    // draw a series of lines (from -0.5*dW to +0.5*dW) of length dL, starting at x0, y0, angle theta
     
    413413
    414414// identify the quadrant and draw the correct line
    415 void psastroMaskLine (psImage *mask, char value, double x1, double y1, double x2, double y2, int dW) {
     415void psastroMaskLine (psImage *mask, psImageMaskType value, double x1, double y1, double x2, double y2, int dW) {
    416416
    417417  int FlipDirect, FlipCoords;
     
    442442// use the Bresenham line drawing technique
    443443// integer-only Bresenham line-draw version which is fast
    444 void psastroMaskLineBresen (psImage *mask, char value, int X1, int Y1, int X2, int Y2, int dW, int swapcoords) {
     444void psastroMaskLineBresen (psImage *mask, psImageMaskType value, int X1, int Y1, int X2, int Y2, int dW, int swapcoords) {
    445445
    446446    int X, Y, dX, dY;
     
    459459                    if (y < 0) continue;
    460460                    if (y >= mask->numCols) continue;
    461                     mask->data.U8[X][y] |= value;
     461                    mask->data.PS_TYPE_IMAGE_MASK_DATA[X][y] |= value;
    462462                }
    463463            } else {
     
    466466                    if (y < 0) continue;
    467467                    if (y >= mask->numRows) continue;
    468                     mask->data.U8[y][X] |= value;
     468                    mask->data.PS_TYPE_IMAGE_MASK_DATA[y][X] |= value;
    469469                }
    470470            }
     
    484484}
    485485
    486 void psastroMaskRectangle (psImage *mask, char value, int x0, int y0, int x1, int y1) {
     486void psastroMaskRectangle (psImage *mask, psImageMaskType value, int x0, int y0, int x1, int y1) {
    487487
    488488    int xs = PS_MAX (0, PS_MIN (mask->numCols, PS_MIN (x0, x1)));
     
    493493    for (int iy = ys; iy < ye; iy++) {
    494494        for (int ix = xs; ix < xe; ix++) {
    495             mask->data.U8[iy][ix] |= value;
    496         }
    497     }
    498 }
    499 
     495            mask->data.PS_TYPE_IMAGE_MASK_DATA[iy][ix] |= value;
     496        }
     497    }
     498}
     499
  • trunk/psastro/src/psastroMosaicFPtoTP.c

    r19314 r21183  
    7474
    7575    // constant errors
    76     psVector *mask = psVectorAlloc (X->n, PS_TYPE_U8);
     76    psVector *mask = psVectorAlloc (X->n, PS_TYPE_VECTOR_MASK);
    7777    psVectorInit (mask, 0);
    7878
Note: See TracChangeset for help on using the changeset viewer.