IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Apr 5, 2007, 1:36:09 PM (19 years ago)
Author:
eugene
Message:

use TRI images to represent skycell triangles

Location:
trunk/Ohana/src/opihi/dvo
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Ohana/src/opihi/dvo/gimages.c

    r12750 r12753  
    8080  int TriangleUp   = wordhash ("TRP-");
    8181  int TriangleDn   = wordhash ("TRM-");
     82  int TrianglePts  = wordhash ("TRI-");
    8283
    8384  Nfound = 0;
  • trunk/Ohana/src/opihi/dvo/images.c

    r12750 r12753  
    114114  int TriangleUp   = wordhash ("TRP-");
    115115  int TriangleDn   = wordhash ("TRM-");
     116  int TrianglePts  = wordhash ("TRI-");
    116117
    117118  npts = NPTS = 200;
     
    155156      x[1] = +0.5*image[i].NX; y[1] = +0.5*image[i].NY;
    156157      x[2] = -0.5*image[i].NX; y[2] = +0.5*image[i].NY;
     158      goto got_type;
     159    }
     160    // For 'TrianglePts' (TRI-), we are using the Mx,My, etc terms to save the coordinates
     161    // this means triangular images cannot carry photometric zero-point variations
     162    if (typehash == TrianglePts) {
     163      Npts = 3;
     164      x[0] = image[i].Mx;   y[0] = image[i].My;
     165      x[1] = image[i].Mxxx; y[1] = image[i].Mxyy;
     166      x[2] = image[i].Mxxy; y[2] = image[i].Myyy;
    157167      goto got_type;
    158168    }
     
    228238    if (Npts == 0) continue;
    229239
    230     // if any of the points is on the screen, plot the image
    231240    status = FALSE;
    232241    for (j = 0; j < Npts; j++) {
     
    239248    Xvec.elements[N+2*Npts-1] = Xvec.elements[N];
    240249    Yvec.elements[N+2*Npts-1] = Yvec.elements[N];
     250    if (!status) continue;
     251    // if none of the points are on the visible side of the projection, do not plot the image
     252
    241253    InPic = FALSE;
    242254    for (j = 0; j < 2*Npts; j+=2) {
     
    247259        InPic = TRUE;
    248260    }
    249     if (!status && HIDDEN) status = TRUE;
    250     if (InPic && status) {
    251       plist[n] = i;
    252       n++;
    253       if (n > npts - 1) {
    254         npts += 200;
    255         REALLOCATE (plist, int, npts);
    256       }
    257       N+=2*Npts;
    258       if (N + 16 >= NPTS) {  /* need to leave room for 8 point image */
    259         NPTS += 400;
    260         REALLOCATE (Xvec.elements, float, NPTS);
    261         REALLOCATE (Yvec.elements, float, NPTS);
    262       }
     261    // if (!status && HIDDEN) status = TRUE;
     262    if (!InPic) continue;
     263
     264    plist[n] = i;
     265    n++;
     266    if (n > npts - 1) {
     267      npts += 200;
     268      REALLOCATE (plist, int, npts);
     269    }
     270    N+=2*Npts;
     271    if (N + 16 >= NPTS) {  /* need to leave room for 8 point image */
     272      NPTS += 400;
     273      REALLOCATE (Xvec.elements, float, NPTS);
     274      REALLOCATE (Yvec.elements, float, NPTS);
    263275    }
    264276  }
Note: See TracChangeset for help on using the changeset viewer.