Changeset 25027 for branches/pap/magic/remove/src/streaksextern.c
- Timestamp:
- Aug 7, 2009, 4:08:25 PM (17 years ago)
- Location:
- branches/pap
- Files:
-
- 4 edited
-
. (modified) (1 prop)
-
magic (modified) (1 prop)
-
magic/remove/src (modified) (1 prop)
-
magic/remove/src/streaksextern.c (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/pap
- Property svn:mergeinfo changed
-
branches/pap/magic
-
Property svn:ignore
set to
magic
ssa-core-cpp
Makefile
Makefile.bak
-
Property svn:ignore
set to
-
branches/pap/magic/remove/src
- Property svn:ignore
-
old new 1 isdestreaked 1 2 streaksremove 2 3 streaksreplace 3 4 streakscompare 4 5 streaksrelease 6 makefile
-
- Property svn:ignore
-
branches/pap/magic/remove/src/streaksextern.c
r21439 r25027 34 34 int i; 35 35 Line line; 36 StreakPixels *pixels = psArrayAllocEmpty (1024); 36 StreakPixels *pixels = psImageAlloc(numCols, numRows, PS_TYPE_U8); 37 psImageInit(pixels, 0); 37 38 int streaksOnComponent = 0; 39 40 int minX, minY, maxX, maxY; 41 42 // find the chip dimensions in the tangent-plane coordinates (length of hypotenuse) 43 componentBounds (&minX, &minY, &maxX, &maxY, astrom, numCols, numRows); 44 38 45 for (i = 0; i != streaks->size; ++i) 39 46 { … … 41 48 42 49 line.width = streaks->list[i].width; 43 if (skyToCell (&line.begin, astrom, 44 streaks->list[i].ra1, streaks->list[i].dec1) && 45 skyToCell (&line.end, astrom, 46 streaks->list[i].ra2, streaks->list[i].dec2) && 50 51 /* Use tangent plane coordinates to narrow down the ra,dec range of the line closer to 52 * the chip boundaries. Use these new ra,dec positions to generate the line on the 53 * chip using the full non-linear astrometry */ 54 55 // project the ends of the line using a linear projection centered on the chip center: 56 Line full; 57 SkyToLocal (&full.begin, astrom, streaks->list[i].ra1, streaks->list[i].dec1); 58 SkyToLocal (&full.end, astrom, streaks->list[i].ra2, streaks->list[i].dec2); 59 60 // clip the line to a square box with diameter = hypotenuse of the chip image centerd 61 // on the chip center in tangent-plane coordinates. skip the rest of this streak if 62 // the line does not intersect this region 63 if (!LineClipFull (&full, minX, minY, maxX, maxY)) { 64 continue; 65 } 66 67 // convert the end points back into ra, dec pairs: 68 strkPt sky1, sky2; 69 LocalToSky (&sky1, astrom, &full.begin); 70 LocalToSky (&sky2, astrom, &full.end); 71 72 if (skyToCell (&line.begin, astrom, sky1.x, sky1.y) && 73 skyToCell (&line.end, astrom, sky2.x, sky2.y) && 47 74 LineClip (&line, numCols, numRows)) 48 75 { 49 PixelsFromLine (pixels, &line );76 PixelsFromLine (pixels, &line, numCols, numRows); 50 77 streaksOnComponent++; 51 78 }
Note:
See TracChangeset
for help on using the changeset viewer.
