Changeset 24382 for trunk/magic/remove/src/streaksextern.c
- Timestamp:
- Jun 11, 2009, 6:09:52 PM (17 years ago)
- File:
-
- 1 edited
-
trunk/magic/remove/src/streaksextern.c (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/magic/remove/src/streaksextern.c
r24344 r24382 36 36 StreakPixels *pixels = psArrayAllocEmpty (1024); 37 37 int streaksOnComponent = 0; 38 39 int minX, minY, maxX, maxY; 40 41 // find the chip dimensions in the tangent-plane coordinates (length of hypotenuse) 42 componentBounds (&minX, &minY, &maxX, &maxY, astrom, numCols, numRows); 43 38 44 for (i = 0; i != streaks->size; ++i) 39 45 { … … 41 47 42 48 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) && 49 50 /* Use tangent plane coordinates to narrow down the ra,dec range of the line closer to 51 * the chip boundaries. Use these new ra,dec positions to generate the line on the 52 * chip using the full non-linear astrometry */ 53 54 // project the ends of the line using a linear projection centered on the chip center: 55 Line full; 56 SkyToLocal (&full.begin, astrom, streaks->list[i].ra1, streaks->list[i].dec1); 57 SkyToLocal (&full.end, astrom, streaks->list[i].ra2, streaks->list[i].dec2); 58 59 // clip the line to a square box with diameter = hypotenuse of the chip image centerd 60 // on the chip center in tangent-plane coordinates. skip the rest of this streak if 61 // the line does not intersect this region 62 if (!LineClipFull (&full, minX, minY, maxX, maxY)) { 63 continue; 64 } 65 66 // convert the end points back into ra, dec pairs: 67 strkPt sky1, sky2; 68 LocalToSky (&sky1, astrom, &full.begin); 69 LocalToSky (&sky2, astrom, &full.end); 70 71 if (skyToCell (&line.begin, astrom, sky1.x, sky1.y) && 72 skyToCell (&line.end, astrom, sky2.x, sky2.y) && 47 73 LineClip (&line, numCols, numRows)) 48 74 {
Note:
See TracChangeset
for help on using the changeset viewer.
