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/opihi/lib.data/starfuncs.c

    r20936 r29938  
    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.