Changeset 21183 for trunk/psastro
- Timestamp:
- Jan 26, 2009, 8:40:07 PM (17 years ago)
- Location:
- trunk/psastro/src
- Files:
-
- 6 edited
-
psastroAstromGuess.c (modified) (1 diff)
-
psastroFixChips.c (modified) (1 diff)
-
psastroLuminosityFunction.c (modified) (2 diffs)
-
psastroMaskUpdates.Mosaic.c (modified) (10 diffs)
-
psastroMaskUpdates.c (modified) (11 diffs)
-
psastroMosaicFPtoTP.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psastro/src/psastroAstromGuess.c
r20805 r21183 267 267 psVector *cornerDn = psVectorAllocEmpty (100, PS_TYPE_F32); 268 268 269 psVector *cornerMK = psVectorAllocEmpty (100, PS_TYPE_ U8);269 psVector *cornerMK = psVectorAllocEmpty (100, PS_TYPE_VECTOR_MASK); 270 270 271 271 if (DEBUG) psastroDumpCorners ("corners.up.guess3.dat", "corners.dn.guess3.dat", fpa); -
trunk/psastro/src/psastroFixChips.c
r20805 r21183 160 160 psPlaneTransform *map = psPlaneTransformAlloc (1, 1); 161 161 162 psVector *mask = psVectorAlloc (nPts, PS_TYPE_ U8);162 psVector *mask = psVectorAlloc (nPts, PS_TYPE_VECTOR_MASK); 163 163 psVectorInit (mask, 0); 164 164 -
trunk/psastro/src/psastroLuminosityFunction.c
r20805 r21183 91 91 psLogMsg ("psastro", 4, "fitting %d points to luminosity function\n", n); 92 92 93 psVector *mask = psVectorAlloc (Mag->n, PS_TYPE_ MASK);93 psVector *mask = psVectorAlloc (Mag->n, PS_TYPE_VECTOR_MASK); 94 94 psVectorInit (mask, 0); 95 95 … … 108 108 double mMaxValid = NAN; 109 109 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; 111 111 if (isnan(mMinValid) || (Mag->data.F32[i] < mMinValid)) { 112 112 mMinValid = Mag->data.F32[i]; -
trunk/psastro/src/psastroMaskUpdates.Mosaic.c
r20650 r21183 9 9 pmCell *pmCellInChip (pmChip *chip, float x, float y); 10 10 bool pmCellCoordsForChip (float *xCell, float *yCell, pmCell *cell, float xChip, float yChip); 11 bool psastroMaskCircle (psImage *mask, charvalue, float x0, float y0, float dX, float dY);12 bool psastroMaskBox (psImage *mask, charvalue, float x0, float y0, float dL, float dW, float theta);13 void psastroMaskLine (psImage *mask, charvalue, double x1, double y1, double x2, double y2, int dW);14 void psastroMaskLineBresen (psImage *mask, charvalue, int X1, int Y1, int X2, int Y2, int dW, int swapcoords);15 void psastroMaskRectangle (psImage *mask, charvalue, int x0, int y0, int x1, int y1);11 bool psastroMaskCircle (psImage *mask, psImageMaskType value, float x0, float y0, float dX, float dY); 12 bool psastroMaskBox (psImage *mask, psImageMaskType value, float x0, float y0, float dL, float dW, float theta); 13 void psastroMaskLine (psImage *mask, psImageMaskType value, double x1, double y1, double x2, double y2, int dW); 14 void psastroMaskLineBresen (psImage *mask, psImageMaskType value, int X1, int Y1, int X2, int Y2, int dW, int swapcoords); 15 void psastroMaskRectangle (psImage *mask, psImageMaskType value, int x0, int y0, int x1, int y1); 16 16 17 17 // create a mask or mask regions based on the collection of reference stars that are … … 25 25 float zeropt, exptime; 26 26 27 ps MaskType maskValue = pmConfigMaskGet("GHOST", config); // Mask value for ghost pixels28 ps MaskType maskBlank = pmConfigMaskGet("BLANK", config); // Mask value for blank pixels27 psImageMaskType maskValue = pmConfigMaskGet("GHOST", config); // Mask value for ghost pixels 28 psImageMaskType maskBlank = pmConfigMaskGet("BLANK", config); // Mask value for blank pixels 29 29 30 30 // select the current recipe … … 342 342 343 343 // XXX should be doing an OR 344 bool psastroMaskCircle (psImage *mask, charvalue, float x0, float y0, float dX, float dY) {344 bool psastroMaskCircle (psImage *mask, psImageMaskType value, float x0, float y0, float dX, float dY) { 345 345 346 346 // XXX need to worry about row0, col0 … … 357 357 if (r2 > 1.0) continue; 358 358 359 mask->data. U8[jy][jx] |= value;359 mask->data.PS_TYPE_IMAGE_MASK_DATA[jy][jx] |= value; 360 360 } 361 361 } … … 364 364 365 365 // XXX should be doing an OR 366 bool psastroMaskBox (psImage *mask, charvalue, float x0, float y0, float dL, float dW, float theta) {366 bool psastroMaskBox (psImage *mask, psImageMaskType value, float x0, float y0, float dL, float dW, float theta) { 367 367 368 368 // draw a series of lines (from -0.5*dW to +0.5*dW) of length dL, starting at x0, y0, angle theta … … 379 379 380 380 // identify the quadrant and draw the correct line 381 void psastroMaskLine (psImage *mask, charvalue, double x1, double y1, double x2, double y2, int dW) {381 void psastroMaskLine (psImage *mask, psImageMaskType value, double x1, double y1, double x2, double y2, int dW) { 382 382 383 383 int FlipDirect, FlipCoords; … … 408 408 // use the Bresenham line drawing technique 409 409 // integer-only Bresenham line-draw version which is fast 410 void psastroMaskLineBresen (psImage *mask, charvalue, int X1, int Y1, int X2, int Y2, int dW, int swapcoords) {410 void psastroMaskLineBresen (psImage *mask, psImageMaskType value, int X1, int Y1, int X2, int Y2, int dW, int swapcoords) { 411 411 412 412 int X, Y, dX, dY; … … 425 425 if (y < 0) continue; 426 426 if (y >= mask->numCols) continue; 427 mask->data. U8[X][y] |= value;427 mask->data.PS_TYPE_IMAGE_MASK_DATA[X][y] |= value; 428 428 } 429 429 } else { … … 432 432 if (y < 0) continue; 433 433 if (y >= mask->numRows) continue; 434 mask->data. U8[y][X] |= value;434 mask->data.PS_TYPE_IMAGE_MASK_DATA[y][X] |= value; 435 435 } 436 436 } … … 450 450 } 451 451 452 void psastroMaskRectangle (psImage *mask, charvalue, int x0, int y0, int x1, int y1) {452 void psastroMaskRectangle (psImage *mask, psImageMaskType value, int x0, int y0, int x1, int y1) { 453 453 for (int iy = PS_MAX(0,y0); iy < PS_MIN(y1,mask->numRows); iy++) { 454 454 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 11 11 bool pmChipCoordsForCell (float *xChip, float *yChip, pmCell *cell, float xCell, float yCell); 12 12 13 bool psastroMaskCircle (psImage *mask, charvalue, float x0, float y0, float dX, float dY);14 bool psastroMaskBox (psImage *mask, charvalue, float x0, float y0, float dL, float dW, float theta);15 void psastroMaskLine (psImage *mask, charvalue, double x1, double y1, double x2, double y2, int dW);16 void psastroMaskLineBresen (psImage *mask, charvalue, int X1, int Y1, int X2, int Y2, int dW, int swapcoords);17 void psastroMaskRectangle (psImage *mask, charvalue, int x0, int y0, int x1, int y1);13 bool psastroMaskCircle (psImage *mask, psImageMaskType value, float x0, float y0, float dX, float dY); 14 bool psastroMaskBox (psImage *mask, psImageMaskType value, float x0, float y0, float dL, float dW, float theta); 15 void psastroMaskLine (psImage *mask, psImageMaskType value, double x1, double y1, double x2, double y2, int dW); 16 void psastroMaskLineBresen (psImage *mask, psImageMaskType value, int X1, int Y1, int X2, int Y2, int dW, int swapcoords); 17 void psastroMaskRectangle (psImage *mask, psImageMaskType value, int x0, int y0, int x1, int y1); 18 18 19 19 // create a mask or mask regions based on the collection of reference stars that are … … 27 27 float zeropt, exptime; 28 28 29 ps MaskType maskValue = pmConfigMaskGet("GHOST", config); // Mask value for ghost pixels30 31 // ps MaskType maskBlank = pmConfigMaskGet("BLANK", config); // Mask value for blank pixels29 psImageMaskType maskValue = pmConfigMaskGet("GHOST", config); // Mask value for ghost pixels 30 31 // psImageMaskType maskBlank = pmConfigMaskGet("BLANK", config); // Mask value for blank pixels 32 32 33 33 // select the current recipe … … 376 376 377 377 // XXX should be doing an OR 378 bool psastroMaskCircle (psImage *mask, charvalue, float x0, float y0, float dX, float dY) {378 bool psastroMaskCircle (psImage *mask, psImageMaskType value, float x0, float y0, float dX, float dY) { 379 379 380 380 // XXX need to worry about row0, col0 … … 391 391 if (r2 > 1.0) continue; 392 392 393 mask->data. U8[jy][jx] |= value;393 mask->data.PS_TYPE_IMAGE_MASK_DATA[jy][jx] |= value; 394 394 } 395 395 } … … 398 398 399 399 // XXX should be doing an OR 400 bool psastroMaskBox (psImage *mask, charvalue, float x0, float y0, float dL, float dW, float theta) {400 bool psastroMaskBox (psImage *mask, psImageMaskType value, float x0, float y0, float dL, float dW, float theta) { 401 401 402 402 // draw a series of lines (from -0.5*dW to +0.5*dW) of length dL, starting at x0, y0, angle theta … … 413 413 414 414 // identify the quadrant and draw the correct line 415 void psastroMaskLine (psImage *mask, charvalue, double x1, double y1, double x2, double y2, int dW) {415 void psastroMaskLine (psImage *mask, psImageMaskType value, double x1, double y1, double x2, double y2, int dW) { 416 416 417 417 int FlipDirect, FlipCoords; … … 442 442 // use the Bresenham line drawing technique 443 443 // integer-only Bresenham line-draw version which is fast 444 void psastroMaskLineBresen (psImage *mask, charvalue, int X1, int Y1, int X2, int Y2, int dW, int swapcoords) {444 void psastroMaskLineBresen (psImage *mask, psImageMaskType value, int X1, int Y1, int X2, int Y2, int dW, int swapcoords) { 445 445 446 446 int X, Y, dX, dY; … … 459 459 if (y < 0) continue; 460 460 if (y >= mask->numCols) continue; 461 mask->data. U8[X][y] |= value;461 mask->data.PS_TYPE_IMAGE_MASK_DATA[X][y] |= value; 462 462 } 463 463 } else { … … 466 466 if (y < 0) continue; 467 467 if (y >= mask->numRows) continue; 468 mask->data. U8[y][X] |= value;468 mask->data.PS_TYPE_IMAGE_MASK_DATA[y][X] |= value; 469 469 } 470 470 } … … 484 484 } 485 485 486 void psastroMaskRectangle (psImage *mask, charvalue, int x0, int y0, int x1, int y1) {486 void psastroMaskRectangle (psImage *mask, psImageMaskType value, int x0, int y0, int x1, int y1) { 487 487 488 488 int xs = PS_MAX (0, PS_MIN (mask->numCols, PS_MIN (x0, x1))); … … 493 493 for (int iy = ys; iy < ye; iy++) { 494 494 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 74 74 75 75 // constant errors 76 psVector *mask = psVectorAlloc (X->n, PS_TYPE_ U8);76 psVector *mask = psVectorAlloc (X->n, PS_TYPE_VECTOR_MASK); 77 77 psVectorInit (mask, 0); 78 78
Note:
See TracChangeset
for help on using the changeset viewer.
