IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Dec 5, 2010, 10:04:42 PM (16 years ago)
Author:
eugene
Message:

handle errors in dvo I/O functions; better support for DIS images; merge in high-speed mods from Niall; systematic errors in astrometry (somewhat hackish); add fits I/O option to succeed reading a short file (padding as needed); various kapa improvements (frames consistent in X, PS, PNG; fix tick label signif digits; add function for image overlays; better thick box lines; PNG of the image); bDrawBuffer mods to drop static buffer and refer to passed through buffer; ResizeByImage; DefineSectionByImage; buutos to do png & jpeg; add program roc for raid over cluster; support for mosaic photcodes in dvo image plot; densify; section name [-image x y] : width based on current image; resize -by-image; threaded addstar -resort; threaded dvomerge; dvorepair; dvoverify; dvomerge continue; dvomerge from list (of regions)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Ohana/src/kapa2/src/DefineSection.c

    r27790 r29938  
    4040  return (TRUE);
    4141}
     42
     43// define the section, but do not create a graph or image
     44int DefineSectionByImage (int sock) {
     45 
     46  int N, bg;
     47  char name[128];
     48  double x, y, dx, dy;
     49  int dXm, dXp, dYm, dYp;
     50  double x0, y0, x1, y1, expand;
     51  Section *section;
     52  Graphic *graphic;
     53  KapaImageWidget *image;
     54
     55  KiiScanMessage (sock, "%s %lf %lf %d", name, &x, &y, &bg);
     56
     57  N = GetSectionByName (name);
     58  section = GetSectionByNumber (N);
     59  image = section->image;
     60  if (!image) {
     61    fprintf (stderr, "no image to define section\n");
     62    return (TRUE);
     63  }
     64  SetActiveSectionByNumber (N);
     65
     66  graphic = GetGraphic ();
     67
     68  GetGraphBoundary (section, &x0, &y0, &x1, &y1, &dXm, &dXp, &dYm, &dYp);
     69
     70  expand = 1.0;
     71  if (image[0].picture.expand > 0) {
     72    expand = image[0].picture.expand;
     73  }
     74  if (image[0].picture.expand < 0) {
     75    expand = 1.0 / fabs((double)image[0].picture.expand);
     76  }
     77
     78  // pixel dimensions of the imaging region + boundary
     79  dx = image[0].image[0].matrix.Naxis[0]*expand + x1;
     80  dy = image[0].image[0].matrix.Naxis[1]*expand + y1;
     81
     82  section[0].x = x;
     83  section[0].y = y;
     84  section[0].bg = bg;
     85  section[0].dx = dx / graphic[0].dx;
     86  section[0].dy = dy / graphic[0].dy;
     87
     88  // if (section[0].x != x)   MoveSection = TRUE;
     89  // if (section[0].y != y)   MoveSection = TRUE;
     90  // if (section[0].dx != dx) MoveSection = TRUE;
     91  // if (section[0].dy != dy) MoveSection = TRUE;
     92
     93  SetSectionSizes (section);
     94  Refresh ();
     95
     96  return (TRUE);
     97}
Note: See TracChangeset for help on using the changeset viewer.