IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 26603


Ignore:
Timestamp:
Jan 14, 2010, 11:07:43 AM (16 years ago)
Author:
eugene
Message:

profile was not using pixel center, and was stomping on invalid memory

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/20091201/Ohana/src/opihi/cmd.astro/profile.c

    r20936 r26603  
    3131  ResetVector (yvec, OPIHI_FLT, (int)SQ(2*N+1));
    3232
    33   bzero (yvec[0].elements.Flt, (int)SQ(2*N+1)*sizeof(opihi_flt)+1);
     33  bzero (yvec[0].elements.Flt, (int)SQ(2*N+1)*sizeof(opihi_flt));
    3434  V = (float *)(buf[0].matrix.buffer);
    3535  Npt = 0;
    3636  Nx = buf[0].matrix.Naxis[0];
    37   for (i = sx - N; i < sx + N; i++) {
    38     for (j = sy - N; j < sy + N; j++, Npt++) {
     37  for (i = sx - N; i <= sx + N; i++) {
     38    for (j = sy - N; j <= sy + N; j++, Npt++) {
    3939      yvec[0].elements.Flt[Npt] = V[i + j*Nx];
    40       xvec[0].elements.Flt[Npt] = hypot (i - sx, j - sy);
     40      xvec[0].elements.Flt[Npt] = hypot (i + 0.5 - sx, j + 0.5 - sy);
    4141    }
    4242  }
Note: See TracChangeset for help on using the changeset viewer.