IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Apr 4, 2007, 6:55:16 PM (19 years ago)
Author:
eugene
Message:

support for triangular images

File:
1 edited

Legend:

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

    r12727 r12750  
    44 
    55  int i, j, N, Nimage, Nfound, *subset, Nsubset, status;
    6   double ra, dec, Ra, Dec, X, Y;
     6  double ra, dec, Ra, Dec, X, Y, Yo;
    77  double trange, t;
    88  int TimeSelect, PixelCoords, TimeFormat, PhotCodeSelect;
    99  time_t tzero, TimeReference;
    1010  char name[64], *date;
     11  int typehash;
    1112
    1213  PhotCode *code;
     
    7677  BuildChipMatch (image, Nimage);
    7778
     79  int DistortImage = wordhash ("-DIS");
     80  int TriangleUp   = wordhash ("TRP-");
     81  int TriangleDn   = wordhash ("TRM-");
     82
    7883  Nfound = 0;
    7984  for (j = 0; j < Nsubset; j++) {
     
    9398    if (!finite(Y)) continue;
    9499    if (!status) continue;
    95     if (!strcmp(&image[i].coords.ctype[4], "-DIS")) {
    96         if (X < -0.5*image[i].NX) continue;
    97         if (Y < -0.5*image[i].NY) continue;
    98         if (X > +0.5*image[i].NX) continue;
    99         if (Y > +0.5*image[i].NY) continue;
    100     } else {
    101         if (X < 0) continue;
    102         if (Y < 0) continue;
    103         if (X > image[i].NX) continue;
    104         if (Y > image[i].NY) continue;
     100
     101    typehash = wordhash (&image[i].coords.ctype[4]);
     102
     103    if (typehash == DistortImage) {
     104      if (X < -0.5*image[i].NX) continue;
     105      if (Y < -0.5*image[i].NY) continue;
     106      if (X > +0.5*image[i].NX) continue;
     107      if (Y > +0.5*image[i].NY) continue;
     108      goto got_spot;
     109    }
     110
     111    typehash = wordhash (image[i].coords.ctype);
     112    if (typehash == TriangleUp) {
     113      if (Y < -0.5*image[i].NY) continue;
     114      Yo = +0.5*image[i].NY + 2.0*(image[i].NY/image[i].NX)*X;
     115      if (Y > Yo) continue;
     116      Yo = +0.5*image[i].NY - 2.0*(image[i].NY/image[i].NX)*X;
     117      if (Y > Yo) continue;
     118      goto got_spot;
     119    }
     120    if (typehash == TriangleDn) {
     121      if (Y > +0.5*image[i].NY) continue;
     122      Yo = -0.5*image[i].NY + 2.0*(image[i].NY/image[i].NX)*X;
     123      if (Y < Yo) continue;
     124      Yo = -0.5*image[i].NY - 2.0*(image[i].NY/image[i].NX)*X;
     125      if (Y < Yo) continue;
     126      goto got_spot;
     127    }
     128
     129    {
     130      if (X < 0) continue;
     131      if (Y < 0) continue;
     132      if (X > image[i].NX) continue;
     133      if (Y > image[i].NY) continue;
    105134    }
    106135
     
    109138    ***/
    110139
     140  got_spot:
    111141    date = sec_to_date (image[i].tzero);
    112142
Note: See TracChangeset for help on using the changeset viewer.