IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Dec 27, 2005, 5:06:32 AM (21 years ago)
Author:
eugene
Message:

converting to use libkapa commands instead of raw graph commands

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Ohana/src/opihi/cmd.data/point.c

    r4689 r5846  
    33int point (int argc, char **argv) {
    44 
    5   int N, n, ISCEL, ISPIX;
     5  int N, celestial, pixscale;
    66  int Ximage, Nimage;
    7   double x, y, dx, dy, x1, y1;
    8   double dra, ddec, ra1, dec1, ra, dec;
     7  double ra, dec, dra, ddec;
     8  double x1, y1, ra1, dec1;
    99  Coords coords;
    1010  Buffer *buf;
     11  KiiOverlay overlay;
    1112
    1213  Nimage = -1;
     
    1819  if (!GetImage (&Ximage, &Nimage)) return (FALSE);
    1920 
    20   ISCEL = FALSE;
     21  celestial = FALSE;
    2122  if ((N = get_argument (argc, argv, "-c"))) {
    2223    remove_argument (N, &argc, argv);
    23     ISCEL = TRUE;
     24    celestial = TRUE;
    2425  }
    2526 
    26   ISPIX = FALSE;
    27   if ((N = get_argument (argc, argv, "-p"))) {
     27  pixscale = FALSE;
     28  if ((N = get_argument (argc, argv, "-pixscale"))) {
    2829    remove_argument (N, &argc, argv);
    29     ISPIX = TRUE;
     30    pixscale = TRUE;
    3031  }
    3132
     
    3536  }
    3637 
    37   if (!SelectOverlay (argv[1], &n))
    38     return (FALSE);
    39 
    40   if (ISCEL) {
     38  if (celestial) {
    4139    if ((buf = SelectBuffer (GetImageName(), OLDBUFFER, TRUE)) == NULL) return (FALSE);
    4240    GetCoords (&coords, &buf[0].header);
    4341  }
    4442
    45   ra = atof(argv[3]);
    46   dec = atof(argv[4]);
    47   dra = atof(argv[5]);
    48   ddec = atof(argv[6]);
    49   if (ISCEL) {
    50     RD_to_XY (&x, &y, ra, dec, &coords);
    51     if (!ISPIX) {
     43  if (celestial) {
     44    ra   = atof(argv[3]);
     45    dec  = atof(argv[4]);
     46    dra  = atof(argv[5]);
     47    ddec = atof(argv[6]);
     48
     49    fRD_to_XY (&overlay.x, &overlay.y, ra, dec, &coords);
     50    if (pixscale) {
     51      overlay.dx = atof(argv[5]);
     52      overlay.dy = atof(argv[6]);
     53    } else {
    5254      ra1 = ra + dra;
    5355      dec1 = dec + ddec;
    5456      RD_to_XY (&x1, &y1, ra1, dec1, &coords);
    55       dx = x1 - x;
    56       dy = y1 - y;
    57     } else {
    58       dx = atof(argv[5]);
    59       dy = atof(argv[6]);
     57      overlay.dx = x1 - overlay.x;
     58      overlay.dy = y1 - overlay.y;
    6059    }
    6160  }
    6261  else {
    63     x = ra;
    64     y = dec;
    65     dx = dra;
    66     dy = ddec;
     62    overlay.x  = atof(argv[3]);
     63    overlay.y  = atof(argv[4]);
     64    overlay.dx = atof(argv[5]);
     65    overlay.dy = atof(argv[6]);
    6766  }
    68 
    69   SendGraphCommand (Ximage, 4, "LOAD");
    70   SendGraphCommand (Ximage, 16, "OVERLAY %6d ", n);
    71   SendGraphCommand (Ximage, 16, "NLINES %7d ", 1);
    72   SendGraphCommand (Ximage, 128, "%15s %20.10f %20.10f %20.10f %20.10f ", argv[2], x, y, dx, dy);
    73   SendGraphCommand (Ximage, 16, "DONE");
     67  overlay.type = KiiOverlayTypeByName (argv[2]);
     68  KiiLoadOverlay (Ximage, &overlay, 1, argv[1]);
    7469  return (TRUE);
    7570}
    76 
Note: See TracChangeset for help on using the changeset viewer.