IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jan 8, 2005, 2:45:18 PM (22 years ago)
Author:
eugene
Message:

minor changes

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Ohana/src/opihi/mana/findpeaks.c

    r2826 r2938  
    77  int Npeak, NPEAK, Npeaks;
    88  float *v;
    9   int *peaks, *keep, *xp, *yp;
     9  int *peaks, *keep, *xp, *yp, *zp;
    1010  float threshold, vt, vo;
    11   Vector *vecx, *vecy;
     11  Vector *vecx, *vecy, *vecz;
    1212  Buffer *buf;
    1313
     
    1919  if ((vecx = SelectVector ("xp", ANYVECTOR, TRUE)) == NULL) return (FALSE);
    2020  if ((vecy = SelectVector ("yp", ANYVECTOR, TRUE)) == NULL) return (FALSE);
     21  if ((vecz = SelectVector ("zp", ANYVECTOR, TRUE)) == NULL) return (FALSE);
    2122
    2223  Nx = buf[0].matrix.Naxis[0];
     
    2728  ALLOCATE (xp, int, NPEAK);
    2829  ALLOCATE (yp, int, NPEAK);
     30  ALLOCATE (zp, int, NPEAK);
    2931
    3032  /* find peaks for each row */
     
    3739      REALLOCATE (xp, int, NPEAK);
    3840      REALLOCATE (yp, int, NPEAK);
     41      REALLOCATE (zp, int, NPEAK);
    3942    }
    4043    for (i = 0; i < Npeaks; i++) {
    4144      xp[Npeak + i] = peaks[i];
    4245      yp[Npeak + i] = j;
     46      zp[Npeak + i] = v[peaks[i] + j*Nx];
    4347    }
    4448    Npeak += Npeaks;
     
    7478  REALLOCATE (vecx[0].elements, float, MAX (Npeak, 1));
    7579  REALLOCATE (vecy[0].elements, float, MAX (Npeak, 1));
     80  REALLOCATE (vecz[0].elements, float, MAX (Npeak, 1));
    7681  /* eliminate non-local peaks */
    7782  for (N = n = 0; n < Npeak; n++) {
     
    7984    vecx[0].elements[N] = xp[n];
    8085    vecy[0].elements[N] = yp[n];
     86    vecz[0].elements[N] = zp[n];
    8187    N ++;
    8288  }
     89  free (xp);
     90  free (yp);
     91  free (zp);
     92  free (keep);
    8393
    8494  REALLOCATE (vecx[0].elements, float, MAX (N, 1));
    8595  REALLOCATE (vecy[0].elements, float, MAX (N, 1));
    86   vecx[0].Nelements = vecy[0].Nelements = N;
     96  REALLOCATE (vecz[0].elements, float, MAX (N, 1));
     97  vecx[0].Nelements = vecy[0].Nelements = vecz[0].Nelements = N;
    8798
    8899  return (TRUE);
     
    93104}
    94105
     106
Note: See TracChangeset for help on using the changeset viewer.