IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 29816


Ignore:
Timestamp:
Nov 24, 2010, 12:01:46 PM (15 years ago)
Author:
eugene
Message:

added densify function, section -image, resize -by-image

Location:
branches/eam_branches/ipp-20101103/Ohana/src/opihi
Files:
1 added
6 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/ipp-20101103/Ohana/src/opihi/cmd.astro/region.c

    r27435 r29816  
    5555  if ((argc != 4) && (argc != 5)) {
    5656    gprint (GP_ERR, "USAGE: region Ra Dec Radius [projection] [orientation]\n");
     57    gprint (GP_ERR, "  [-image] [-ew] [+ew] [-ns] [+ns] [-no-clear]\n");
    5758    gprint (GP_ERR, " current: %f %f (%f x %f) (%s)\n",
    5859             graphmode.coords.crval1, graphmode.coords.crval2,
  • branches/eam_branches/ipp-20101103/Ohana/src/opihi/cmd.data/Makefile

    r29540 r29816  
    3636$(SRC)/cut.$(ARCH).o            \
    3737$(SRC)/delete.$(ARCH).o \
     38$(SRC)/densify.$(ARCH).o        \
    3839$(SRC)/device.$(ARCH).o \
    3940$(SRC)/dimendown.$(ARCH).o      \
  • branches/eam_branches/ipp-20101103/Ohana/src/opihi/cmd.data/init.c

    r29540 r29816  
    2525int dbselect         PROTO((int, char **));
    2626int delete           PROTO((int, char **));
     27int densify          PROTO((int, char **));
    2728int device           PROTO((int, char **));
    2829int dimendown        PROTO((int, char **));
     
    161162  {1, "dbselect",     dbselect,         "extract vectors from mysql database table"},
    162163  {1, "delete",       delete,           "delete vectors or images"},
     164  {1, "densify",      densify,          "create an image histogram from a set of vectors"},
    163165  {1, "device",       device,           "set / get current graphics device"},
    164166  {1, "dimendown",    dimendown,        "convert image to vector"},
  • branches/eam_branches/ipp-20101103/Ohana/src/opihi/cmd.data/resize.c

    r13479 r29816  
    1717  if (!GetImage (NULL, &kapa, name)) return (FALSE);
    1818  FREE (name);
     19
     20  if ((N = get_argument (argc, argv, "-by-image"))) {
     21    remove_argument (N, &argc, argv);
     22    KiiResizeByImage (kapa);
     23    return (TRUE);
     24  }
    1925
    2026  if (argc != 3) {
  • branches/eam_branches/ipp-20101103/Ohana/src/opihi/cmd.data/section.c

    r27790 r29816  
    11# include "data.h"
    22
    3 enum {NONE, LIST, UP, DOWN, TOP, BOTTOM, TOOL, BG};
     3enum {NONE, LIST, UP, DOWN, TOP, BOTTOM, TOOL, BG, IMAGE};
    44
    55int section (int argc, char **argv) {
     
    4949    remove_argument (N, &argc, argv);
    5050    action = BG;
     51  }
     52
     53  if ((N = get_argument (argc, argv, "-image"))) {
     54    remove_argument (N, &argc, argv);
     55    action = IMAGE;
    5156  }
    5257
     
    130135  }
    131136 
     137  if (argc == 4) {
     138    /* set section */
     139    section.name = argv[1];
     140    section.x = atof (argv[2]);
     141    section.y = atof (argv[3]);
     142    section.bg = background;
     143    KapaSetSectionByImage (kapa, &section);
     144    return (TRUE);
     145  }
     146
    132147  if (argc == 6) {
    133148    /* set section */
     
    142157  }
    143158  gprint (GP_ERR, "USAGE: section name [x y dx dy]\n");
     159  gprint (GP_ERR, "USAGE: section name [-image x y] : width based on current image\n");
    144160  gprint (GP_ERR, "USAGE: section name [-list] [-up] [-down] [-top] [-bottom]\n");
    145161  return (FALSE);
  • branches/eam_branches/ipp-20101103/Ohana/src/opihi/lib.data/starfuncs.c

    r20936 r29816  
    55  double *ring;
    66  double x, y, x2, y2, xy, I, sky, FWHMx, FWHMy, value, mag, Sxy;
    7   int i, j, n, Npix2, Nring, Nmax;
     7  int i, j, n, Radius, Nring, Nmax;
    88  double Npts, gain, dsky2, dmag, peak, offset;
    99  char *string;
     
    1919  Nborder = MIN (1000, Nborder);
    2020 
    21   Npix2 = (int)(0.5*Npix);
    22   Npix = 2 * Npix2 + 1;
     21  Radius = (int)(0.5*Npix);
     22  Npix = 2 * Radius + 1;
    2323  Nring = 4*Nborder*(Nborder + Npix);
    2424  ALLOCATE (ring, double, Nring);
     
    2727  n = 0; 
    2828  for (j = 0; j < Nborder; j++) {
    29     for (i = X - Npix2 - Nborder; i < X + Npix2 + Nborder + 1; i++, n+=2) {
    30       ring[n]   = gfits_get_matrix_value (matrix, i, (int)(Y - Npix2 - j));
    31       ring[n+1] = gfits_get_matrix_value (matrix, i, (int)(Y + Npix2 + j));
    32     }
    33     for (i = Y - Npix2; i < Y + Npix2 + 1; i++, n+=2) {
    34       ring[n]   = gfits_get_matrix_value (matrix, (int)(X - Npix2 - j), i);
    35       ring[n+1] = gfits_get_matrix_value (matrix, (int)(X + Npix2 + j), i);
     29    for (i = X - Radius - Nborder; i < X + Radius + Nborder + 1; i++, n+=2) {
     30      ring[n]   = gfits_get_matrix_value (matrix, i, (int)(Y - Radius - j));
     31      ring[n+1] = gfits_get_matrix_value (matrix, i, (int)(Y + Radius + j));
     32    }
     33    for (i = Y - Radius; i < Y + Radius + 1; i++, n+=2) {
     34      ring[n]   = gfits_get_matrix_value (matrix, (int)(X - Radius - j), i);
     35      ring[n+1] = gfits_get_matrix_value (matrix, (int)(X + Radius + j), i);
    3636    }
    3737  }
     
    5050  Npts = Nmax = 0;
    5151  x = y = x2 = y2 = xy = I = 0;
    52   for (i = X - Npix2; i < X + Npix2 + 1; i++) {
    53     for (j = Y - Npix2; j < Y + Npix2 + 1; j++) {
     52  for (i = X - Radius; i < X + Radius + 1; i++) {
     53    for (j = Y - Radius; j < Y + Radius + 1; j++) {
     54      if (hypot((i-X), (j-Y)) > Radius) continue;
    5455      value = gfits_get_matrix_value (matrix, i, j);
    5556      offset = value - sky;
     
    9293  set_variable ("Zpk", peak);
    9394  set_int_variable ("Nsat", Nmax);
     95  set_int_variable ("Npts", Npts);
    9496 
    9597  gprint (GP_LOG, "%f %f %f %f %f %f %f %f\n", x, y, FWHMx, FWHMy, sky, I, mag, dmag);
Note: See TracChangeset for help on using the changeset viewer.