IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jun 11, 2009, 6:09:52 PM (17 years ago)
Author:
eugene
Message:

modifications to support a two-pass check on the line range, limiting the initial ra,dec range to the region of the chip of interest using just the projection portion

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/magic/remove/src/streaksextern.c

    r24344 r24382  
    3636    StreakPixels *pixels = psArrayAllocEmpty (1024);
    3737    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
    3844    for (i = 0; i != streaks->size; ++i)
    3945    {
     
    4147
    4248        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) &&
    4773            LineClip (&line, numCols, numRows))
    4874        {
Note: See TracChangeset for help on using the changeset viewer.